From 1535409d00ab73196c8118e94433fbaee769636a Mon Sep 17 00:00:00 2001 From: "yanan.zhangyn" Date: Wed, 9 Sep 2026 13:52:49 +0800 Subject: [PATCH 1/4] fix(studio): preserve reused MCP credentials --- .../harness-sidecar-release-gate.yaml | 12 +- frontend/src/adk/client.ts | 12 +- frontend/src/create/CustomCreate.tsx | 1 + frontend/tests/deploymentConfigUi.test.mjs | 4 + ...enerated_agent_backend_codegen_extended.py | 68 ++- tests/cli/test_legacy_runtime_recovery.py | 194 ++++++++ tests/cli/test_studio_rbac.py | 239 ++++++++++ veadk/cli/cli_frontend.py | 149 ++++-- veadk/cli/generated_agent_codegen.py | 13 + veadk/cli/legacy_runtime_recovery.py | 28 ++ .../{index-DrDSbkyg.js => index-DZf0wXGZ.js} | 440 +++++++++--------- ...CEoOh5b3.js => CodeDiffEditor-Dx8z_oo1.js} | 2 +- ...d9.js => MarkdownPromptEditor-C4VlPACI.js} | 2 +- .../{arc-Cf13o3c-.js => arc-CXEGKubz.js} | 2 +- ...hannel-BOyxvQK6.js => channel-Cb_XsJlf.js} | 2 +- ...ex.es-ywE1lWsR.js => index.es-BRzMxOGE.js} | 2 +- ...n-CV8XpAZ1.js => jspdf.es.min-nhrMhkEQ.js} | 6 +- ...{linear-BH38WWmj.js => linear-CeDfK4RZ.js} | 2 +- ...57.js => abnfDiagram-N423BO3Z-BCBAEFx3.js} | 2 +- ... architectureDiagram-T3A2C74G-Bqx-XTbw.js} | 2 +- ...k.js => blockDiagram-VBNYF7ZC-DdQPoes9.js} | 2 +- ...qELS.js => c4Diagram-5PPSVZJV-Bra67sdL.js} | 2 +- ...Cpt1I9VE.js => chunk-2GRJ4B5K-CJwzhEYx.js} | 2 +- ...CU-_PF6u.js => chunk-2Q5K7J3B-naaeokok.js} | 2 +- ...aLKUoBsu.js => chunk-5RXB4S5H-gjMuKq5U.js} | 2 +- ...Bw-frwih.js => chunk-5VM5RSS4-CjM7JLQ8.js} | 2 +- ...BCw2FKcW.js => chunk-6Q2QTUOP-D_idPgQl.js} | 2 +- ...CjC9SgQf.js => chunk-GF5L2VYU-BsdMVsbj.js} | 2 +- ...BOJuOOaZ.js => chunk-JWPE2WC7-CWI15yjG.js} | 2 +- ...BFMFlWAI.js => chunk-KBJHAD2P-CNEAUy5I.js} | 2 +- ...B6K8N_TN.js => chunk-RYQCIY6F-DfwPULTh.js} | 2 +- ...DwzbC2Dj.js => chunk-XXDRQBXY-DWj8dVYC.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js | 1 + .../mermaid/classDiagram-JCYQIIEL-DCAOEH9i.js | 1 - .../classDiagram-v2-OCEON4UE-B8-0NVyL.js | 1 + .../classDiagram-v2-OCEON4UE-DCAOEH9i.js | 1 - ...V.js => cose-bilkent-JH36ORCC-GA0ao5B_.js} | 2 +- ...pH19Te.js => cynefin-OW5HDTMX-DAp7f4c2.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-B1L5kWTo.js} | 2 +- ...B7OcovWp.js => dagre-VZM6K2ZE-CoK1hzcv.js} | 2 +- ...ojOXvj.js => diagram-7IWD3JNH-SC1XlXnp.js} | 2 +- ...SmX2ct.js => diagram-B4RE2ZJO-60-I7wkZ.js} | 2 +- ...BvwrFE.js => diagram-LBJQPF4R-Du7527yu.js} | 2 +- ...R-JIUC.js => diagram-Q27KOJAE-s-EXVUXN.js} | 2 +- ...9_oIaI.js => diagram-UB23O5K3-BSO8qbf3.js} | 2 +- ...jm.js => ebnfDiagram-BXEA7PRR-D1IH6bGb.js} | 2 +- ..._eox.js => erDiagram-JOGREHBK-llttpfV5.js} | 2 +- ...2h.js => flowDiagram-UKHOOZJN-CvT_V9C-.js} | 2 +- ...G.js => ganttDiagram-PKOTCBZU-CuYQpRVn.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-D9mrrxwi.js} | 2 +- ...Eo.js => infoDiagram-6WML65LV-BdqavOdZ.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-C-ri3OTd.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-DItBOT4l.js} | 2 +- ...=> kanban-definition-27J2QSJJ-DwDU3r_E.js} | 2 +- ...e-DIFRJAlh.js => mermaid.core-DnksLuoJ.js} | 8 +- ...> mindmap-definition-FAOFIHXS-CgfY0Ls2.js} | 2 +- ...J9Y.js => pegDiagram-VL7TDLO6-Reiw3hvB.js} | 2 +- ...Lc4.js => pieDiagram-7S7Q4E2Y-DnQbiAd6.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS-BHagSQYD.js} | 2 +- ...s => railroadDiagram-AXF67PYL-Biow3FMP.js} | 2 +- ...> requirementDiagram-LRYGKXZP-JYMpFkh0.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-BF_iEz9u.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-Bqv2AfOc.js} | 2 +- ...Uk.js => sizeCapture-X5ZJPWSS-XOPLWqcN.js} | 2 +- ...6.js => stateDiagram-OKZ733FA-7KBZw4rp.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-DY-saesF.js | 1 + .../stateDiagram-v2-UEYNNEHI-DsOdxbWm.js | 1 - ...-g_Y.js => swimlanes-SLNWSIFB-D1dh_Nns.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-ChusEoNO.js | 8 - .../swimlanesDiagram-ULZ7WXOC-D8bBal3H.js | 8 + ... timeline-definition-Z64GVDOM-Dz8AxK7r.js} | 2 +- ...xw.js => vennDiagram-T6HMQDX7-qZKAtDe0.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-DvjwaJgh.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-DfWAA2AU.js} | 2 +- veadk/webui/index.html | 2 +- 75 files changed, 962 insertions(+), 344 deletions(-) rename veadk/webui/assets/app/{index-DrDSbkyg.js => index-DZf0wXGZ.js} (83%) rename veadk/webui/assets/chunks/{CodeDiffEditor-CEoOh5b3.js => CodeDiffEditor-Dx8z_oo1.js} (99%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-D_TDjSd9.js => MarkdownPromptEditor-C4VlPACI.js} (99%) rename veadk/webui/assets/chunks/{arc-Cf13o3c-.js => arc-CXEGKubz.js} (98%) rename veadk/webui/assets/chunks/{channel-BOyxvQK6.js => channel-Cb_XsJlf.js} (53%) rename veadk/webui/assets/chunks/{index.es-ywE1lWsR.js => index.es-BRzMxOGE.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-CV8XpAZ1.js => jspdf.es.min-nhrMhkEQ.js} (99%) rename veadk/webui/assets/chunks/{linear-BH38WWmj.js => linear-CeDfK4RZ.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-B29YUl57.js => abnfDiagram-N423BO3Z-BCBAEFx3.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-PMJr7sI-.js => architectureDiagram-T3A2C74G-Bqx-XTbw.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-CNTRtLYk.js => blockDiagram-VBNYF7ZC-DdQPoes9.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-BChGqELS.js => c4Diagram-5PPSVZJV-Bra67sdL.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-Cpt1I9VE.js => chunk-2GRJ4B5K-CJwzhEYx.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-CU-_PF6u.js => chunk-2Q5K7J3B-naaeokok.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-aLKUoBsu.js => chunk-5RXB4S5H-gjMuKq5U.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-Bw-frwih.js => chunk-5VM5RSS4-CjM7JLQ8.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-BCw2FKcW.js => chunk-6Q2QTUOP-D_idPgQl.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-CjC9SgQf.js => chunk-GF5L2VYU-BsdMVsbj.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-BOJuOOaZ.js => chunk-JWPE2WC7-CWI15yjG.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-BFMFlWAI.js => chunk-KBJHAD2P-CNEAUy5I.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-B6K8N_TN.js => chunk-RYQCIY6F-DfwPULTh.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-DwzbC2Dj.js => chunk-XXDRQBXY-DWj8dVYC.js} (53%) create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DCAOEH9i.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DCAOEH9i.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-P8wTxlHV.js => cose-bilkent-JH36ORCC-GA0ao5B_.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-DKpH19Te.js => cynefin-OW5HDTMX-DAp7f4c2.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-eH3Rj8nF.js => cynefinDiagram-MW4NZA55-B1L5kWTo.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-B7OcovWp.js => dagre-VZM6K2ZE-CoK1hzcv.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-bIojOXvj.js => diagram-7IWD3JNH-SC1XlXnp.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-DmSmX2ct.js => diagram-B4RE2ZJO-60-I7wkZ.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-B7BvwrFE.js => diagram-LBJQPF4R-Du7527yu.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-fnR-JIUC.js => diagram-Q27KOJAE-s-EXVUXN.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-CD9_oIaI.js => diagram-UB23O5K3-BSO8qbf3.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-DTvFT4jm.js => ebnfDiagram-BXEA7PRR-D1IH6bGb.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-BqDJ_eox.js => erDiagram-JOGREHBK-llttpfV5.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-BBJrja2h.js => flowDiagram-UKHOOZJN-CvT_V9C-.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-6V-kA62G.js => ganttDiagram-PKOTCBZU-CuYQpRVn.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-wofP8tVj.js => gitGraphDiagram-DS77QQ5N-D9mrrxwi.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-NxEP5KEo.js => infoDiagram-6WML65LV-BdqavOdZ.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-CYK-Z6qK.js => ishikawaDiagram-WSZJBQD7-C-ri3OTd.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-83lr1vs2.js => journeyDiagram-NVQOT4AX-DItBOT4l.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-CqjnZtZ-.js => kanban-definition-27J2QSJJ-DwDU3r_E.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-DIFRJAlh.js => mermaid.core-DnksLuoJ.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-gK33vyoz.js => mindmap-definition-FAOFIHXS-CgfY0Ls2.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-C4SjAJ9Y.js => pegDiagram-VL7TDLO6-Reiw3hvB.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-Bta2ILc4.js => pieDiagram-7S7Q4E2Y-DnQbiAd6.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS-C_XF1UAa.js => quadrantDiagram-CIZ2JOQS-BHagSQYD.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-CpcTjzxu.js => railroadDiagram-AXF67PYL-Biow3FMP.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-Bkj8A__N.js => requirementDiagram-LRYGKXZP-JYMpFkh0.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-Bi2NxLcb.js => sankeyDiagram-W5VNT64P-BF_iEz9u.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-Cg7TCjlQ.js => sequenceDiagram-SI44F4Z6-Bqv2AfOc.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-C0iQGuUk.js => sizeCapture-X5ZJPWSS-XOPLWqcN.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-Cbw5Bqh6.js => stateDiagram-OKZ733FA-7KBZw4rp.js} (96%) create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DsOdxbWm.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-D8P6-g_Y.js => swimlanes-SLNWSIFB-D1dh_Nns.js} (99%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-ChusEoNO.js create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-BioTVgYN.js => timeline-definition-Z64GVDOM-Dz8AxK7r.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-DJvl0nxw.js => vennDiagram-T6HMQDX7-qZKAtDe0.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-B0YRW9sK.js => wardleyDiagram-T6FBY63Y-DvjwaJgh.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-CC6YDU2C.js => xychartDiagram-ELKLHX3M-DfWAA2AU.js} (99%) diff --git a/.github/workflows/harness-sidecar-release-gate.yaml b/.github/workflows/harness-sidecar-release-gate.yaml index 255ff4b79..2281be1b5 100644 --- a/.github/workflows/harness-sidecar-release-gate.yaml +++ b/.github/workflows/harness-sidecar-release-gate.yaml @@ -78,14 +78,16 @@ jobs: --include='*/veadk/extensions/harness/sidecar.py' \ --fail-under=91 --show-missing - - name: Verify customer Studio Agent-update regressions + - name: Verify Studio six-case lifecycle and credential regressions run: | python -m pytest -q \ - tests/cli/test_legacy_runtime_recovery.py::test_changed_unnamed_mcp_url_reuses_same_published_tool_slot \ - tests/cli/test_legacy_runtime_recovery.py::test_changed_unnamed_mcp_url_rejects_moved_credential_slot + tests/cli/test_legacy_runtime_recovery.py -k 'six_case_ or changed_unnamed_mcp_url' python -m pytest -q \ - tests/cli/test_studio_rbac.py::test_sidecar_update_resolves_or_explicitly_reuses_stored_mcp_credentials \ - -k changed-unnamed-explicit-reuse + tests/cli/test_generated_agent_backend_codegen_extended.py::test_generated_debug_applies_published_mcp_credential_contract_before_discovery \ + tests/cli/test_studio_rbac.py::test_new_deployment_only_updates_non_default_instance_range \ + tests/cli/test_studio_rbac.py::test_sidecar_deployment_uses_agentkit_cli_structured_release \ + tests/cli/test_studio_rbac.py::test_application_owned_mcp_update_routes_cover_reuse_and_additions \ + tests/cli/test_studio_rbac.py::test_sidecar_update_resolves_or_explicitly_reuses_stored_mcp_credentials - name: Install frontend dependencies working-directory: frontend diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index fc5f04c22..c1a402ba9 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -4942,7 +4942,16 @@ export async function generateAgentDraftFromRequirement( export async function createGeneratedAgentTestRun( draft: AgentDraft, - runtime?: { runtimeId: string; region: string }, + runtime?: { + runtimeId: string; + region: string; + mcpCredentialReuses?: Array<{ + agentName: string; + name: string; + url: string; + sourceAuthTokenEnv: string; + }>; + }, ): Promise { const res = await apiFetch("/web/generated-agent-test-runs", { method: "POST", @@ -4951,6 +4960,7 @@ export async function createGeneratedAgentTestRun( draft, runtimeId: runtime?.runtimeId, runtimeRegion: runtime?.region, + mcpCredentialReuses: runtime?.mcpCredentialReuses, }), }); if (!res.ok) { diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index bd1dd6d92..026351fe3 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -4503,6 +4503,7 @@ export function CustomCreate({ ? { runtimeId: deploymentTarget.runtimeId, region: deploymentTarget.region, + mcpCredentialReuses: mcpCredentialReuseValues(variantDraft), } : undefined, ); diff --git a/frontend/tests/deploymentConfigUi.test.mjs b/frontend/tests/deploymentConfigUi.test.mjs index 036978436..b14a3a435 100644 --- a/frontend/tests/deploymentConfigUi.test.mjs +++ b/frontend/tests/deploymentConfigUi.test.mjs @@ -61,6 +61,10 @@ test("offers code execution with its sandbox configuration", () => { customCreateSource, /createGeneratedAgentTestRun\([\s\S]*?debugRuntimeDraft\(variantDraft, transientModelSecretValues\)[\s\S]*?runtimeId: deploymentTarget\.runtimeId[\s\S]*?region: deploymentTarget\.region/, ); + assert.match( + customCreateSource, + /createGeneratedAgentTestRun\([\s\S]*?debugRuntimeDraft\(variantDraft, transientModelSecretValues\)[\s\S]*?mcpCredentialReuseValues\(variantDraft\)/, + ); assert.match( customCreateSource, /if \(isImeCompositionEvent\(e\.nativeEvent\)\) return;[\s\S]*?e\.key === "Enter"/, diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index 152204316..dc7ed1a7d 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -1224,18 +1224,40 @@ async def fail_mcp_discovery(draft): "edited_url", "expected_status", "expect_credential", + "explicit_reuse", + "has_published_draft", ), [ - ("reference-env", "jvmdiag", "https://8.8.8.8/mcp", 200, True), - ("reference-env", "", "https://8.8.8.8/mcp", 200, True), - ("servers-json", "jvmdiag", "https://8.8.8.8/mcp", 200, True), - ("servers-json", "", "https://8.8.8.8/mcp", 200, True), + ("reference-env", "jvmdiag", "https://8.8.8.8/mcp", 200, True, False, True), + ("reference-env", "", "https://8.8.8.8/mcp", 200, True, False, True), + ("servers-json", "jvmdiag", "https://8.8.8.8/mcp", 200, True, False, True), + ("servers-json", "", "https://8.8.8.8/mcp", 200, True, False, True), ( "servers-json", "jvmdiag", "https://8.8.8.8/changed-mcp", 422, False, + False, + True, + ), + ( + "servers-json", + "", + "https://8.8.8.8/changed-mcp", + 200, + True, + True, + True, + ), + ( + "reference-env", + "", + "https://8.8.8.8/changed-mcp", + 409, + False, + True, + False, ), ], ) @@ -1247,6 +1269,8 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov edited_url: str, expected_status: int, expect_credential: bool, + explicit_reuse: bool, + has_published_draft: bool, ) -> None: from agentkit.sdk.runtime.client import AgentkitRuntimeClient from veadk.cli.generated_agent_mcp import McpDebugConnectionError @@ -1324,13 +1348,15 @@ async def request(self, _method: str, url: str, **_kwargs: Any): if url.endswith("/list-apps"): return _FakeResponse(json_data=["legacy_agent"]) if url.endswith("/web/agent-info/legacy_agent"): - return _FakeResponse( - json_data={ - "name": "legacy_agent", - "description": "Existing Agent", - "draft": published_draft, - } - ) + agent_info: dict[str, Any] = { + "name": "legacy_agent", + "description": "Existing Agent", + } + if has_published_draft: + agent_info["draft"] = published_draft + return _FakeResponse(json_data=agent_info) + if url.endswith("/web/agent-draft/legacy_agent"): + return _FakeResponse(status_code=404) raise AssertionError(f"unexpected Runtime request path: {url}") monkeypatch.setenv("_FAAS_FUNC_ID", "function-test") @@ -1352,13 +1378,23 @@ async def request(self, _method: str, url: str, **_kwargs: Any): with TestClient(app) as client: edited_draft = json.loads(json.dumps(published_draft)) edited_draft["mcpTools"][0]["url"] = edited_url + payload = { + "draft": edited_draft, + "runtimeId": runtime.runtime_id, + "runtimeRegion": "cn-shanghai", + } + if explicit_reuse: + payload["mcpCredentialReuses"] = [ + { + "agentName": "legacy_agent", + "name": tool_name, + "url": edited_url, + "sourceAuthTokenEnv": credential_reference, + } + ] response = client.post( "/web/generated-agent-test-runs", - json={ - "draft": edited_draft, - "runtimeId": runtime.runtime_id, - "runtimeRegion": "cn-shanghai", - }, + json=payload, ) assert response.status_code == expected_status, response.text diff --git a/tests/cli/test_legacy_runtime_recovery.py b/tests/cli/test_legacy_runtime_recovery.py index 995d9ce7f..dbff74901 100644 --- a/tests/cli/test_legacy_runtime_recovery.py +++ b/tests/cli/test_legacy_runtime_recovery.py @@ -29,6 +29,7 @@ apply_source_preserving_edits, build_sidecar_mcp_servers_json, mcp_reuse_supplied_credentials, + mcp_supplied_secret_values_by_reference, mcp_secret_values_for_draft_references, retained_mcp_secret_values, build_source_preserving_overlay, @@ -862,6 +863,194 @@ def test_sidecar_mcp_servers_json_uses_server_secret_values() -> None: ] +def test_six_case_1_create_without_mcp_has_no_credential_state() -> None: + draft = {"name": "root", "mcpTools": []} + + assert ( + retained_mcp_secret_values( + published_draft=draft, + edited_draft=draft, + published_reference_values={}, + ) + == {} + ) + assert ( + build_sidecar_mcp_servers_json( + draft=draft, + secret_values={}, + ) + == "[]" + ) + + +def test_six_case_2_create_with_mcp_and_sidecar_materializes_one_secret() -> None: + draft = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://mcp.example.com/orders/mcp", + "authTokenEnv": "ORDERS_REF", + } + ], + } + + assert json.loads( + build_sidecar_mcp_servers_json( + draft=draft, + secret_values={"ORDERS_REF": "orders-secret"}, + ) + ) == [ + { + "name": "orders", + "url": "https://mcp.example.com/orders/mcp", + "headers": {"Authorization": "Bearer orders-secret"}, + } + ] + + +def test_six_case_3_update_adds_first_mcp_without_reusing_another_secret() -> None: + published = {"name": "root", "mcpTools": []} + edited = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://mcp.example.com/orders/mcp", + "authTokenEnv": "ORDERS_REF", + } + ], + } + + assert ( + retained_mcp_secret_values( + published_draft=published, + edited_draft=edited, + published_reference_values={}, + ) + == {} + ) + assert json.loads( + build_sidecar_mcp_servers_json( + draft=edited, + secret_values={"ORDERS_REF": "new-orders-secret"}, + ) + )[0]["headers"] == {"Authorization": "Bearer new-orders-secret"} + + +def test_six_case_4_update_adds_context_sidecar_without_changing_mcp_owner() -> None: + assert ( + resolve_source_preserving_mcp_owner( + sidecar_enabled=True, + effective_components={"context_engine", "compressor"}, + mcp_toolset_id="", + ) + == "application" + ) + + +def test_six_case_5_changed_mcp_supports_replace_and_no_auth_without_reuse() -> None: + published = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://old.example.com/orders/mcp", + "authTokenEnv": "ORDERS_REF", + } + ], + } + replaced = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://new.example.com/orders/mcp", + "authTokenEnv": "ORDERS_REF", + } + ], + } + no_auth = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://new.example.com/orders/mcp", + } + ], + } + + assert ( + retained_mcp_secret_values( + published_draft=published, + edited_draft=replaced, + published_reference_values={"ORDERS_REF": "old-secret"}, + ) + == {} + ) + assert json.loads( + build_sidecar_mcp_servers_json( + draft=replaced, + secret_values={"ORDERS_REF": "replacement-secret"}, + ) + )[0]["headers"] == {"Authorization": "Bearer replacement-secret"} + assert ( + "headers" + not in json.loads( + build_sidecar_mcp_servers_json(draft=no_auth, secret_values={}) + )[0] + ) + + +def test_six_case_6_update_adds_second_mcp_and_retains_only_first_secret() -> None: + published = { + "name": "root", + "mcpTools": [ + { + "name": "orders", + "transport": "http", + "url": "https://mcp.example.com/orders/mcp", + "authTokenEnv": "ORDERS_REF", + } + ], + } + edited = { + **published, + "mcpTools": [ + *published["mcpTools"], + { + "name": "inventory", + "transport": "http", + "url": "https://mcp.example.com/inventory/mcp", + "authTokenEnv": "INVENTORY_REF", + }, + ], + } + retained = retained_mcp_secret_values( + published_draft=published, + edited_draft=edited, + published_reference_values={"ORDERS_REF": "orders-secret"}, + ) + + assert retained == {"ORDERS_REF": "orders-secret"} + servers = json.loads( + build_sidecar_mcp_servers_json( + draft=edited, + secret_values={**retained, "INVENTORY_REF": "inventory-secret"}, + ) + ) + assert [server["name"] for server in servers] == ["orders", "inventory"] + assert [server["headers"]["Authorization"] for server in servers] == [ + "Bearer orders-secret", + "Bearer inventory-secret", + ] + + def test_unchanged_mcp_reference_resolves_from_structured_runtime_secret() -> None: published = { "name": "root", @@ -1019,6 +1208,11 @@ def test_changed_unnamed_mcp_url_reuses_same_published_tool_slot() -> None: }, ) + assert mcp_supplied_secret_values_by_reference( + edited_draft=edited, + supplied_credentials=reuse, + ) == {"MCP_ROOT_TOOL_1_AUTH_TOKEN": "retained-secret"} + def test_changed_unnamed_mcp_url_rejects_moved_credential_slot() -> None: published = { diff --git a/tests/cli/test_studio_rbac.py b/tests/cli/test_studio_rbac.py index 509afb13a..d453b5243 100644 --- a/tests/cli/test_studio_rbac.py +++ b/tests/cli/test_studio_rbac.py @@ -5812,6 +5812,245 @@ async def _mark_validated_oauth_token(request: Request, call_next): assert runtime_tag_sync_calls == [] +@pytest.mark.parametrize( + ("lifecycle_case", "credential_storage", "explicit_reuse"), + [ + ("change-url", "reference-env", True), + ("change-url", "reference-env", False), + ("change-url", "servers-json", True), + ("change-url", "servers-json", False), + ("add-first", "reference-env", False), + ("add-second", "reference-env", False), + ("add-second", "servers-json", False), + ], +) +def test_application_owned_mcp_update_routes_cover_reuse_and_additions( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + lifecycle_case: str, + credential_storage: str, + explicit_reuse: bool, +) -> None: + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + + agent_name = "ordinary-mcp-agent" + credential_reference = "MCP_ORDINARY_MCP_AGENT_TOOL_1_AUTH_TOKEN" + credential_value = "server-retained-route-test-secret" + added_credential_reference = "MCP_ORDINARY_MCP_AGENT_INVENTORY_AUTH_TOKEN" + added_credential_value = "new-route-test-secret" + old_url = "https://old-mcp.example.test/vtrace" + new_url = "https://new-mcp.example.test/mcp" + runtime = _runtime_with_public_endpoint( + _runtime("ordinary-mcp-runtime", "developer", managed=False) + ) + runtime.current_version_number = 3 + runtime.status = "Ready" + runtime.role_name = "runtime-role" + runtime.artifact_url = "" + runtime.envs = ( + [] + if lifecycle_case == "add-first" + else [SimpleNamespace(key=credential_reference, value=credential_value)] + ) + if credential_storage == "servers-json" and lifecycle_case != "add-first": + runtime.envs = [ + SimpleNamespace( + key="MCP_SERVERS_JSON", + value=json.dumps( + [ + { + "name": ( + "vtrace" if lifecycle_case == "change-url" else "orders" + ), + "url": old_url, + "headers": {"Authorization": f"Bearer {credential_value}"}, + } + ] + ), + ) + ] + published_mcp_tools = [] + if lifecycle_case != "add-first": + published_mcp_tools = [ + { + "name": "" if lifecycle_case == "change-url" else "orders", + "transport": "http", + "url": old_url, + "authTokenEnv": credential_reference, + } + ] + published_draft = { + "name": agent_name, + "description": "Ordinary MCP update", + "instruction": "Use the configured MCP.", + "mcpTools": published_mcp_tools, + } + captured_config: dict[str, Any] = {} + update_requests: list[Any] = [] + + def get_runtime(_self: Any, _request: Any) -> SimpleNamespace: + runtime.current_version_number = 4 if update_requests else 3 + return runtime + + def update_runtime(_self: Any, request: Any) -> SimpleNamespace: + update_requests.append(request) + return SimpleNamespace(runtime_id=runtime.runtime_id) + + def launch(*, config_file: str, **_kwargs: Any) -> SimpleNamespace: + captured_config.update(yaml.safe_load(Path(config_file).read_text())) + update_runtime( + object(), + SimpleNamespace(tags=[], apmplus_enable=False), + ) + return SimpleNamespace( + success=True, + error=None, + deploy_result=SimpleNamespace( + endpoint_url="https://runtime.example.test", + metadata={ + "runtime_id": runtime.runtime_id, + "runtime_name": runtime.name, + "runtime_endpoint": "https://runtime.example.test", + "runtime_apikey": "test-only-api-key", + }, + ), + ) + + class RuntimeAsyncClient: + def __init__(self, **_kwargs: Any) -> None: + pass + + async def __aenter__(self) -> "RuntimeAsyncClient": + return self + + async def __aexit__(self, *_args: Any) -> None: + return None + + async def request( + self, + _method: str, + url: str, + **_kwargs: Any, + ) -> _RuntimeJsonResponse: + if url.endswith("/list-apps"): + return _RuntimeJsonResponse([agent_name]) + assert url.endswith(f"/web/agent-info/{agent_name}") + return _RuntimeJsonResponse( + { + "name": agent_name, + "draft": published_draft, + } + ) + + monkeypatch.setattr(AgentkitRuntimeClient, "get_runtime", get_runtime) + monkeypatch.setattr(AgentkitRuntimeClient, "update_runtime", update_runtime) + monkeypatch.setattr("agentkit.toolkit.sdk.launch", launch) + monkeypatch.setattr("httpx.AsyncClient", RuntimeAsyncClient) + monkeypatch.setenv("VEADK_STUDIO_ACCOUNT_ID", "test-account") + monkeypatch.setattr( + "veadk.auth.veauth.ark_veauth.get_ark_token", + lambda **_kwargs: "test-only-model-key", + ) + monkeypatch.setattr( + "veadk.cli.cli_frontend._sync_volcengine_runtime_tags", + lambda **_kwargs: None, + ) + monkeypatch.setattr( + "agentkit.utils.template_utils.render_template", + lambda template: template.replace("{{account_id}}", "test-account"), + ) + app = _create_studio_app(monkeypatch, tmp_path, developers="developer") + headers = {"X-VeADK-Local-User": "developer"} + + with TestClient(app) as client: + capability = client.get( + "/web/runtime-update-capability", + params={ + "runtimeId": runtime.runtime_id, + "region": "cn-shanghai", + "appName": agent_name, + }, + headers=headers, + ) + assert capability.status_code == 200 + edited_draft = capability.json()["agent"]["draft"] + if lifecycle_case == "change-url": + edited_draft["mcpTools"][0]["url"] = new_url + else: + edited_draft["mcpTools"].append( + { + "name": "orders" if lifecycle_case == "add-first" else "inventory", + "transport": "http", + "url": new_url, + "authTokenEnv": ( + credential_reference + if lifecycle_case == "add-first" + else added_credential_reference + ), + } + ) + payload = { + "name": agent_name, + "runtimeId": runtime.runtime_id, + "appName": agent_name, + "draft": edited_draft, + "updateEtag": capability.json()["etag"], + "baseRuntimeVersion": 3, + "createEvaluationSets": False, + "files": [{"path": "app.py", "content": "app = object()\n"}], + "config": {"region": "cn-shanghai", "projectName": "default"}, + } + if lifecycle_case == "add-first": + payload["envs"] = [ + {"key": credential_reference, "value": added_credential_value} + ] + elif lifecycle_case == "add-second": + payload["envs"] = [ + { + "key": added_credential_reference, + "value": added_credential_value, + } + ] + elif explicit_reuse: + payload["mcpCredentialReuses"] = [ + { + "agentName": agent_name, + "name": "", + "url": new_url, + "sourceAuthTokenEnv": credential_reference, + } + ] + response = client.post( + "/web/deploy-agentkit", + headers=headers, + json=payload, + ) + frames = [ + json.loads(line.removeprefix("data: ")) + for line in response.iter_lines() + if line.startswith("data: ") + ] + + if lifecycle_case == "change-url" and not explicit_reuse: + assert response.status_code == 409 + assert "重新填写 Key 或确认沿用原凭证" in response.json()["detail"] + assert captured_config == {} + assert credential_value not in response.text + return + + assert response.status_code == 200 + assert frames[-1]["success"] is True + assert credential_value not in json.dumps(frames) + runtime_envs = captured_config["launch_types"]["cloud"]["runtime_envs"] + assert credential_reference in runtime_envs, sorted(runtime_envs) + assert runtime_envs[credential_reference] == ( + added_credential_value if lifecycle_case == "add-first" else credential_value + ) + if lifecycle_case == "add-second": + assert runtime_envs[added_credential_reference] == added_credential_value + assert "MCP_SERVERS_JSON" not in runtime_envs + + @pytest.mark.parametrize( ( "session_storage", diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 2e2045be5..1380464c3 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -4493,6 +4493,7 @@ async def _agentkit_proxy(request: Request, path: str): mcp_secret_values_for_draft_references, mcp_secret_values_from_runtime_environment, mcp_secret_values_from_toolset, + mcp_supplied_secret_values_by_reference, OciImageInspector, pin_source_image, preserve_runtime_skills, @@ -5684,6 +5685,15 @@ async def _create_generated_agent_test_run(request: Request): debug_mcp_env_values: dict[str, str] = {} runtime_id = test_request.runtimeId.strip() runtime_region = _coerce_cloud_region(test_request.runtimeRegion) + reuse_requests = tuple( + item.model_dump(mode="json") + for item in test_request.mcpCredentialReuses + ) + if reuse_requests and not runtime_id: + raise HTTPException( + status_code=400, + detail="MCP credential reuse requires a Runtime update target", + ) if runtime_id: edited_draft = test_request.draft.model_dump( mode="json", @@ -5697,7 +5707,7 @@ async def _create_generated_agent_test_run(request: Request): for reference in requested_references if not requested_env_values.get(reference) ) - if stored_references: + if stored_references or reuse_requests: ( update_capability, runtime, @@ -5727,7 +5737,18 @@ async def _create_generated_agent_test_run(request: Request): if isinstance(published_agent, Mapping) else None ) - if stored_references and isinstance(published_draft, Mapping): + if (stored_references or reuse_requests) and not isinstance( + published_draft, Mapping + ): + raise HTTPException( + status_code=409, + detail=_mcp_deployment_error_detail( + "legacy_mcp_reuse_source_missing" + ), + ) + if (stored_references or reuse_requests) and isinstance( + published_draft, Mapping + ): published_environment = _legacy_runtime_environment(runtime) published_references = mcp_auth_environment_keys(published_draft) published_reference_values = { @@ -5761,6 +5782,25 @@ async def _create_generated_agent_test_run(request: Request): edited_draft=edited_draft, published_reference_values=published_reference_values, ) + if reuse_requests: + try: + supplied_credentials = mcp_reuse_supplied_credentials( + published_draft=published_draft, + edited_draft=edited_draft, + published_reference_values=(published_reference_values), + reuse_requests=reuse_requests, + ) + debug_mcp_env_values.update( + mcp_supplied_secret_values_by_reference( + edited_draft=edited_draft, + supplied_credentials=supplied_credentials, + ) + ) + except LegacyRecoveryError as error: + raise HTTPException( + status_code=409, + detail=_mcp_deployment_error_detail(error.code), + ) from error project, draft = await _generate_project_and_draft_from_request( data, @@ -6688,27 +6728,27 @@ async def _deploy_to_agentkit(request: Request): set(sidecar_plan.get("effectiveComponents") or []) & {"mcp_gateway", "mcp_resilience", "sql_readonly"} ) - if sidecar_mcp_enabled and not source_preserving_requested: - if not isinstance(requested_draft, Mapping): - raise HTTPException( - status_code=400, - detail=( - "MCP 稳定性治理缺少可验证的 MCP 配置,请重新打开发布页面。" - ), - ) - try: - canonical_requested_draft = AgentDraft.model_validate( - requested_draft - ).model_dump(mode="json") - except ValidationError as error: - raise HTTPException( - status_code=400, - detail="MCP 稳定性治理配置无效,请返回 MCP 工具步骤检查。", - ) from error if not source_preserving_requested: sidecar_base_image = managed_studio_sidecar_base_image( os.getenv(SIDECAR_BASE_IMAGE_ENV, "") ) + if ( + sidecar_mcp_enabled or requested_mcp_credential_reuses + ) and not source_preserving_requested: + if not isinstance(requested_draft, Mapping): + raise HTTPException( + status_code=400, + detail="MCP 凭证复用缺少可验证的 MCP 配置,请重新打开发布页面。", + ) + try: + canonical_requested_draft = AgentDraft.model_validate( + requested_draft + ).model_dump(mode="json") + except ValidationError as error: + raise HTTPException( + status_code=400, + detail="MCP 配置无效,请返回 MCP 工具步骤检查。", + ) from error if ( requested_mcp_secret_values and not source_preserving_requested @@ -6718,15 +6758,6 @@ async def _deploy_to_agentkit(request: Request): status_code=400, detail="MCP credential identity submission requires managed Sidecar MCP", ) - if ( - requested_mcp_credential_reuses - and not source_preserving_requested - and not sidecar_mcp_enabled - ): - raise HTTPException( - status_code=400, - detail="MCP credential reuse requires managed Sidecar MCP", - ) if not source_preserving_requested: _validate_harness_sidecar_project_files(files, enabled=sidecar_enabled) use_managed_sidecar_release = ( @@ -6800,6 +6831,7 @@ async def _deploy_to_agentkit(request: Request): published_draft: Mapping[str, Any] = {} published_mcp_reference_values: dict[str, str] = {} explicit_mcp_reuse_credentials: tuple[dict[str, str], ...] = () + explicit_mcp_reuse_env_values: dict[str, str] = {} source_preserving_draft: dict[str, Any] | None = None source_preserving_source_image = "" source_preserving_mcp_secrets: dict[str, str] = {} @@ -6904,6 +6936,24 @@ def _update_identity(value: Any) -> tuple[Any, ...]: region, error.code, ) + if ( + not source_preserving_requested + and canonical_requested_draft is None + and isinstance(requested_draft, Mapping) + and any( + field in requested_draft + for field in ("mcpTools", "subAgents", "workflow") + ) + ): + try: + canonical_requested_draft = AgentDraft.model_validate( + requested_draft + ).model_dump(mode="json") + except ValidationError as error: + raise HTTPException( + status_code=400, + detail="MCP 配置无效,请返回 MCP 工具步骤检查。", + ) from error allowed_remove_runtime_env_keys = set( mcp_auth_environment_keys(published_draft) ) @@ -7119,9 +7169,43 @@ def _update_identity(value: Any) -> tuple[Any, ...]: published_reference_values=(published_mcp_reference_values), reuse_requests=requested_mcp_credential_reuses, ) + reused_mcp_env_values = mcp_supplied_secret_values_by_reference( + edited_draft=canonical_requested_draft, + supplied_credentials=explicit_mcp_reuse_credentials, + ) + if not sidecar_mcp_enabled: + retained_mcp_env_values = retained_mcp_secret_values( + published_draft=published_draft, + edited_draft=canonical_requested_draft, + published_reference_values=( + published_mcp_reference_values + ), + ) + retained_mcp_env_values = { + reference: value + for reference, value in retained_mcp_env_values.items() + if reference not in requested_remove_runtime_env_keys + } + explicit_mcp_reuse_env_values = { + **retained_mcp_env_values, + **reused_mcp_env_values, + } + requested_references = set( + mcp_auth_environment_keys(canonical_requested_draft) + ) + available_references = { + reference + for reference, value in requested_runtime_envs.items() + if value + } + available_references.update(explicit_mcp_reuse_env_values) + if requested_references.difference(available_references): + raise LegacyRecoveryError( + "legacy_mcp_credential_missing" + ) except LegacyRecoveryError as error: logger.info( - "managed Sidecar MCP credential reuse rejected " + "MCP credential update rejected " "runtime_id=%s region=%s code=%s", runtime_id, region, @@ -7543,6 +7627,13 @@ def _agentkit_sdk_credential_env(): ): runtime_envs.pop(key, None) runtime_envs["MCP_SERVERS_JSON"] = structured_mcp + elif canonical_requested_draft is not None and existing_runtime is not None: + for key in ("MCP_SERVERS_JSON", "MCP_URLS", "MCP_API_KEY"): + runtime_envs.pop(key, None) + for key in mcp_auth_environment_keys(published_draft): + if key not in extra_runtime_envs: + runtime_envs.pop(key, None) + runtime_envs.update(explicit_mcp_reuse_env_values) explicit_model_key_requested = bool( extra_runtime_envs.get("MODEL_AGENT_API_KEY", "").strip() ) diff --git a/veadk/cli/generated_agent_codegen.py b/veadk/cli/generated_agent_codegen.py index a45ef4be2..32fd2cff3 100644 --- a/veadk/cli/generated_agent_codegen.py +++ b/veadk/cli/generated_agent_codegen.py @@ -352,12 +352,25 @@ class GeneratedAgentProjectRequest(BaseModel): draft: AgentDraft +class McpCredentialReuseRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + + agentName: str + name: str + url: str + sourceAuthTokenEnv: str + + class GeneratedAgentTestRunRequest(BaseModel): model_config = ConfigDict(extra="forbid") draft: AgentDraft runtimeId: str = "" runtimeRegion: str = "cn-beijing" + mcpCredentialReuses: list[McpCredentialReuseRequest] = Field( + default_factory=list, + max_length=256, + ) class _Acc: diff --git a/veadk/cli/legacy_runtime_recovery.py b/veadk/cli/legacy_runtime_recovery.py index 9f999ed11..c962443bd 100644 --- a/veadk/cli/legacy_runtime_recovery.py +++ b/veadk/cli/legacy_runtime_recovery.py @@ -1520,6 +1520,34 @@ def mcp_reuse_supplied_credentials( return tuple(supplied) +def mcp_supplied_secret_values_by_reference( + *, + edited_draft: Mapping[str, Any], + supplied_credentials: Iterable[Mapping[str, Any]], +) -> dict[str, str]: + """Bind server-held supplied credentials to edited draft references. + + ``mcp_reuse_supplied_credentials`` validates the published source slot and + returns endpoint-bound values without trusting a browser-selected target + reference. This final join uses only the server-validated edited draft so + application-owned MCP can receive the value under its generated Runtime + environment key without exposing that value to the browser. + """ + + supplied = _canonical_supplied_mcp_credentials( + draft=edited_draft, + supplied_credentials=supplied_credentials, + ) + resolved: dict[str, str] = {} + for reference, identity in _mcp_tool_bindings(edited_draft).items(): + value = supplied.get(identity, "") + if value: + resolved[reference] = _validated_secret(value) + if len(resolved) != len(supplied): + raise LegacyRecoveryError("legacy_mcp_credential_input_invalid") + return resolved + + def _toolset_endpoint(toolset: Mapping[str, Any]) -> str: configurations = toolset.get("network_configurations") if not isinstance(configurations, list): diff --git a/veadk/webui/assets/app/index-DrDSbkyg.js b/veadk/webui/assets/app/index-DZf0wXGZ.js similarity index 83% rename from veadk/webui/assets/app/index-DrDSbkyg.js rename to veadk/webui/assets/app/index-DZf0wXGZ.js index 883e6a2fe..a79c39397 100644 --- a/veadk/webui/assets/app/index-DrDSbkyg.js +++ b/veadk/webui/assets/app/index-DZf0wXGZ.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DIFRJAlh.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-D_TDjSd9.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var RDe=Object.defineProperty;var lV=e=>{throw TypeError(e)};var IDe=(e,t,n)=>t in e?RDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ki=(e,t,n)=>IDe(e,typeof t!="symbol"?t+"":t,n),cV=(e,t,n)=>t.has(e)||lV("Cannot "+n);var uo=(e,t,n)=>(cV(e,t,"read from private field"),n?n.call(e):t.get(e)),uV=(e,t,n)=>t.has(e)?lV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jP=(e,t,n,i)=>(cV(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function PDe(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function px(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bie={exports:{}},vj={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-C4VlPACI.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +var IDe=Object.defineProperty;var lV=e=>{throw TypeError(e)};var PDe=(e,t,n)=>t in e?IDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ki=(e,t,n)=>PDe(e,typeof t!="symbol"?t+"":t,n),cV=(e,t,n)=>t.has(e)||lV("Cannot "+n);var uo=(e,t,n)=>(cV(e,t,"read from private field"),n?n.call(e):t.get(e)),uV=(e,t,n)=>t.has(e)?lV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jP=(e,t,n,i)=>(cV(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function DDe(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function px(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uie={exports:{}},vj={};/** * @license React * react-jsx-runtime.production.js * @@ -7,43 +7,43 @@ var RDe=Object.defineProperty;var lV=e=>{throw TypeError(e)};var IDe=(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 DDe=Symbol.for("react.transitional.element"),MDe=Symbol.for("react.fragment");function Uie(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:DDe,type:e,key:i,ref:t!==void 0?t:null,props:n}}vj.Fragment=MDe;vj.jsx=Uie;vj.jsxs=Uie;Bie.exports=vj;var o=Bie.exports;const Qie={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}})"},zie={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."},Vie={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Hie={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},qie={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Wie={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Gie={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Check network settings such as the shared public egress, then try again.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},Kie={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"},Xie={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"},Yie={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"},Zie={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}}"},Jie={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."},ere={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"},tre={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"},nre={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},ire={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}})"},rre={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."},sre={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list"}},are={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."},ore={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} + */var MDe=Symbol.for("react.transitional.element"),LDe=Symbol.for("react.fragment");function Qie(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:MDe,type:e,key:i,ref:t!==void 0?t:null,props:n}}vj.Fragment=LDe;vj.jsx=Qie;vj.jsxs=Qie;Uie.exports=vj;var o=Uie.exports;const zie={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}})"},Vie={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."},Hie={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},qie={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Wie={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Gie={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Kie={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Check network settings such as the shared public egress, then try again.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},Xie={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"},Yie={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"},Zie={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"},Jie={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}}"},ere={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."},tre={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"},nre={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"},ire={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},rre={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}})"},sre={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."},are={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list"}},ore={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."},lre={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Raw response: {{response}}`,errorWithRawResponse:`{{context}} Raw response: -{{response}}`,loadArkApiKeysFailed:"Failed to load Ark API keys",loadModelsFailed:"Failed to load models",runtimeAccessDenied:"This account cannot access the Runtime. Refresh the list or sign in again.",privateRuntimeUnavailable:"The Runtime was deployed, but this Studio cannot access the private Runtime. Use a Studio connected to the same VPC, or deploy with public or public plus VPC access.",runtimeTemporarilyUnavailable:"The Runtime was deployed, but Studio cannot connect yet. The gateway domain may still be propagating, or the current network or DNS cannot reach it. Try connecting again later from Manage Agents.",runtimeConnectionUnsupported:"The Runtime Agent Server does not provide a connection endpoint. Confirm that the Runtime is ready and compatible.",runtimeConnectionDenied:"The Runtime rejected the connection request. Check its authentication configuration.",listAgentsFailed:"Failed to load Agents",invalidListAppsJson:"Runtime /list-apps returned unreadable JSON.",invalidListAppsFormat:"Runtime /list-apps returned an invalid format; expected a non-empty string array.",createSessionFailedWithStatus:"Failed to create session ({{status}})",createSessionFailed:"Failed to create session",getSessionFailed:"Failed to load session",getSessionFailedWithDetail:"Failed to load session ({{status}}): {{detail}}",feedbackRuntimeOnly:"Feedback sync is supported only for sessions connected to an AgentKit Runtime",feedbackRegionMissing:"The Runtime region is missing, so feedback cannot be submitted",submitFeedbackFailed:"Failed to submit feedback",loadEvaluationSetsFailed:"Failed to load evaluation sets",loadAutoEvaluationStatusFailed:"Failed to load automatic evaluation status",loadOptimizationsFailed:"Failed to load optimization suggestions",deleteEvaluationCaseFailed:"Failed to delete the evaluation case",downloadFileFailed:"Failed to download the file",fileUnavailable:"File content is unavailable",uploadFileFailed:"File upload failed",traceDisabled:"Tracing is not enabled for this Agent. Enable it in the console first.",loadTraceFailed:"Failed to load trace data",contentTypeMissing:"Content-Type missing",traceNonJson:"Trace failed: the server returned a non-JSON response ({{contentType}}). Check the Studio API proxy configuration",invalidTraceFormat:"Trace failed: invalid response format",submitIssueFeedbackFailed:"Failed to submit issue feedback",issueFeedbackNotConfirmed:"Failed to submit issue feedback: the server did not confirm the submission",noPreviewableAgent:"This Runtime does not provide an Agent that can be previewed.",agentSearchFailed:"Agent search failed",emptySseBody:"HTTP 200 with an empty SSE response body.",noDisplayableSseReply:"HTTP 200, but the SSE response did not contain a displayable model reply.",firstSseEventTimeout:"No SSE event was received within 30 seconds.",runSessionFailed:"Session run failed",runSseFailedWithDetail:"run_sse failed ({{status}}): {{detail}}",checkRuntimeNameFailed:"Failed to check the Runtime name",invalidRuntimeNameCheck:"Failed to check the Runtime name: invalid response format",loadCloudResourcesFailed:"Failed to load cloud resources",invalidCloudResources:"The cloud resource list response has an invalid format",invalidEnvironmentMount:"The environment mount response has an invalid format",environmentMountMismatch:"The environment mount response does not match the request",environmentMountNetworkFailed:"Unable to connect to Studio, so the environment was not mounted. Check your network and try again.",environmentMountFailed:"Failed to mount the environment",clipboardUnsupported:"This browser does not support writing to the clipboard.",clipboardWriteFailed:"Unable to write to the clipboard. Check clipboard permissions.",loadSystemInfoFailed:"Failed to load system information",invalidSystemInfo:"The system information response has an invalid format",invalidEnvironmentBuild:"The environment build response has an invalid format",invalidEnvironmentBuildStep:"The environment build step response has an invalid format",invalidEnvironmentManifest:"The environment manifest response has an invalid format",invalidImageRepository:"The environment image repository response has an invalid format",invalidCodeRepository:"The environment code repository response has an invalid format",invalidImageSource:"The environment image source response has an invalid format",invalidEnvironment:"The environment response has an invalid format",invalidWorkspace:"The workspace response has an invalid format",loadWorkspacesFailed:"Failed to load workspaces",invalidWorkspaceList:"The workspace list response has an invalid format",saveWorkspaceFailed:"Failed to save the workspace",deleteWorkspaceFailed:"Failed to delete the workspace",loadEnvironmentsFailed:"Failed to load environments",invalidEnvironmentList:"The environment list response has an invalid format",probeRepositoryFailed:"Failed to inspect the code repository",invalidRepositoryProbe:"The code repository inspection response has an invalid format",exportEnvironmentCodeFailed:"Failed to export the environment share code",invalidEnvironmentCode:"The environment share code response has an invalid format",inspectEnvironmentCodeFailed:"Failed to inspect the environment share code",invalidEnvironmentCodeInspection:"The environment share code inspection response has an invalid format",importEnvironmentCodeFailed:"Failed to import the environment share code",invalidEnvironmentCodeImport:"The environment share code import response has an invalid format",studioUnavailable:"Unable to connect to Studio. Confirm that the backend is running and try again.",saveEnvironmentFailed:"Failed to save the environment",deleteEnvironmentFailed:"Failed to delete the environment",startEnvironmentBuildFailed:"Failed to start the environment build",loadEnvironmentBuildFailed:"Failed to load environment build details",loadEnvironmentManifestFailed:"Failed to load the environment manifest",invalidEnvironmentResource:"The environment resource response has an invalid format",loadEnvironmentResourcesFailed:"Failed to load environment build resources",updateCodexSandboxFailed:"Failed to update Codex Sandbox",invalidCodexSandboxUpdate:"The Codex Sandbox update response has an invalid format",loadUserPoolsFailed:"Failed to load user pools",invalidUserPoolList:"The user pool list response has an invalid format",syncGithubFailed:"Failed to sync GitHub code ({{status}})",validatingMigrationArtifact:"Validating migration artifact",uploadingCodePackage:"Uploading code package",migrationArtifactValidated:"Migration artifact validated",codePackageUploaded:"Code package uploaded",deploymentProgress:{preparing:"Preparing deployment",uploading:"Uploading the code package",building:"Building the image",buildLogsSyncing:"Building the image. Build logs are up to date.",buildLogsComplete:"Build log sync complete.",buildFailedLogsSynced:"Image build failed. Final build logs are available.",buildLogsUnavailable:"Build logs are temporarily unavailable.",finalBuildLogsUnavailable:"Final build logs are temporarily unavailable.",deploying:"Deploying the service",publishing:"Publishing the service",evaluating:"Creating evaluation sets",updating:"Updating the Runtime configuration",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run"},lre={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},cre={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},ure={common:Qie,agentkitCli:zie,cloudRegion:Vie,connections:Hie,feishuBot:qie,requestError:Wie,runSse:Gie,runtimeLogs:Kie,search:Xie,skills:Yie,sse:Zie,identity:Jie,github:ere,video:tre,websiteIntegration:nre,knowledge:ire,intelligentDevelopment:rre,migrations:sre,sandbox:are,client:ore,newChatCapabilities:lre,jsonResponse:cre},LDe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:zie,client:ore,cloudRegion:Vie,common:Qie,connections:Hie,default:ure,feishuBot:qie,github:ere,identity:Jie,intelligentDevelopment:rre,jsonResponse:cre,knowledge:ire,migrations:sre,newChatCapabilities:lre,requestError:Wie,runSse:Gie,runtimeLogs:Kie,sandbox:are,search:Xie,skills:Yie,sse:Zie,video:tre,websiteIntegration:nre},Symbol.toStringTag,{value:"Module"})),dre={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},fre={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."}},hre={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"}},pre={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},mre={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."},gre={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},bre={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"}},yre={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."},vre={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},xre={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"},wre={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Ore={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."},Sre={volcengine:"Volcengine"},kre={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"},Ere={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}}"},Cre={actions:dre,addAgent:fre,approval:hre,common:pre,conversation:mre,credentials:gre,dialogs:bre,errors:yre,feedback:vre,greetings:xre,loading:wre,oauth:Ore,providers:Sre,sandbox:kre,titles:Ere},$De=Object.freeze(Object.defineProperty({__proto__:null,actions:dre,addAgent:fre,approval:hre,common:pre,conversation:mre,credentials:gre,default:Cre,dialogs:bre,errors:yre,feedback:vre,greetings:xre,loading:wre,oauth:Ore,providers:Sre,sandbox:kre,titles:Ere},Symbol.toStringTag,{value:"Module"})),Tre="Automations",Are="Connect development tools and extend your Agents with automated workflows",_re="Search automations",Nre="Automation categories",jre={development:"Development",channels:"Messaging channels"},Rre="{{category}} automations",Ire="Open {{name}}",Pre="Available only in local deployments",Dre="No matching automations",Mre="Try searching for another name",Lre="Back to automations",$re={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},Fre={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"}}},Bre={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."}},Ure={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."}},Qre={title:Tre,description:Are,search:_re,categoriesLabel:Nre,categories:jre,resultsLabel:Rre,open:Ire,localOnly:Pre,emptyTitle:Dre,emptyDescription:Mre,backToAutomations:Lre,cards:$re,github:Fre,codingAgents:Bre,feishu:Ure},FDe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:Lre,cards:$re,categories:jre,categoriesLabel:Nre,codingAgents:Bre,default:Qre,description:Are,emptyDescription:Mre,emptyTitle:Dre,feishu:Ure,github:Fre,localOnly:Pre,open:Ire,resultsLabel:Rre,search:_re,title:Tre},Symbol.toStringTag,{value:"Module"})),zre={"zh-CN":"简体中文","en-US":"English"},BDe={languageNames:zre},UDe=Object.freeze(Object.defineProperty({__proto__:null,default:BDe,languageNames:zre},Symbol.toStringTag,{value:"Module"})),Vre={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"},Hre={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}}"},qre={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},Wre={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"},Gre={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}}"},Kre={unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished thinking",thinking:"Thinking",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"}},Xre={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},Yre={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"},Zre={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},Jre={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},ese={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"},tse={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},nse={annotation:Vre,media:Hre,runtimeLogs:qre,trace:Wre,share:Gre,blocks:Kre,tokenUsage:Xre,addAgentKit:Yre,composer:Zre,invocation:Jre,visualization:ese,markdown:tse},QDe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Yre,annotation:Vre,blocks:Kre,composer:Zre,default:nse,invocation:Jre,markdown:tse,media:Hre,runtimeLogs:qre,share:Gre,tokenUsage:Xre,trace:Wre,visualization:ese},Symbol.toStringTag,{value:"Module"})),ise={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"},rse={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},sse={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"}},ase={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. +{{response}}`,loadArkApiKeysFailed:"Failed to load Ark API keys",loadModelsFailed:"Failed to load models",runtimeAccessDenied:"This account cannot access the Runtime. Refresh the list or sign in again.",privateRuntimeUnavailable:"The Runtime was deployed, but this Studio cannot access the private Runtime. Use a Studio connected to the same VPC, or deploy with public or public plus VPC access.",runtimeTemporarilyUnavailable:"The Runtime was deployed, but Studio cannot connect yet. The gateway domain may still be propagating, or the current network or DNS cannot reach it. Try connecting again later from Manage Agents.",runtimeConnectionUnsupported:"The Runtime Agent Server does not provide a connection endpoint. Confirm that the Runtime is ready and compatible.",runtimeConnectionDenied:"The Runtime rejected the connection request. Check its authentication configuration.",listAgentsFailed:"Failed to load Agents",invalidListAppsJson:"Runtime /list-apps returned unreadable JSON.",invalidListAppsFormat:"Runtime /list-apps returned an invalid format; expected a non-empty string array.",createSessionFailedWithStatus:"Failed to create session ({{status}})",createSessionFailed:"Failed to create session",getSessionFailed:"Failed to load session",getSessionFailedWithDetail:"Failed to load session ({{status}}): {{detail}}",feedbackRuntimeOnly:"Feedback sync is supported only for sessions connected to an AgentKit Runtime",feedbackRegionMissing:"The Runtime region is missing, so feedback cannot be submitted",submitFeedbackFailed:"Failed to submit feedback",loadEvaluationSetsFailed:"Failed to load evaluation sets",loadAutoEvaluationStatusFailed:"Failed to load automatic evaluation status",loadOptimizationsFailed:"Failed to load optimization suggestions",deleteEvaluationCaseFailed:"Failed to delete the evaluation case",downloadFileFailed:"Failed to download the file",fileUnavailable:"File content is unavailable",uploadFileFailed:"File upload failed",traceDisabled:"Tracing is not enabled for this Agent. Enable it in the console first.",loadTraceFailed:"Failed to load trace data",contentTypeMissing:"Content-Type missing",traceNonJson:"Trace failed: the server returned a non-JSON response ({{contentType}}). Check the Studio API proxy configuration",invalidTraceFormat:"Trace failed: invalid response format",submitIssueFeedbackFailed:"Failed to submit issue feedback",issueFeedbackNotConfirmed:"Failed to submit issue feedback: the server did not confirm the submission",noPreviewableAgent:"This Runtime does not provide an Agent that can be previewed.",agentSearchFailed:"Agent search failed",emptySseBody:"HTTP 200 with an empty SSE response body.",noDisplayableSseReply:"HTTP 200, but the SSE response did not contain a displayable model reply.",firstSseEventTimeout:"No SSE event was received within 30 seconds.",runSessionFailed:"Session run failed",runSseFailedWithDetail:"run_sse failed ({{status}}): {{detail}}",checkRuntimeNameFailed:"Failed to check the Runtime name",invalidRuntimeNameCheck:"Failed to check the Runtime name: invalid response format",loadCloudResourcesFailed:"Failed to load cloud resources",invalidCloudResources:"The cloud resource list response has an invalid format",invalidEnvironmentMount:"The environment mount response has an invalid format",environmentMountMismatch:"The environment mount response does not match the request",environmentMountNetworkFailed:"Unable to connect to Studio, so the environment was not mounted. Check your network and try again.",environmentMountFailed:"Failed to mount the environment",clipboardUnsupported:"This browser does not support writing to the clipboard.",clipboardWriteFailed:"Unable to write to the clipboard. Check clipboard permissions.",loadSystemInfoFailed:"Failed to load system information",invalidSystemInfo:"The system information response has an invalid format",invalidEnvironmentBuild:"The environment build response has an invalid format",invalidEnvironmentBuildStep:"The environment build step response has an invalid format",invalidEnvironmentManifest:"The environment manifest response has an invalid format",invalidImageRepository:"The environment image repository response has an invalid format",invalidCodeRepository:"The environment code repository response has an invalid format",invalidImageSource:"The environment image source response has an invalid format",invalidEnvironment:"The environment response has an invalid format",invalidWorkspace:"The workspace response has an invalid format",loadWorkspacesFailed:"Failed to load workspaces",invalidWorkspaceList:"The workspace list response has an invalid format",saveWorkspaceFailed:"Failed to save the workspace",deleteWorkspaceFailed:"Failed to delete the workspace",loadEnvironmentsFailed:"Failed to load environments",invalidEnvironmentList:"The environment list response has an invalid format",probeRepositoryFailed:"Failed to inspect the code repository",invalidRepositoryProbe:"The code repository inspection response has an invalid format",exportEnvironmentCodeFailed:"Failed to export the environment share code",invalidEnvironmentCode:"The environment share code response has an invalid format",inspectEnvironmentCodeFailed:"Failed to inspect the environment share code",invalidEnvironmentCodeInspection:"The environment share code inspection response has an invalid format",importEnvironmentCodeFailed:"Failed to import the environment share code",invalidEnvironmentCodeImport:"The environment share code import response has an invalid format",studioUnavailable:"Unable to connect to Studio. Confirm that the backend is running and try again.",saveEnvironmentFailed:"Failed to save the environment",deleteEnvironmentFailed:"Failed to delete the environment",startEnvironmentBuildFailed:"Failed to start the environment build",loadEnvironmentBuildFailed:"Failed to load environment build details",loadEnvironmentManifestFailed:"Failed to load the environment manifest",invalidEnvironmentResource:"The environment resource response has an invalid format",loadEnvironmentResourcesFailed:"Failed to load environment build resources",updateCodexSandboxFailed:"Failed to update Codex Sandbox",invalidCodexSandboxUpdate:"The Codex Sandbox update response has an invalid format",loadUserPoolsFailed:"Failed to load user pools",invalidUserPoolList:"The user pool list response has an invalid format",syncGithubFailed:"Failed to sync GitHub code ({{status}})",validatingMigrationArtifact:"Validating migration artifact",uploadingCodePackage:"Uploading code package",migrationArtifactValidated:"Migration artifact validated",codePackageUploaded:"Code package uploaded",deploymentProgress:{preparing:"Preparing deployment",uploading:"Uploading the code package",building:"Building the image",buildLogsSyncing:"Building the image. Build logs are up to date.",buildLogsComplete:"Build log sync complete.",buildFailedLogsSynced:"Image build failed. Final build logs are available.",buildLogsUnavailable:"Build logs are temporarily unavailable.",finalBuildLogsUnavailable:"Final build logs are temporarily unavailable.",deploying:"Deploying the service",publishing:"Publishing the service",evaluating:"Creating evaluation sets",updating:"Updating the Runtime configuration",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run"},cre={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},ure={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},dre={common:zie,agentkitCli:Vie,cloudRegion:Hie,connections:qie,feishuBot:Wie,requestError:Gie,runSse:Kie,runtimeLogs:Xie,search:Yie,skills:Zie,sse:Jie,identity:ere,github:tre,video:nre,websiteIntegration:ire,knowledge:rre,intelligentDevelopment:sre,migrations:are,sandbox:ore,client:lre,newChatCapabilities:cre,jsonResponse:ure},$De=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Vie,client:lre,cloudRegion:Hie,common:zie,connections:qie,default:dre,feishuBot:Wie,github:tre,identity:ere,intelligentDevelopment:sre,jsonResponse:ure,knowledge:rre,migrations:are,newChatCapabilities:cre,requestError:Gie,runSse:Kie,runtimeLogs:Xie,sandbox:ore,search:Yie,skills:Zie,sse:Jie,video:nre,websiteIntegration:ire},Symbol.toStringTag,{value:"Module"})),fre={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},hre={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."}},pre={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"}},mre={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},gre={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."},bre={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},yre={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"}},vre={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."},xre={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},wre={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"},Ore={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Sre={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."},kre={volcengine:"Volcengine"},Ere={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"},Cre={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}}"},Tre={actions:fre,addAgent:hre,approval:pre,common:mre,conversation:gre,credentials:bre,dialogs:yre,errors:vre,feedback:xre,greetings:wre,loading:Ore,oauth:Sre,providers:kre,sandbox:Ere,titles:Cre},FDe=Object.freeze(Object.defineProperty({__proto__:null,actions:fre,addAgent:hre,approval:pre,common:mre,conversation:gre,credentials:bre,default:Tre,dialogs:yre,errors:vre,feedback:xre,greetings:wre,loading:Ore,oauth:Sre,providers:kre,sandbox:Ere,titles:Cre},Symbol.toStringTag,{value:"Module"})),Are="Automations",_re="Connect development tools and extend your Agents with automated workflows",Nre="Search automations",jre="Automation categories",Rre={development:"Development",channels:"Messaging channels"},Ire="{{category}} automations",Pre="Open {{name}}",Dre="Available only in local deployments",Mre="No matching automations",Lre="Try searching for another name",$re="Back to automations",Fre={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},Bre={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"}}},Ure={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."}},Qre={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."}},zre={title:Are,description:_re,search:Nre,categoriesLabel:jre,categories:Rre,resultsLabel:Ire,open:Pre,localOnly:Dre,emptyTitle:Mre,emptyDescription:Lre,backToAutomations:$re,cards:Fre,github:Bre,codingAgents:Ure,feishu:Qre},BDe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:$re,cards:Fre,categories:Rre,categoriesLabel:jre,codingAgents:Ure,default:zre,description:_re,emptyDescription:Lre,emptyTitle:Mre,feishu:Qre,github:Bre,localOnly:Dre,open:Pre,resultsLabel:Ire,search:Nre,title:Are},Symbol.toStringTag,{value:"Module"})),Vre={"zh-CN":"简体中文","en-US":"English"},UDe={languageNames:Vre},QDe=Object.freeze(Object.defineProperty({__proto__:null,default:UDe,languageNames:Vre},Symbol.toStringTag,{value:"Module"})),Hre={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"},qre={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}}"},Wre={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},Gre={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"},Kre={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}}"},Xre={unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished thinking",thinking:"Thinking",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"}},Yre={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},Zre={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"},Jre={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},ese={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},tse={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"},nse={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},ise={annotation:Hre,media:qre,runtimeLogs:Wre,trace:Gre,share:Kre,blocks:Xre,tokenUsage:Yre,addAgentKit:Zre,composer:Jre,invocation:ese,visualization:tse,markdown:nse},zDe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Zre,annotation:Hre,blocks:Xre,composer:Jre,default:ise,invocation:ese,markdown:nse,media:qre,runtimeLogs:Wre,share:Kre,tokenUsage:Yre,trace:Gre,visualization:tse},Symbol.toStringTag,{value:"Module"})),rse={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"},sse={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},ase={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"}},ose={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.`},ose={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},lse={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}}"}},cse={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."}},use={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"}},dse={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},fse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},hse={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"}}},pse={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"}},mse={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."}},gse={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"}},bse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},yse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},vse={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"}},xse={common:ise,yaml:rse,validation:sse,defaults:ase,helpers:ose,intelligentDeployment:lse,codePackage:cse,buildCanvas:use,intelligent:dse,projectLibrary:fse,modePicker:hse,promptEditor:pse,skills:mse,workflow:gse,workbench:bse,traditional:yse,template:vse},zDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:use,codePackage:cse,common:ise,default:xse,defaults:ase,helpers:ose,intelligent:dse,intelligentDeployment:lse,modePicker:hse,projectLibrary:fse,promptEditor:pse,skills:mse,template:vse,traditional:yse,validation:sse,workbench:bse,workflow:gse,yaml:rse},Symbol.toStringTag,{value:"Module"})),wse={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"},Ose={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?"},Sse={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},kse={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},Ese={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Cse={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"},Tse={all:"All"},Ase={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"},_se={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."},Nse={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"},jse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},Rse={daily:"Daily",once:"Once",weekly:"Weekly"},Ise={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Pse={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."},Dse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},VDe={actions:wse,confirm:Ose,detail:Sse,drawer:kse,duration:Ese,fields:Cse,filters:Tse,history:Ase,notices:_se,page:Nse,schedule:jse,scheduleTypes:Rse,status:Ise,validation:Pse,weekdays:Dse},HDe=Object.freeze(Object.defineProperty({__proto__:null,actions:wse,confirm:Ose,default:VDe,detail:Sse,drawer:kse,duration:Ese,fields:Cse,filters:Tse,history:Ase,notices:_se,page:Nse,schedule:jse,scheduleTypes:Rse,status:Ise,validation:Pse,weekdays:Dse},Symbol.toStringTag,{value:"Module"})),Mse="Report an issue",Lse="Description",$se="Common issues",Fse="Cancel",Bse="Done",Use="Submit feedback",Qse="Submitting…",zse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},Vse={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"}},Hse={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."},qDe={title:Mse,descriptionLabel:Lse,commonIssues:$se,cancel:Fse,done:Bse,submit:Use,submitting:Qse,success:zse,dialog:Vse,page:Hse},WDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:Fse,commonIssues:$se,default:qDe,descriptionLabel:Lse,dialog:Vse,done:Bse,page:Hse,submit:Use,submitting:Qse,success:zse,title:Mse},Symbol.toStringTag,{value:"Module"})),qse={back:"Back",close:"Close"},Wse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Gse={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."},Kse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Xse={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"},Yse={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."},Zse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Jse={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},eae={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"},tae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},nae={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."},iae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},rae={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."},sae={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…"},aae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},oae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},lae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},cae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},uae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},dae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},fae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},hae={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"},pae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},mae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},gae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},GDe={common:qse,optimization:Wse,projects:Gse,framework:Kse,state:Xse,task:Yse,verification:Zse,transfer:Jse,validation:eae,duration:tae,expiry:nae,analysis:iae,activity:rae,artifact:sae,model:aae,upload:oae,deployment:lae,workspace:cae,actions:uae,capability:dae,conversation:fae,questions:hae,confirmation:pae,errors:mae,stopDialog:gae},KDe=Object.freeze(Object.defineProperty({__proto__:null,actions:uae,activity:rae,analysis:iae,artifact:sae,capability:dae,common:qse,confirmation:pae,conversation:fae,default:GDe,deployment:lae,duration:tae,errors:mae,expiry:nae,framework:Kse,model:aae,optimization:Wse,projects:Gse,questions:hae,state:Xse,stopDialog:gae,task:Yse,transfer:Jse,upload:oae,validation:eae,verification:Zse,workspace:cae},Symbol.toStringTag,{value:"Module"})),bae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},yae={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."}},vae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},xae={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"},wae={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Oae={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"},Sae={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"}},kae={compactSelect:bae,featureNotice:yae,workspace:vae,mode:xae,agentPicker:wae,skill:Oae,video:Sae},XDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:wae,compactSelect:bae,default:kae,featureNotice:yae,mode:xae,skill:Oae,video:Sae,workspace:vae},Symbol.toStringTag,{value:"Module"})),Eae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Cae={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}}"},Tae={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"},Aae={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."}}},_ae={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"},Nae={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"},jae={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"},Rae={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"},Iae={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"}},Pae={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"},Dae={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"},Mae={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.`},lse={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},cse={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}}"}},use={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."}},dse={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"}},fse={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},hse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},pse={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"}}},mse={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"}},gse={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."}},bse={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"}},yse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},vse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},xse={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"}},wse={common:rse,yaml:sse,validation:ase,defaults:ose,helpers:lse,intelligentDeployment:cse,codePackage:use,buildCanvas:dse,intelligent:fse,projectLibrary:hse,modePicker:pse,promptEditor:mse,skills:gse,workflow:bse,workbench:yse,traditional:vse,template:xse},VDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:dse,codePackage:use,common:rse,default:wse,defaults:ose,helpers:lse,intelligent:fse,intelligentDeployment:cse,modePicker:pse,projectLibrary:hse,promptEditor:mse,skills:gse,template:xse,traditional:vse,validation:ase,workbench:yse,workflow:bse,yaml:sse},Symbol.toStringTag,{value:"Module"})),Ose={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"},Sse={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?"},kse={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Ese={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},Cse={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Tse={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"},Ase={all:"All"},_se={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"},Nse={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."},jse={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"},Rse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},Ise={daily:"Daily",once:"Once",weekly:"Weekly"},Pse={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Dse={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."},Mse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},HDe={actions:Ose,confirm:Sse,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},qDe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ose,confirm:Sse,default:HDe,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},Symbol.toStringTag,{value:"Module"})),Lse="Report an issue",$se="Description",Fse="Common issues",Bse="Cancel",Use="Done",Qse="Submit feedback",zse="Submitting…",Vse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},Hse={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"}},qse={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."},WDe={title:Lse,descriptionLabel:$se,commonIssues:Fse,cancel:Bse,done:Use,submit:Qse,submitting:zse,success:Vse,dialog:Hse,page:qse},GDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:Bse,commonIssues:Fse,default:WDe,descriptionLabel:$se,dialog:Hse,done:Use,page:qse,submit:Qse,submitting:zse,success:Vse,title:Lse},Symbol.toStringTag,{value:"Module"})),Wse={back:"Back",close:"Close"},Gse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Kse={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."},Xse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Yse={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"},Zse={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."},Jse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},eae={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},tae={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"},nae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},iae={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."},rae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},sae={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."},aae={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…"},oae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},lae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},cae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},uae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},dae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},fae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},hae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},pae={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"},mae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},gae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},bae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},KDe={common:Wse,optimization:Gse,projects:Kse,framework:Xse,state:Yse,task:Zse,verification:Jse,transfer:eae,validation:tae,duration:nae,expiry:iae,analysis:rae,activity:sae,artifact:aae,model:oae,upload:lae,deployment:cae,workspace:uae,actions:dae,capability:fae,conversation:hae,questions:pae,confirmation:mae,errors:gae,stopDialog:bae},XDe=Object.freeze(Object.defineProperty({__proto__:null,actions:dae,activity:sae,analysis:rae,artifact:aae,capability:fae,common:Wse,confirmation:mae,conversation:hae,default:KDe,deployment:cae,duration:nae,errors:gae,expiry:iae,framework:Xse,model:oae,optimization:Gse,projects:Kse,questions:pae,state:Yse,stopDialog:bae,task:Zse,transfer:eae,upload:lae,validation:tae,verification:Jse,workspace:uae},Symbol.toStringTag,{value:"Module"})),yae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},vae={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."}},xae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},wae={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"},Oae={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Sae={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"},kae={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"}},Eae={compactSelect:yae,featureNotice:vae,workspace:xae,mode:wae,agentPicker:Oae,skill:Sae,video:kae},YDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Oae,compactSelect:yae,default:Eae,featureNotice:vae,mode:wae,skill:Sae,video:kae,workspace:xae},Symbol.toStringTag,{value:"Module"})),Cae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Tae={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}}"},Aae={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"},_ae={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."}}},Nae={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"},jae={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"},Rae={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"},Iae={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"},Pae={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"}},Dae={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"},Mae={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"},Lae={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"}},Lae={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"}},$ae={common:Eae,tool:Cae,threads:Tae,permissions:Aae,workspace:_ae,approval:Nae,composer:jae,launch:Rae,session:Iae,agentDetails:Pae,agentWorkspace:Dae,handoff:Mae,commands:Lae},YDe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Pae,agentWorkspace:Dae,approval:Nae,commands:Lae,common:Eae,composer:jae,default:$ae,handoff:Mae,launch:Rae,permissions:Aae,session:Iae,threads:Tae,tool:Cae,workspace:_ae},Symbol.toStringTag,{value:"Module"})),Fae={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."},Bae={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"},Uae={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Qae={cancel:"Cancel",close:"Close confirmation dialog"},ZDe={login:Fae,authExpired:Bae,navbar:Uae,confirm:Qae},JDe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Bae,confirm:Qae,default:ZDe,login:Fae,navbar:Uae},Symbol.toStringTag,{value:"Module"})),zae={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"}},Vae={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"},Hae={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"},eMe={account:zae,navigation:Vae,history:Hae},tMe=Object.freeze(Object.defineProperty({__proto__:null,account:zae,default:eMe,history:Hae,navigation:Vae},Symbol.toStringTag,{value:"Module"})),qae={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."},Wae={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Gae={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},Kae={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"},Xae={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)"},Yae={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."},Zae={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"},Jae={configSelect:qae,conversation:Wae,errorDetails:Gae,fileTree:Kae,management:Xae,generation:Yae,api:Zae},nMe=Object.freeze(Object.defineProperty({__proto__:null,api:Zae,configSelect:qae,conversation:Wae,default:Jae,errorDetails:Gae,fileTree:Kae,generation:Yae,management:Xae},Symbol.toStringTag,{value:"Module"})),eoe={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"},toe={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"},noe={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"},ioe={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},roe={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},soe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},aoe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},ooe={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"},loe={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."},coe={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"},uoe={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"},doe={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."},foe={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"},hoe={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},poe={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},moe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},goe={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"}},boe={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"},yoe={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"}},voe={agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time."},xoe={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"}},woe={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"}},iMe={common:eoe,agentKitPromo:toe,systemInfo:noe,agentWorkspace:ioe,environmentCenter:roe,deploymentSelect:soe,deploymentError:aoe,studioBuildProgress:ooe,cloudEnvironment:loe,githubCicd:coe,feishuDeployment:uoe,deploymentResources:doe,studioUpdate:foe,projectPreview:hoe,workspace:poe,resourceCollection:moe,skillSourcePicker:goe,composer:boe,agentSelector:yoe,myAgents:voe,skillCenter:xoe,knowledge:woe},rMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:toe,agentSelector:yoe,agentWorkspace:ioe,cloudEnvironment:loe,common:eoe,composer:boe,default:iMe,deploymentError:aoe,deploymentResources:doe,deploymentSelect:soe,environmentCenter:roe,feishuDeployment:uoe,githubCicd:coe,knowledge:woe,myAgents:voe,projectPreview:hoe,resourceCollection:moe,skillCenter:xoe,skillSourcePicker:goe,studioBuildProgress:ooe,studioUpdate:foe,systemInfo:noe,workspace:poe},Symbol.toStringTag,{value:"Module"})),Ooe="Website integration",Soe="Embed an AgentKit Runtime on your website as a floating chat window",koe="Back to automations",Eoe="Add website",Coe="Loading Runtime",Toe="Select Runtime",Aoe="Website domain",_oe="For example, xxxx.com or localhost:5173",Noe="Generating",joe="Generate token",Roe="Added websites",Ioe="{{count}} website",Poe="{{count}} websites",Doe="Loading website integrations",Moe="No website integrations yet",Loe="Select a Runtime and enter a website domain to generate a token",$oe="Embed instructions",Foe="Place this code before the closing body tag on your website",Boe="Copied",Uoe="Copy code",Qoe="Embed code will appear here after you add a website.",zoe="Delete the website integration for {{domain}}?",Voe={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"},Hoe={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"},sMe={title:Ooe,description:Soe,backToAutomations:koe,addWebsite:Eoe,loadingRuntime:Coe,selectRuntime:Toe,websiteDomain:Aoe,domainPlaceholder:_oe,generating:Noe,generateToken:joe,addedWebsites:Roe,websiteCount_one:Ioe,websiteCount_other:Poe,loadingIntegrations:Doe,delete:"Delete",emptyTitle:Moe,emptyDescription:Loe,embedMethod:$oe,embedInstructions:Foe,copied:Boe,copyCode:Uoe,embedHint:Qoe,confirmDelete:zoe,errors:Voe,widget:Hoe},aMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Eoe,addedWebsites:Roe,backToAutomations:koe,confirmDelete:zoe,copied:Boe,copyCode:Uoe,default:sMe,description:Soe,domainPlaceholder:_oe,embedHint:Qoe,embedInstructions:Foe,embedMethod:$oe,emptyDescription:Loe,emptyTitle:Moe,errors:Voe,generateToken:joe,generating:Noe,loadingIntegrations:Doe,loadingRuntime:Coe,selectRuntime:Toe,title:Ooe,websiteCount_one:Ioe,websiteCount_other:Poe,websiteDomain:Aoe,widget:Hoe},Symbol.toStringTag,{value:"Module"})),qoe={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"}},Woe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Goe={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"},Koe={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"},Xoe={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}}"},Yoe={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}}"}},Zoe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Joe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},ele={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},tle={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."},nle={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"},ile={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},rle={artifactLibrary:qoe,resourceMetadata:Woe,artifactEdit:Goe,codeBrowser:Koe,search:Xoe,developerResources:Yoe,library:Zoe,manageAgents:Joe,agentTopology:ele,sessionEnvironment:tle,agentKitCli:nle,studioTools:ile},oMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:nle,agentTopology:ele,artifactEdit:Goe,artifactLibrary:qoe,codeBrowser:Koe,default:rle,developerResources:Yoe,library:Zoe,manageAgents:Joe,resourceMetadata:Woe,search:Xoe,sessionEnvironment:tle,studioTools:ile},Symbol.toStringTag,{value:"Module"})),sle={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},ale={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 返回了无效的终端地址。"},ole={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},lle={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},cle={autoConfigureFailed:"飞书机器人自动配置失败"},ule={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},dle={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请检查共享公网出口等网络配置,然后重试。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},fle={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},hle={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},ple={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败"},mle={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},gle={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},ble={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"},yle={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},vle={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},xle={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},wle={invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},Ole={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表"}},Sle={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}} 返回了不安全的地址。"},kle={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"}},$ae={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"}},Fae={common:Cae,tool:Tae,threads:Aae,permissions:_ae,workspace:Nae,approval:jae,composer:Rae,launch:Iae,session:Pae,agentDetails:Dae,agentWorkspace:Mae,handoff:Lae,commands:$ae},ZDe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Dae,agentWorkspace:Mae,approval:jae,commands:$ae,common:Cae,composer:Rae,default:Fae,handoff:Lae,launch:Iae,permissions:_ae,session:Pae,threads:Aae,tool:Tae,workspace:Nae},Symbol.toStringTag,{value:"Module"})),Bae={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."},Uae={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"},Qae={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},zae={cancel:"Cancel",close:"Close confirmation dialog"},JDe={login:Bae,authExpired:Uae,navbar:Qae,confirm:zae},eMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Uae,confirm:zae,default:JDe,login:Bae,navbar:Qae},Symbol.toStringTag,{value:"Module"})),Vae={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"}},Hae={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"},qae={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"},tMe={account:Vae,navigation:Hae,history:qae},nMe=Object.freeze(Object.defineProperty({__proto__:null,account:Vae,default:tMe,history:qae,navigation:Hae},Symbol.toStringTag,{value:"Module"})),Wae={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."},Gae={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Kae={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},Xae={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"},Yae={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)"},Zae={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."},Jae={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"},eoe={configSelect:Wae,conversation:Gae,errorDetails:Kae,fileTree:Xae,management:Yae,generation:Zae,api:Jae},iMe=Object.freeze(Object.defineProperty({__proto__:null,api:Jae,configSelect:Wae,conversation:Gae,default:eoe,errorDetails:Kae,fileTree:Xae,generation:Zae,management:Yae},Symbol.toStringTag,{value:"Module"})),toe={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"},noe={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"},ioe={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"},roe={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},soe={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},aoe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},ooe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},loe={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"},coe={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."},uoe={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"},doe={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"},foe={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."},hoe={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"},poe={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},moe={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},goe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},boe={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"}},yoe={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"},voe={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"}},xoe={agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time."},woe={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"}},Ooe={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"}},rMe={common:toe,agentKitPromo:noe,systemInfo:ioe,agentWorkspace:roe,environmentCenter:soe,deploymentSelect:aoe,deploymentError:ooe,studioBuildProgress:loe,cloudEnvironment:coe,githubCicd:uoe,feishuDeployment:doe,deploymentResources:foe,studioUpdate:hoe,projectPreview:poe,workspace:moe,resourceCollection:goe,skillSourcePicker:boe,composer:yoe,agentSelector:voe,myAgents:xoe,skillCenter:woe,knowledge:Ooe},sMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:noe,agentSelector:voe,agentWorkspace:roe,cloudEnvironment:coe,common:toe,composer:yoe,default:rMe,deploymentError:ooe,deploymentResources:foe,deploymentSelect:aoe,environmentCenter:soe,feishuDeployment:doe,githubCicd:uoe,knowledge:Ooe,myAgents:xoe,projectPreview:poe,resourceCollection:goe,skillCenter:woe,skillSourcePicker:boe,studioBuildProgress:loe,studioUpdate:hoe,systemInfo:ioe,workspace:moe},Symbol.toStringTag,{value:"Module"})),Soe="Website integration",koe="Embed an AgentKit Runtime on your website as a floating chat window",Eoe="Back to automations",Coe="Add website",Toe="Loading Runtime",Aoe="Select Runtime",_oe="Website domain",Noe="For example, xxxx.com or localhost:5173",joe="Generating",Roe="Generate token",Ioe="Added websites",Poe="{{count}} website",Doe="{{count}} websites",Moe="Loading website integrations",Loe="No website integrations yet",$oe="Select a Runtime and enter a website domain to generate a token",Foe="Embed instructions",Boe="Place this code before the closing body tag on your website",Uoe="Copied",Qoe="Copy code",zoe="Embed code will appear here after you add a website.",Voe="Delete the website integration for {{domain}}?",Hoe={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"},qoe={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"},aMe={title:Soe,description:koe,backToAutomations:Eoe,addWebsite:Coe,loadingRuntime:Toe,selectRuntime:Aoe,websiteDomain:_oe,domainPlaceholder:Noe,generating:joe,generateToken:Roe,addedWebsites:Ioe,websiteCount_one:Poe,websiteCount_other:Doe,loadingIntegrations:Moe,delete:"Delete",emptyTitle:Loe,emptyDescription:$oe,embedMethod:Foe,embedInstructions:Boe,copied:Uoe,copyCode:Qoe,embedHint:zoe,confirmDelete:Voe,errors:Hoe,widget:qoe},oMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Coe,addedWebsites:Ioe,backToAutomations:Eoe,confirmDelete:Voe,copied:Uoe,copyCode:Qoe,default:aMe,description:koe,domainPlaceholder:Noe,embedHint:zoe,embedInstructions:Boe,embedMethod:Foe,emptyDescription:$oe,emptyTitle:Loe,errors:Hoe,generateToken:Roe,generating:joe,loadingIntegrations:Moe,loadingRuntime:Toe,selectRuntime:Aoe,title:Soe,websiteCount_one:Poe,websiteCount_other:Doe,websiteDomain:_oe,widget:qoe},Symbol.toStringTag,{value:"Module"})),Woe={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"}},Goe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Koe={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"},Xoe={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"},Yoe={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}}"},Zoe={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}}"}},Joe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},ele={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},tle={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},nle={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."},ile={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"},rle={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},sle={artifactLibrary:Woe,resourceMetadata:Goe,artifactEdit:Koe,codeBrowser:Xoe,search:Yoe,developerResources:Zoe,library:Joe,manageAgents:ele,agentTopology:tle,sessionEnvironment:nle,agentKitCli:ile,studioTools:rle},lMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:ile,agentTopology:tle,artifactEdit:Koe,artifactLibrary:Woe,codeBrowser:Xoe,default:sle,developerResources:Zoe,library:Joe,manageAgents:ele,resourceMetadata:Goe,search:Yoe,sessionEnvironment:nle,studioTools:rle},Symbol.toStringTag,{value:"Module"})),ale={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},ole={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 返回了无效的终端地址。"},lle={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},cle={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},ule={autoConfigureFailed:"飞书机器人自动配置失败"},dle={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},fle={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请检查共享公网出口等网络配置,然后重试。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},hle={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},ple={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},mle={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败"},gle={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},ble={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},yle={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"},vle={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},xle={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},wle={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},Ole={invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},Sle={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表"}},kle={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}} 返回了不安全的地址。"},Ele={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 原始响应: {{response}}`,errorWithRawResponse:`{{context}} 原始响应: -{{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"30 秒内未收到首个 SSE 事件。",runSessionFailed:"运行会话失败",runSseFailedWithDetail:"运行会话失败:{{status}}:{{detail}}",checkRuntimeNameFailed:"检查 Runtime 名称失败",invalidRuntimeNameCheck:"检查 Runtime 名称失败:服务返回格式错误",loadCloudResourcesFailed:"加载云资源失败",invalidCloudResources:"云资源列表响应格式无效",invalidEnvironmentMount:"挂载环境响应格式无效",environmentMountMismatch:"挂载环境响应与请求不一致",environmentMountNetworkFailed:"无法连接 Studio 服务,环境挂载未完成。请检查网络后重试。",environmentMountFailed:"挂载环境失败",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",clipboardWriteFailed:"无法写入剪贴板,请检查剪贴板权限。",loadSystemInfoFailed:"加载系统信息失败",invalidSystemInfo:"系统信息响应格式无效",invalidEnvironmentBuild:"环境构建响应格式无效",invalidEnvironmentBuildStep:"环境构建步骤响应格式无效",invalidEnvironmentManifest:"环境 Manifest 响应格式无效",invalidImageRepository:"环境镜像仓库响应格式无效",invalidCodeRepository:"环境代码仓库响应格式无效",invalidImageSource:"环境镜像来源响应格式无效",invalidEnvironment:"环境响应格式无效",invalidWorkspace:"工作区响应格式无效",loadWorkspacesFailed:"加载工作区失败",invalidWorkspaceList:"工作区列表响应格式无效",saveWorkspaceFailed:"保存工作区失败",deleteWorkspaceFailed:"删除工作区失败",loadEnvironmentsFailed:"加载环境失败",invalidEnvironmentList:"环境列表响应格式无效",probeRepositoryFailed:"探查代码仓库失败",invalidRepositoryProbe:"代码仓库探查响应格式无效",exportEnvironmentCodeFailed:"导出环境分享码失败",invalidEnvironmentCode:"环境分享码响应格式无效",inspectEnvironmentCodeFailed:"检测环境分享码失败",invalidEnvironmentCodeInspection:"环境分享码检测响应格式无效",importEnvironmentCodeFailed:"导入环境分享码失败",invalidEnvironmentCodeImport:"环境分享码导入响应格式无效",studioUnavailable:"无法连接 Studio 服务,请确认后端已启动后重试。",saveEnvironmentFailed:"保存环境失败",deleteEnvironmentFailed:"删除环境失败",startEnvironmentBuildFailed:"启动环境构建失败",loadEnvironmentBuildFailed:"读取环境构建详情失败",loadEnvironmentManifestFailed:"读取环境 Manifest 失败",invalidEnvironmentResource:"环境资源响应格式无效",loadEnvironmentResourcesFailed:"加载环境构建资源失败",updateCodexSandboxFailed:"更新 Codex Sandbox 失败",invalidCodexSandboxUpdate:"Codex Sandbox 更新响应格式无效",loadUserPoolsFailed:"加载用户池失败",invalidUserPoolList:"用户池列表响应格式无效",syncGithubFailed:"同步 GitHub 代码失败 ({{status}})",validatingMigrationArtifact:"正在校验迁移产物",uploadingCodePackage:"正在上传代码包",migrationArtifactValidated:"迁移产物校验完成",codePackageUploaded:"代码包上传完成",deploymentProgress:{preparing:"正在准备部署",uploading:"正在上传代码包",building:"正在构建镜像",buildLogsSyncing:"正在构建镜像,构建日志已同步。",buildLogsComplete:"构建日志同步完成。",buildFailedLogsSynced:"镜像构建失败,最终构建日志已同步。",buildLogsUnavailable:"暂时无法读取构建日志。",finalBuildLogsUnavailable:"暂时无法读取最终构建日志。",deploying:"正在部署服务",publishing:"正在发布服务",evaluating:"正在创建评测集",updating:"正在更新 Runtime 配置",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败"},Ele={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},Cle={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},Tle={common:sle,agentkitCli:ale,cloudRegion:ole,connections:lle,feishuBot:cle,requestError:ule,runSse:dle,runtimeLogs:fle,search:hle,skills:ple,sse:mle,identity:gle,github:ble,video:yle,websiteIntegration:vle,knowledge:xle,intelligentDevelopment:wle,migrations:Ole,sandbox:Sle,client:kle,newChatCapabilities:Ele,jsonResponse:Cle},lMe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:ale,client:kle,cloudRegion:ole,common:sle,connections:lle,default:Tle,feishuBot:cle,github:ble,identity:gle,intelligentDevelopment:wle,jsonResponse:Cle,knowledge:xle,migrations:Ole,newChatCapabilities:Ele,requestError:ule,runSse:dle,runtimeLogs:fle,sandbox:Sle,search:hle,skills:ple,sse:mle,video:yle,websiteIntegration:vle},Symbol.toStringTag,{value:"Module"})),Ale={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},_le={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。"}},Nle={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},jle={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Rle={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Ile={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},Ple={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},Dle={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},Mle={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},Lle={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},$le={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},Fle={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},Ble={volcengine:"火山引擎"},Ule={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:"已更新工作空间"},Qle={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}"},zle={actions:Ale,addAgent:_le,approval:Nle,common:jle,conversation:Rle,credentials:Ile,dialogs:Ple,errors:Dle,feedback:Mle,greetings:Lle,loading:$le,oauth:Fle,providers:Ble,sandbox:Ule,titles:Qle},cMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ale,addAgent:_le,approval:Nle,common:jle,conversation:Rle,credentials:Ile,default:zle,dialogs:Ple,errors:Dle,feedback:Mle,greetings:Lle,loading:$le,oauth:Fle,providers:Ble,sandbox:Ule,titles:Qle},Symbol.toStringTag,{value:"Module"})),Vle="自动化",Hle="连接研发工具,为智能体扩展自动化工作流",qle="搜索自动化",Wle="自动化分类",Gle={development:"研发",channels:"消息渠道"},Kle="{{category}}自动化列表",Xle="打开{{name}}",Yle="仅本地部署可用",Zle="没有匹配的自动化",Jle="请尝试搜索其他名称",ece="返回自动化列表",tce={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},nce={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 个字符"}}},ice={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:"没有可预览的文件。"}},rce={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},sce={title:Vle,description:Hle,search:qle,categoriesLabel:Wle,categories:Gle,resultsLabel:Kle,open:Xle,localOnly:Yle,emptyTitle:Zle,emptyDescription:Jle,backToAutomations:ece,cards:tce,github:nce,codingAgents:ice,feishu:rce},uMe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:ece,cards:tce,categories:Gle,categoriesLabel:Wle,codingAgents:ice,default:sce,description:Hle,emptyDescription:Jle,emptyTitle:Zle,feishu:rce,github:nce,localOnly:Yle,open:Xle,resultsLabel:Kle,search:qle,title:Vle},Symbol.toStringTag,{value:"Module"})),ace={"zh-CN":"简体中文","en-US":"English"},dMe={languageNames:ace},fMe=Object.freeze(Object.defineProperty({__proto__:null,default:dMe,languageNames:ace},Symbol.toStringTag,{value:"Module"})),oce={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},lce={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},cce={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",retention:"日志自动刷新,仅保留最近 {{count}} 行"},uce={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:"选择左侧的一个调用查看详情"},dce={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}}"},fce={unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成思考",thinking:"思考中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"}},hce={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},pce={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:"连接并添加"},mce={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},gce={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},bce={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},yce={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},vce={annotation:oce,media:lce,runtimeLogs:cce,trace:uce,share:dce,blocks:fce,tokenUsage:hce,addAgentKit:pce,composer:mce,invocation:gce,visualization:bce,markdown:yce},hMe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:pce,annotation:oce,blocks:fce,composer:mce,default:vce,invocation:gce,markdown:yce,media:lce,runtimeLogs:cce,share:dce,tokenUsage:hce,trace:uce,visualization:bce},Symbol.toStringTag,{value:"Module"})),xce={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},wce={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Oce={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},Sce={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"30 秒内未收到首个 SSE 事件。",runSessionFailed:"运行会话失败",runSseFailedWithDetail:"运行会话失败:{{status}}:{{detail}}",checkRuntimeNameFailed:"检查 Runtime 名称失败",invalidRuntimeNameCheck:"检查 Runtime 名称失败:服务返回格式错误",loadCloudResourcesFailed:"加载云资源失败",invalidCloudResources:"云资源列表响应格式无效",invalidEnvironmentMount:"挂载环境响应格式无效",environmentMountMismatch:"挂载环境响应与请求不一致",environmentMountNetworkFailed:"无法连接 Studio 服务,环境挂载未完成。请检查网络后重试。",environmentMountFailed:"挂载环境失败",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",clipboardWriteFailed:"无法写入剪贴板,请检查剪贴板权限。",loadSystemInfoFailed:"加载系统信息失败",invalidSystemInfo:"系统信息响应格式无效",invalidEnvironmentBuild:"环境构建响应格式无效",invalidEnvironmentBuildStep:"环境构建步骤响应格式无效",invalidEnvironmentManifest:"环境 Manifest 响应格式无效",invalidImageRepository:"环境镜像仓库响应格式无效",invalidCodeRepository:"环境代码仓库响应格式无效",invalidImageSource:"环境镜像来源响应格式无效",invalidEnvironment:"环境响应格式无效",invalidWorkspace:"工作区响应格式无效",loadWorkspacesFailed:"加载工作区失败",invalidWorkspaceList:"工作区列表响应格式无效",saveWorkspaceFailed:"保存工作区失败",deleteWorkspaceFailed:"删除工作区失败",loadEnvironmentsFailed:"加载环境失败",invalidEnvironmentList:"环境列表响应格式无效",probeRepositoryFailed:"探查代码仓库失败",invalidRepositoryProbe:"代码仓库探查响应格式无效",exportEnvironmentCodeFailed:"导出环境分享码失败",invalidEnvironmentCode:"环境分享码响应格式无效",inspectEnvironmentCodeFailed:"检测环境分享码失败",invalidEnvironmentCodeInspection:"环境分享码检测响应格式无效",importEnvironmentCodeFailed:"导入环境分享码失败",invalidEnvironmentCodeImport:"环境分享码导入响应格式无效",studioUnavailable:"无法连接 Studio 服务,请确认后端已启动后重试。",saveEnvironmentFailed:"保存环境失败",deleteEnvironmentFailed:"删除环境失败",startEnvironmentBuildFailed:"启动环境构建失败",loadEnvironmentBuildFailed:"读取环境构建详情失败",loadEnvironmentManifestFailed:"读取环境 Manifest 失败",invalidEnvironmentResource:"环境资源响应格式无效",loadEnvironmentResourcesFailed:"加载环境构建资源失败",updateCodexSandboxFailed:"更新 Codex Sandbox 失败",invalidCodexSandboxUpdate:"Codex Sandbox 更新响应格式无效",loadUserPoolsFailed:"加载用户池失败",invalidUserPoolList:"用户池列表响应格式无效",syncGithubFailed:"同步 GitHub 代码失败 ({{status}})",validatingMigrationArtifact:"正在校验迁移产物",uploadingCodePackage:"正在上传代码包",migrationArtifactValidated:"迁移产物校验完成",codePackageUploaded:"代码包上传完成",deploymentProgress:{preparing:"正在准备部署",uploading:"正在上传代码包",building:"正在构建镜像",buildLogsSyncing:"正在构建镜像,构建日志已同步。",buildLogsComplete:"构建日志同步完成。",buildFailedLogsSynced:"镜像构建失败,最终构建日志已同步。",buildLogsUnavailable:"暂时无法读取构建日志。",finalBuildLogsUnavailable:"暂时无法读取最终构建日志。",deploying:"正在部署服务",publishing:"正在发布服务",evaluating:"正在创建评测集",updating:"正在更新 Runtime 配置",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败"},Cle={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},Tle={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},Ale={common:ale,agentkitCli:ole,cloudRegion:lle,connections:cle,feishuBot:ule,requestError:dle,runSse:fle,runtimeLogs:hle,search:ple,skills:mle,sse:gle,identity:ble,github:yle,video:vle,websiteIntegration:xle,knowledge:wle,intelligentDevelopment:Ole,migrations:Sle,sandbox:kle,client:Ele,newChatCapabilities:Cle,jsonResponse:Tle},cMe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:ole,client:Ele,cloudRegion:lle,common:ale,connections:cle,default:Ale,feishuBot:ule,github:yle,identity:ble,intelligentDevelopment:Ole,jsonResponse:Tle,knowledge:wle,migrations:Sle,newChatCapabilities:Cle,requestError:dle,runSse:fle,runtimeLogs:hle,sandbox:kle,search:ple,skills:mle,sse:gle,video:vle,websiteIntegration:xle},Symbol.toStringTag,{value:"Module"})),_le={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Nle={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。"}},jle={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Rle={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Ile={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Ple={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},Dle={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},Mle={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},Lle={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},$le={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},Fle={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},Ble={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},Ule={volcengine:"火山引擎"},Qle={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:"已更新工作空间"},zle={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}"},Vle={actions:_le,addAgent:Nle,approval:jle,common:Rle,conversation:Ile,credentials:Ple,dialogs:Dle,errors:Mle,feedback:Lle,greetings:$le,loading:Fle,oauth:Ble,providers:Ule,sandbox:Qle,titles:zle},uMe=Object.freeze(Object.defineProperty({__proto__:null,actions:_le,addAgent:Nle,approval:jle,common:Rle,conversation:Ile,credentials:Ple,default:Vle,dialogs:Dle,errors:Mle,feedback:Lle,greetings:$le,loading:Fle,oauth:Ble,providers:Ule,sandbox:Qle,titles:zle},Symbol.toStringTag,{value:"Module"})),Hle="自动化",qle="连接研发工具,为智能体扩展自动化工作流",Wle="搜索自动化",Gle="自动化分类",Kle={development:"研发",channels:"消息渠道"},Xle="{{category}}自动化列表",Yle="打开{{name}}",Zle="仅本地部署可用",Jle="没有匹配的自动化",ece="请尝试搜索其他名称",tce="返回自动化列表",nce={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},ice={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 个字符"}}},rce={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:"没有可预览的文件。"}},sce={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},ace={title:Hle,description:qle,search:Wle,categoriesLabel:Gle,categories:Kle,resultsLabel:Xle,open:Yle,localOnly:Zle,emptyTitle:Jle,emptyDescription:ece,backToAutomations:tce,cards:nce,github:ice,codingAgents:rce,feishu:sce},dMe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:tce,cards:nce,categories:Kle,categoriesLabel:Gle,codingAgents:rce,default:ace,description:qle,emptyDescription:ece,emptyTitle:Jle,feishu:sce,github:ice,localOnly:Zle,open:Yle,resultsLabel:Xle,search:Wle,title:Hle},Symbol.toStringTag,{value:"Module"})),oce={"zh-CN":"简体中文","en-US":"English"},fMe={languageNames:oce},hMe=Object.freeze(Object.defineProperty({__proto__:null,default:fMe,languageNames:oce},Symbol.toStringTag,{value:"Module"})),lce={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},cce={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},uce={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",retention:"日志自动刷新,仅保留最近 {{count}} 行"},dce={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:"选择左侧的一个调用查看详情"},fce={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}}"},hce={unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成思考",thinking:"思考中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"}},pce={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},mce={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:"连接并添加"},gce={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},bce={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},yce={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},vce={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},xce={annotation:lce,media:cce,runtimeLogs:uce,trace:dce,share:fce,blocks:hce,tokenUsage:pce,addAgentKit:mce,composer:gce,invocation:bce,visualization:yce,markdown:vce},pMe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:mce,annotation:lce,blocks:hce,composer:gce,default:xce,invocation:bce,markdown:vce,media:cce,runtimeLogs:uce,share:fce,tokenUsage:pce,trace:dce,visualization:yce},Symbol.toStringTag,{value:"Module"})),wce={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},Oce={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Sce={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},kce={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},kce={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Ece={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Cce={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 中声明已有入口。"}},Tce={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:"添加到最后"}},Ace={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},_ce={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Nce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},jce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Rce={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 中心暂无技能。"}},Ice={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}} 条连线"}},Pce={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Dce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Mce={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:"长期"}},Lce={common:xce,yaml:wce,validation:Oce,defaults:Sce,helpers:kce,intelligentDeployment:Ece,codePackage:Cce,buildCanvas:Tce,intelligent:Ace,projectLibrary:_ce,modePicker:Nce,promptEditor:jce,skills:Rce,workflow:Ice,workbench:Pce,traditional:Dce,template:Mce},pMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Tce,codePackage:Cce,common:xce,default:Lce,defaults:Sce,helpers:kce,intelligent:Ace,intelligentDeployment:Ece,modePicker:Nce,projectLibrary:_ce,promptEditor:jce,skills:Rce,template:Mce,traditional:Dce,validation:Oce,workbench:Pce,workflow:Ice,yaml:wce},Symbol.toStringTag,{value:"Module"})),$ce={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:"查看详情"},Fce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Bce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Uce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},Qce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},zce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},Vce={all:"全部"},Hce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},qce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},Wce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Gce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Kce={daily:"每天",once:"一次性",weekly:"每周"},Xce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Yce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Zce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},mMe={actions:$ce,confirm:Fce,detail:Bce,drawer:Uce,duration:Qce,fields:zce,filters:Vce,history:Hce,notices:qce,page:Wce,schedule:Gce,scheduleTypes:Kce,status:Xce,validation:Yce,weekdays:Zce},gMe=Object.freeze(Object.defineProperty({__proto__:null,actions:$ce,confirm:Fce,default:mMe,detail:Bce,drawer:Uce,duration:Qce,fields:zce,filters:Vce,history:Hce,notices:qce,page:Wce,schedule:Gce,scheduleTypes:Kce,status:Xce,validation:Yce,weekdays:Zce},Symbol.toStringTag,{value:"Module"})),Jce="问题反馈",eue="问题描述",tue="常见问题",nue="取消",iue="完成",rue="提交反馈",sue="正在上报…",aue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},oue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},lue={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 团队,请注意隐私保护。"},bMe={title:Jce,descriptionLabel:eue,commonIssues:tue,cancel:nue,done:iue,submit:rue,submitting:sue,success:aue,dialog:oue,page:lue},yMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:nue,commonIssues:tue,default:bMe,descriptionLabel:eue,dialog:oue,done:iue,page:lue,submit:rue,submitting:sue,success:aue,title:Jce},Symbol.toStringTag,{value:"Module"})),cue={back:"返回",close:"关闭"},uue={title:"优化迁移项目",closeAria:"关闭优化窗口"},due={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},fue={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},hue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},pue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},mue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},gue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},bue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},yue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},vue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},xue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},wue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},Oue={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:"正在读取迁移产物…"},Sue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},kue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},Eue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Cue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Tue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},Aue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},_ue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Nue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},jue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Rue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Iue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},vMe={common:cue,optimization:uue,projects:due,framework:fue,state:hue,task:pue,verification:mue,transfer:gue,validation:bue,duration:yue,expiry:vue,analysis:xue,activity:wue,artifact:Oue,model:Sue,upload:kue,deployment:Eue,workspace:Cue,actions:Tue,capability:Aue,conversation:_ue,questions:Nue,confirmation:jue,errors:Rue,stopDialog:Iue},xMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Tue,activity:wue,analysis:xue,artifact:Oue,capability:Aue,common:cue,confirmation:jue,conversation:_ue,default:vMe,deployment:Eue,duration:yue,errors:Rue,expiry:vue,framework:fue,model:Sue,optimization:uue,projects:due,questions:Nue,state:hue,stopDialog:Iue,task:pue,transfer:gue,upload:kue,validation:bue,verification:mue,workspace:Cue},Symbol.toStringTag,{value:"Module"})),Pue={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Due={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Mue={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},Lue={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:"暂不可用"},$ue={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},Fue={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"},Bue={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}}秒"}},Uue={compactSelect:Pue,featureNotice:Due,workspace:Mue,mode:Lue,agentPicker:$ue,skill:Fue,video:Bue},wMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$ue,compactSelect:Pue,default:Uue,featureNotice:Due,mode:Lue,skill:Fue,video:Bue,workspace:Mue},Symbol.toStringTag,{value:"Module"})),Que={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},zue={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Vue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Hue={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 自动审查流程处理审批请求。"}}},que={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Wue={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Gue={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:"发送"},Kue={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:"重新尝试"},Xue={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:"推理输出"}},Yue={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"},Zue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Jue={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Ece={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Cce={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Tce={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 中声明已有入口。"}},Ace={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:"添加到最后"}},_ce={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},Nce={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},jce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Rce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Ice={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 中心暂无技能。"}},Pce={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}} 条连线"}},Dce={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Mce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Lce={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:"长期"}},$ce={common:wce,yaml:Oce,validation:Sce,defaults:kce,helpers:Ece,intelligentDeployment:Cce,codePackage:Tce,buildCanvas:Ace,intelligent:_ce,projectLibrary:Nce,modePicker:jce,promptEditor:Rce,skills:Ice,workflow:Pce,workbench:Dce,traditional:Mce,template:Lce},mMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Ace,codePackage:Tce,common:wce,default:$ce,defaults:kce,helpers:Ece,intelligent:_ce,intelligentDeployment:Cce,modePicker:jce,projectLibrary:Nce,promptEditor:Rce,skills:Ice,template:Lce,traditional:Mce,validation:Sce,workbench:Dce,workflow:Pce,yaml:Oce},Symbol.toStringTag,{value:"Module"})),Fce={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:"查看详情"},Bce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Uce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Qce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},zce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},Vce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},Hce={all:"全部"},qce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},Wce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},Gce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Kce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Xce={daily:"每天",once:"一次性",weekly:"每周"},Yce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Zce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Jce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},gMe={actions:Fce,confirm:Bce,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},bMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fce,confirm:Bce,default:gMe,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},Symbol.toStringTag,{value:"Module"})),eue="问题反馈",tue="问题描述",nue="常见问题",iue="取消",rue="完成",sue="提交反馈",aue="正在上报…",oue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},lue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},cue={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 团队,请注意隐私保护。"},yMe={title:eue,descriptionLabel:tue,commonIssues:nue,cancel:iue,done:rue,submit:sue,submitting:aue,success:oue,dialog:lue,page:cue},vMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:iue,commonIssues:nue,default:yMe,descriptionLabel:tue,dialog:lue,done:rue,page:cue,submit:sue,submitting:aue,success:oue,title:eue},Symbol.toStringTag,{value:"Module"})),uue={back:"返回",close:"关闭"},due={title:"优化迁移项目",closeAria:"关闭优化窗口"},fue={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},hue={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},pue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},mue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},gue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},bue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},yue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},vue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},xue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},wue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Oue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},Sue={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:"正在读取迁移产物…"},kue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Eue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},Cue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Tue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Aue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},_ue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Nue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},jue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Rue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Iue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Pue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},xMe={common:uue,optimization:due,projects:fue,framework:hue,state:pue,task:mue,verification:gue,transfer:bue,validation:yue,duration:vue,expiry:xue,analysis:wue,activity:Oue,artifact:Sue,model:kue,upload:Eue,deployment:Cue,workspace:Tue,actions:Aue,capability:_ue,conversation:Nue,questions:jue,confirmation:Rue,errors:Iue,stopDialog:Pue},wMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Aue,activity:Oue,analysis:wue,artifact:Sue,capability:_ue,common:uue,confirmation:Rue,conversation:Nue,default:xMe,deployment:Cue,duration:vue,errors:Iue,expiry:xue,framework:hue,model:kue,optimization:due,projects:fue,questions:jue,state:pue,stopDialog:Pue,task:mue,transfer:bue,upload:Eue,validation:yue,verification:gue,workspace:Tue},Symbol.toStringTag,{value:"Module"})),Due={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Mue={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Lue={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},$ue={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:"暂不可用"},Fue={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},Bue={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"},Uue={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}}秒"}},Que={compactSelect:Due,featureNotice:Mue,workspace:Lue,mode:$ue,agentPicker:Fue,skill:Bue,video:Uue},OMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Fue,compactSelect:Due,default:Que,featureNotice:Mue,mode:$ue,skill:Bue,video:Uue,workspace:Lue},Symbol.toStringTag,{value:"Module"})),zue={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Vue={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Hue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},que={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 自动审查流程处理审批请求。"}}},Wue={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Gue={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Kue={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:"发送"},Xue={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:"重新尝试"},Yue={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:"推理输出"}},Zue={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"},Jue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},ede={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:"接力失败"}},ede={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 快捷命令"}},tde={common:Que,tool:zue,threads:Vue,permissions:Hue,workspace:que,approval:Wue,composer:Gue,launch:Kue,session:Xue,agentDetails:Yue,agentWorkspace:Zue,handoff:Jue,commands:ede},OMe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Yue,agentWorkspace:Zue,approval:Wue,commands:ede,common:Que,composer:Gue,default:tde,handoff:Jue,launch:Kue,permissions:Hue,session:Xue,threads:Vue,tool:zue,workspace:que},Symbol.toStringTag,{value:"Module"})),nde={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。保留所有权利。"},ide={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},rde={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},sde={cancel:"取消",close:"关闭确认框"},SMe={login:nde,authExpired:ide,navbar:rde,confirm:sde},kMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:ide,confirm:sde,default:SMe,login:nde,navbar:rde},Symbol.toStringTag,{value:"Module"})),ade={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},ode={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},lde={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},EMe={account:ade,navigation:ode,history:lde},CMe=Object.freeze(Object.defineProperty({__proto__:null,account:ade,default:EMe,history:lde,navigation:ode},Symbol.toStringTag,{value:"Module"})),cde={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},ude={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},dde={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},fde={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},hde={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}} 个文件"},pde={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:"所有方案均创建失败,可分别重试。"},mde={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 失败"},gde={configSelect:cde,conversation:ude,errorDetails:dde,fileTree:fde,management:hde,generation:pde,api:mde},TMe=Object.freeze(Object.defineProperty({__proto__:null,api:mde,configSelect:cde,conversation:ude,default:gde,errorDetails:dde,fileTree:fde,generation:pde,management:hde},Symbol.toStringTag,{value:"Module"})),bde={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:"无"},yde={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},vde={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 未配置用户池"},xde={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},wde={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},Ode={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Sde={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},kde={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Ede={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:"当前没有可选择的自定义环境。"},Cde={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:"日志"},Tde={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"},Ade={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 名称一致。"},_de={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:"重新尝试"},Nde={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},jde={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},Rde={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Ide={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"}},Pde={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:"查看日志"},Dde={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:"已删除"}},Mde={agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},Lde={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:"未知"}},$de={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:"删除知识失败"}},AMe={common:bde,agentKitPromo:yde,systemInfo:vde,agentWorkspace:xde,environmentCenter:wde,deploymentSelect:Ode,deploymentError:Sde,studioBuildProgress:kde,cloudEnvironment:Ede,githubCicd:Cde,feishuDeployment:Tde,deploymentResources:Ade,studioUpdate:_de,projectPreview:Nde,workspace:jde,resourceCollection:Rde,skillSourcePicker:Ide,composer:Pde,agentSelector:Dde,myAgents:Mde,skillCenter:Lde,knowledge:$de},_Me=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:yde,agentSelector:Dde,agentWorkspace:xde,cloudEnvironment:Ede,common:bde,composer:Pde,default:AMe,deploymentError:Sde,deploymentResources:Ade,deploymentSelect:Ode,environmentCenter:wde,feishuDeployment:Tde,githubCicd:Cde,knowledge:$de,myAgents:Mde,projectPreview:Nde,resourceCollection:Rde,skillCenter:Lde,skillSourcePicker:Ide,studioBuildProgress:kde,studioUpdate:_de,systemInfo:vde,workspace:jde},Symbol.toStringTag,{value:"Module"})),Fde="网站集成",Bde="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Ude="返回自动化列表",Qde="添加网站",zde="正在加载 Runtime",Vde="选择 Runtime",Hde="网站域名",qde="例如 xxxx.com 或 localhost:5173",Wde="正在生成",Gde="生成 Token",Kde="已添加网站",Xde="{{count}} 个",Yde="{{count}} 个",Zde="正在加载网站集成",Jde="还没有网站集成",efe="选择 Runtime 并输入网站域名即可生成 Token",tfe="引入方法",nfe="将下面代码放到网页的 body 结束标签前",ife="已复制",rfe="复制代码",sfe="添加网站后会在这里生成引入代码。",afe="确定删除 {{domain}} 的网站集成吗?",ofe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},lfe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},NMe={title:Fde,description:Bde,backToAutomations:Ude,addWebsite:Qde,loadingRuntime:zde,selectRuntime:Vde,websiteDomain:Hde,domainPlaceholder:qde,generating:Wde,generateToken:Gde,addedWebsites:Kde,websiteCount_one:Xde,websiteCount_other:Yde,loadingIntegrations:Zde,delete:"删除",emptyTitle:Jde,emptyDescription:efe,embedMethod:tfe,embedInstructions:nfe,copied:ife,copyCode:rfe,embedHint:sfe,confirmDelete:afe,errors:ofe,widget:lfe},jMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Qde,addedWebsites:Kde,backToAutomations:Ude,confirmDelete:afe,copied:ife,copyCode:rfe,default:NMe,description:Bde,domainPlaceholder:qde,embedHint:sfe,embedInstructions:nfe,embedMethod:tfe,emptyDescription:efe,emptyTitle:Jde,errors:ofe,generateToken:Gde,generating:Wde,loadingIntegrations:Zde,loadingRuntime:zde,selectRuntime:Vde,title:Fde,websiteCount_one:Xde,websiteCount_other:Yde,websiteDomain:Hde,widget:lfe},Symbol.toStringTag,{value:"Module"})),cfe={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:"下载产物失败"}},ufe={unknownSource:"未知来源",unknownCreator:"未知创建者"},dfe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},ffe={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:"查看和编辑项目源码"},hfe={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}}"},pfe={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}}界面预览"}},mfe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},gfe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},bfe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},yfe={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 环境。"},vfe={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 终端"},xfe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},wfe={artifactLibrary:cfe,resourceMetadata:ufe,artifactEdit:dfe,codeBrowser:ffe,search:hfe,developerResources:pfe,library:mfe,manageAgents:gfe,agentTopology:bfe,sessionEnvironment:yfe,agentKitCli:vfe,studioTools:xfe},RMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:vfe,agentTopology:bfe,artifactEdit:dfe,artifactLibrary:cfe,codeBrowser:ffe,default:wfe,developerResources:pfe,library:mfe,manageAgents:gfe,resourceMetadata:ufe,search:hfe,sessionEnvironment:yfe,studioTools:xfe},Symbol.toStringTag,{value:"Module"})),K8=["zh-CN","en-US"],xj="en-US",Ofe="agentkit.studio.locale",IMe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function wj(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=K8.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function jd(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function PMe(){if(typeof window>"u")return null;try{return wj(window.localStorage.getItem(Ofe))}catch{return null}}function DMe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function MMe(){const e=PMe();if(e)return e;for(const t of DMe()){const n=wj(t);if(n)return n}return xj}function LMe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ofe,e)}catch{}}function Sfe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=IMe[e].dir)}const Pn=e=>typeof e=="string",T1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},RP=e=>e==null?"":String(e),$Me=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},FMe=/###/g,dV=e=>e&&e.includes("###")?e.replace(FMe,"."):e,fV=e=>!e||Pn(e),Yw=(e,t,n)=>{const i=Pn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=Yw(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),l=Yw(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=Yw(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},BMe=(e,t,n,i)=>{const{obj:r,k:s}=Yw(e,t,Object);r[s]=r[s]||[],r[s].push(n)},qA=(e,t)=>{const{obj:n,k:i}=Yw(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},UMe=(e,t,n)=>{const i=qA(e,n);return i!==void 0?i:qA(t,n)},kfe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Pn(e[i])||e[i]instanceof String||Pn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):kfe(e[i],t[i],n):e[i]=t[i]);return e},pf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),QMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},zMe=e=>Pn(e)?e.replace(/[&<>"'\/]/g,t=>QMe[t]):e;class VMe{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 HMe=[" ",",","?","!",";"],qMe=new VMe(20),WMe=(e,t,n)=>{t=t||"",n=n||"";const i=HMe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=qMe.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!r.test(e);if(!s){const a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(s=!0)}return s},KL=(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,"-"),GMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class WA{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||GMe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Pn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Pn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new WA(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new WA(this.logger,t)}}var wd=new WA;class Oj{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let a=0;a{for(let a=0;a-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Pn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=qA(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!Pn(i)?c:KL((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(a?i.split(a):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),hV(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Pn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,a={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=qA(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?kfe(c,i,s):c={...c,...i},hV(this.data,l,c),a.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Efe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var a;t=((a=this.processors[s])==null?void 0:a.process(t,n,i,r))??t}),t}};const Cfe=Symbol("i18next/PATH_KEY");function KMe(){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===Cfe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Kg(e,t){const{[Cfe]:n}=e(KMe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const a=t==null?void 0:t.ns,l=s?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const IP=e=>!Pn(e)&&typeof e!="boolean"&&typeof e!="number";class GA extends Oj{constructor(t,n={}){super(),$Me(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wd.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=IP(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!WMe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Pn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Pn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Kg(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(F=>typeof F=="function"?Kg(F,{...this.options,...r}):String(F));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const 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]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,w=r.count!==void 0&&!Pn(r.count),k=GA.hasDefaultValue(r),S=w?this.pluralResolver.getSuffix(f,r.count,r):"",E=r.ordinal&&w?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",C=w&&!r.ordinal&&r.count===0,N=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${E}`]||r.defaultValue;let _=g;O&&!g&&k&&(_=N);const j=IP(_),A=Object.prototype.toString.apply(_);if(O&&_&&j&&!y.includes(A)&&!(Pn(x)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,_,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=F,m.usedParams=this.getUsedParamsDetails(r),m):F}if(a){const F=Array.isArray(_),T=F?[]:{},P=F?v:b;for(const R in _)if(Object.prototype.hasOwnProperty.call(_,R)){const L=`${P}${a}${R}`;k&&!g?T[R]=this.translate(L,{...r,defaultValue:IP(N)?N[R]:void 0,joinArrays:!1,ns:c}):T[R]=this.translate(L,{...r,joinArrays:!1,ns:c}),T[R]===L&&(T[R]=_[R])}g=T}}else if(O&&Pn(x)&&Array.isArray(g))g=g.join(x),g&&(g=this.extendTranslation(g,t,r,i));else{let F=!1,T=!1;!this.isValidLookup(g)&&k&&(F=!0,g=N),this.isValidLookup(g)||(T=!0,g=l);const R=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:g,L=k&&N!==g&&this.options.updateMissing;if(T||F||L){if(this.logger.log(L?"updateKey":"missingKey",f,u,w&&!L?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,L?N:g),a){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let H=0;H{var B;const q=k&&Q!==g?Q:R;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,K,q,L,r):(B=this.backendConnector)!=null&&B.saveMissing&&this.backendConnector.saveMissing(H,u,K,q,L,r),this.emit("missingKey",H,u,K,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?M.forEach(H=>{const K=this.pluralResolver.getSuffixes(H,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(Q=>{I([H],l+Q,r[`defaultValue${Q}`]||N)})}):I(M,l,N))}g=this.extendTranslation(g,t,r,m,i),T&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(T||F)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,F?g:void 0,r))}return s?(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=Pn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Pn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=Pn(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Efe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,a,l;return Pn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Kg(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Pn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Pn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,x;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((x=this.utils)!=null&&x.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(O=>{var S;if(this.isValidLookup(i))return;a=O;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,O,v,n);else{let E;h&&(E=this.pluralResolver.getSuffix(O,n.count,n));const C=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&E.startsWith(N)&&w.push(d+E.replace(N,this.options.pluralSeparator)),w.push(d+E),m&&w.push(d+C)),g){const _=`${d}${this.options.contextSeparator||"_"}${n.context}`;w.push(_),h&&(n.ordinal&&E.startsWith(N)&&w.push(_+E.replace(N,this.options.pluralSeparator)),w.push(_+E),m&&w.push(_+C))}}let k;for(;k=w.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(O,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Pn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class mV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wd.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>a===s?!0:!a.includes("-")&&!s.includes("-")?!1:!!(a.includes("-")&&!s.includes("-")&&a.slice(0,a.indexOf("-"))===s||a.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Pn(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=Pn(t)&&s&&!a;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Pn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Pn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const gV={zero:0,one:1,two:2,few:3,many:4,other:5},bV={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class XMe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=wd.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=GO(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),bV;if(!t.match(/-|_/))return bV;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>gV[r]-gV[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 yV=(e,t,n,i=".",r=!0)=>{let s=UMe(e,t,n);return!s&&r&&Pn(n)&&(s=KL(e,n,i),s===void 0&&(s=KL(t,n,i))),s},vV=e=>e.replace(/\$/g,"$$$$");class xV{constructor(t={}){var n;this.logger=wd.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:zMe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?pf(s):a||"{{",this.suffix=l?pf(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?pf(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?pf(d):"",this.nestingPrefix=h?pf(h):m||pf("$t("),this.nestingSuffix=g?pf(g):b||pf(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const x=yV(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,i,{...r,...n,interpolationkey:g}):x}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(yV(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(a=u(b),a===void 0)if(typeof d=="function"){const y=d(t,s,r);a=Pn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!Pn(a)&&!this.useRawValueToEscape&&(a=RP(a));const v=g.safeValue(a);if(t=t.replace(s[0],vV(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${pf(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];a={...i},a=a.replace&&!Pn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),a),a),s&&r[0]===t&&!Pn(s))return s;Pn(s)||(s=RP(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],vV(RP(s))),this.regexp.lastIndex=0}return t}}const YMe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},wV=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const a=i+JSON.stringify(s);let l=t[a];return l||(l=e(GO(i),r),t[a]=l),l(n)}},ZMe=e=>(t,n,i)=>e(GO(n),i)(t);class JMe{constructor(t={}){this.logger=wd.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?wV:ZMe;this.formats={number:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s});return l=>a.format(l)}),currency:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>a.format(l)}),datetime:i((r,s)=>{const a=new Intl.DateTimeFormat(r,{...s});return l=>a.format(l)}),relativetime:i((r,s)=>{const a=new Intl.RelativeTimeFormat(r,{...s});return l=>a.format(l,s.range||"day")}),list:i((r,s)=>{const a=new Intl.ListFormat(r,{...s});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=wV(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),a=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=YMe(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 e5e=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class t5e extends Oj{constructor(t,n,i,r={}){var s,a;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=wd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},a={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,d=!1,a[h]===void 0&&(a[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],a=r[1];n&&this.emit("failedLoading",s,a,n),!n&&i&&this.store.addResourceBundle(s,a,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{BMe(c.loaded,[s],a),e5e(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,a)},s);return}a(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Pn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,a,l)})}saveMissing(t,n,i,r,s,a={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...a,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const PP=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Pn(e[1])&&(t.defaultValue=e[1]),Pn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),OV=e=>(Pn(e.ns)&&(e.ns=[e.ns]),Pn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),TC=()=>{},n5e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zw extends Oj{constructor(t={},n){if(super(),this.options=OV(t),this.services={},this.logger=wd,this.modules={external:[]},n5e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Pn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=PP();this.options={...i,...this.options,...OV(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?wd.init(r(this.modules.logger),this.options):wd.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=JMe;const d=new mV(this.options);this.store=new pV(this.options.resources,this.options);const f=this.services;f.logger=wd,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new XMe(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 xV(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new t5e(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 GA(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=TC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=T1(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=TC){var s,a;let i=n;const r=Pn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=T1();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=TC),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Efe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},a=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Pn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Pn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,a=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||a.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Kg(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Kg(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Kg(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Pn(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=i,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,t)&&(!r||a(s,t)))}loadNamespaces(t,n){const i=T1();return this.options.ns?(Pn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=T1();Pn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(a=>!r.includes(a)&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=r.concat(s),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new mV(PP());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new Zw(t,n);return i.createInstance=Zw.createInstance,i}cloneInstance(t={},n=TC){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Zw(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new pV(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...PP().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new xV(u)}return s.translator=new GA(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ho=Zw.createInstance();Ho.createInstance;Ho.dir;Ho.init;Ho.loadResources;Ho.reloadResources;Ho.use;Ho.changeLanguage;Ho.getFixedT;Ho.t;Ho.exists;Ho.setDefaultNamespace;Ho.hasLoadedNamespace;Ho.loadNamespaces;Ho.loadLanguages;var Tfe={exports:{}},Gn={};/** +安装命令:{{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:"接力失败"}},tde={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 快捷命令"}},nde={common:zue,tool:Vue,threads:Hue,permissions:que,workspace:Wue,approval:Gue,composer:Kue,launch:Xue,session:Yue,agentDetails:Zue,agentWorkspace:Jue,handoff:ede,commands:tde},SMe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Zue,agentWorkspace:Jue,approval:Gue,commands:tde,common:zue,composer:Kue,default:nde,handoff:ede,launch:Xue,permissions:que,session:Yue,threads:Hue,tool:Vue,workspace:Wue},Symbol.toStringTag,{value:"Module"})),ide={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。保留所有权利。"},rde={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},sde={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},ade={cancel:"取消",close:"关闭确认框"},kMe={login:ide,authExpired:rde,navbar:sde,confirm:ade},EMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:rde,confirm:ade,default:kMe,login:ide,navbar:sde},Symbol.toStringTag,{value:"Module"})),ode={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},lde={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},cde={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},CMe={account:ode,navigation:lde,history:cde},TMe=Object.freeze(Object.defineProperty({__proto__:null,account:ode,default:CMe,history:cde,navigation:lde},Symbol.toStringTag,{value:"Module"})),ude={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},dde={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},fde={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},hde={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},pde={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}} 个文件"},mde={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:"所有方案均创建失败,可分别重试。"},gde={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 失败"},bde={configSelect:ude,conversation:dde,errorDetails:fde,fileTree:hde,management:pde,generation:mde,api:gde},AMe=Object.freeze(Object.defineProperty({__proto__:null,api:gde,configSelect:ude,conversation:dde,default:bde,errorDetails:fde,fileTree:hde,generation:mde,management:pde},Symbol.toStringTag,{value:"Module"})),yde={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:"无"},vde={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},xde={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 未配置用户池"},wde={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},Ode={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},Sde={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},kde={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Ede={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Cde={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:"当前没有可选择的自定义环境。"},Tde={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:"日志"},Ade={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"},_de={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 名称一致。"},Nde={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:"重新尝试"},jde={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},Rde={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},Ide={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Pde={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"}},Dde={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:"查看日志"},Mde={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:"已删除"}},Lde={agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},$de={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:"未知"}},Fde={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:"删除知识失败"}},_Me={common:yde,agentKitPromo:vde,systemInfo:xde,agentWorkspace:wde,environmentCenter:Ode,deploymentSelect:Sde,deploymentError:kde,studioBuildProgress:Ede,cloudEnvironment:Cde,githubCicd:Tde,feishuDeployment:Ade,deploymentResources:_de,studioUpdate:Nde,projectPreview:jde,workspace:Rde,resourceCollection:Ide,skillSourcePicker:Pde,composer:Dde,agentSelector:Mde,myAgents:Lde,skillCenter:$de,knowledge:Fde},NMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:vde,agentSelector:Mde,agentWorkspace:wde,cloudEnvironment:Cde,common:yde,composer:Dde,default:_Me,deploymentError:kde,deploymentResources:_de,deploymentSelect:Sde,environmentCenter:Ode,feishuDeployment:Ade,githubCicd:Tde,knowledge:Fde,myAgents:Lde,projectPreview:jde,resourceCollection:Ide,skillCenter:$de,skillSourcePicker:Pde,studioBuildProgress:Ede,studioUpdate:Nde,systemInfo:xde,workspace:Rde},Symbol.toStringTag,{value:"Module"})),Bde="网站集成",Ude="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Qde="返回自动化列表",zde="添加网站",Vde="正在加载 Runtime",Hde="选择 Runtime",qde="网站域名",Wde="例如 xxxx.com 或 localhost:5173",Gde="正在生成",Kde="生成 Token",Xde="已添加网站",Yde="{{count}} 个",Zde="{{count}} 个",Jde="正在加载网站集成",efe="还没有网站集成",tfe="选择 Runtime 并输入网站域名即可生成 Token",nfe="引入方法",ife="将下面代码放到网页的 body 结束标签前",rfe="已复制",sfe="复制代码",afe="添加网站后会在这里生成引入代码。",ofe="确定删除 {{domain}} 的网站集成吗?",lfe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},cfe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},jMe={title:Bde,description:Ude,backToAutomations:Qde,addWebsite:zde,loadingRuntime:Vde,selectRuntime:Hde,websiteDomain:qde,domainPlaceholder:Wde,generating:Gde,generateToken:Kde,addedWebsites:Xde,websiteCount_one:Yde,websiteCount_other:Zde,loadingIntegrations:Jde,delete:"删除",emptyTitle:efe,emptyDescription:tfe,embedMethod:nfe,embedInstructions:ife,copied:rfe,copyCode:sfe,embedHint:afe,confirmDelete:ofe,errors:lfe,widget:cfe},RMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:zde,addedWebsites:Xde,backToAutomations:Qde,confirmDelete:ofe,copied:rfe,copyCode:sfe,default:jMe,description:Ude,domainPlaceholder:Wde,embedHint:afe,embedInstructions:ife,embedMethod:nfe,emptyDescription:tfe,emptyTitle:efe,errors:lfe,generateToken:Kde,generating:Gde,loadingIntegrations:Jde,loadingRuntime:Vde,selectRuntime:Hde,title:Bde,websiteCount_one:Yde,websiteCount_other:Zde,websiteDomain:qde,widget:cfe},Symbol.toStringTag,{value:"Module"})),ufe={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:"下载产物失败"}},dfe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ffe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},hfe={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:"查看和编辑项目源码"},pfe={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}}"},mfe={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}}界面预览"}},gfe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},bfe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},yfe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},vfe={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 环境。"},xfe={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 终端"},wfe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Ofe={artifactLibrary:ufe,resourceMetadata:dfe,artifactEdit:ffe,codeBrowser:hfe,search:pfe,developerResources:mfe,library:gfe,manageAgents:bfe,agentTopology:yfe,sessionEnvironment:vfe,agentKitCli:xfe,studioTools:wfe},IMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:xfe,agentTopology:yfe,artifactEdit:ffe,artifactLibrary:ufe,codeBrowser:hfe,default:Ofe,developerResources:mfe,library:gfe,manageAgents:bfe,resourceMetadata:dfe,search:pfe,sessionEnvironment:vfe,studioTools:wfe},Symbol.toStringTag,{value:"Module"})),K8=["zh-CN","en-US"],xj="en-US",Sfe="agentkit.studio.locale",PMe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function wj(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=K8.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function jd(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function DMe(){if(typeof window>"u")return null;try{return wj(window.localStorage.getItem(Sfe))}catch{return null}}function MMe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function LMe(){const e=DMe();if(e)return e;for(const t of MMe()){const n=wj(t);if(n)return n}return xj}function $Me(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Sfe,e)}catch{}}function kfe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=PMe[e].dir)}const Pn=e=>typeof e=="string",T1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},RP=e=>e==null?"":String(e),FMe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},BMe=/###/g,dV=e=>e&&e.includes("###")?e.replace(BMe,"."):e,fV=e=>!e||Pn(e),Yw=(e,t,n)=>{const i=Pn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=Yw(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),l=Yw(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=Yw(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},UMe=(e,t,n,i)=>{const{obj:r,k:s}=Yw(e,t,Object);r[s]=r[s]||[],r[s].push(n)},qA=(e,t)=>{const{obj:n,k:i}=Yw(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},QMe=(e,t,n)=>{const i=qA(e,n);return i!==void 0?i:qA(t,n)},Efe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Pn(e[i])||e[i]instanceof String||Pn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Efe(e[i],t[i],n):e[i]=t[i]);return e},pf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),zMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},VMe=e=>Pn(e)?e.replace(/[&<>"'\/]/g,t=>zMe[t]):e;class HMe{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 qMe=[" ",",","?","!",";"],WMe=new HMe(20),GMe=(e,t,n)=>{t=t||"",n=n||"";const i=qMe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=WMe.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!r.test(e);if(!s){const a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(s=!0)}return s},KL=(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,"-"),KMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class WA{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||KMe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Pn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Pn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new WA(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new WA(this.logger,t)}}var wd=new WA;class Oj{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let a=0;a{for(let a=0;a-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Pn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=qA(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!Pn(i)?c:KL((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(a?i.split(a):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),hV(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Pn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,a={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=qA(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Efe(c,i,s):c={...c,...i},hV(this.data,l,c),a.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var Cfe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var a;t=((a=this.processors[s])==null?void 0:a.process(t,n,i,r))??t}),t}};const Tfe=Symbol("i18next/PATH_KEY");function XMe(){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===Tfe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Kg(e,t){const{[Tfe]:n}=e(XMe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const a=t==null?void 0:t.ns,l=s?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const IP=e=>!Pn(e)&&typeof e!="boolean"&&typeof e!="number";class GA extends Oj{constructor(t,n={}){super(),FMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wd.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=IP(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!GMe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Pn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Pn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Kg(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(F=>typeof F=="function"?Kg(F,{...this.options,...r}):String(F));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const 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]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,w=r.count!==void 0&&!Pn(r.count),k=GA.hasDefaultValue(r),S=w?this.pluralResolver.getSuffix(f,r.count,r):"",E=r.ordinal&&w?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",C=w&&!r.ordinal&&r.count===0,N=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${E}`]||r.defaultValue;let _=g;O&&!g&&k&&(_=N);const j=IP(_),A=Object.prototype.toString.apply(_);if(O&&_&&j&&!y.includes(A)&&!(Pn(x)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,_,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=F,m.usedParams=this.getUsedParamsDetails(r),m):F}if(a){const F=Array.isArray(_),T=F?[]:{},P=F?v:b;for(const R in _)if(Object.prototype.hasOwnProperty.call(_,R)){const L=`${P}${a}${R}`;k&&!g?T[R]=this.translate(L,{...r,defaultValue:IP(N)?N[R]:void 0,joinArrays:!1,ns:c}):T[R]=this.translate(L,{...r,joinArrays:!1,ns:c}),T[R]===L&&(T[R]=_[R])}g=T}}else if(O&&Pn(x)&&Array.isArray(g))g=g.join(x),g&&(g=this.extendTranslation(g,t,r,i));else{let F=!1,T=!1;!this.isValidLookup(g)&&k&&(F=!0,g=N),this.isValidLookup(g)||(T=!0,g=l);const R=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:g,L=k&&N!==g&&this.options.updateMissing;if(T||F||L){if(this.logger.log(L?"updateKey":"missingKey",f,u,w&&!L?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,L?N:g),a){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let H=0;H{var B;const q=k&&Q!==g?Q:R;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,K,q,L,r):(B=this.backendConnector)!=null&&B.saveMissing&&this.backendConnector.saveMissing(H,u,K,q,L,r),this.emit("missingKey",H,u,K,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?M.forEach(H=>{const K=this.pluralResolver.getSuffixes(H,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(Q=>{I([H],l+Q,r[`defaultValue${Q}`]||N)})}):I(M,l,N))}g=this.extendTranslation(g,t,r,m,i),T&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(T||F)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,F?g:void 0,r))}return s?(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=Pn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Pn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=Pn(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Cfe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,a,l;return Pn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Kg(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Pn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Pn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,x;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((x=this.utils)!=null&&x.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(O=>{var S;if(this.isValidLookup(i))return;a=O;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,O,v,n);else{let E;h&&(E=this.pluralResolver.getSuffix(O,n.count,n));const C=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&E.startsWith(N)&&w.push(d+E.replace(N,this.options.pluralSeparator)),w.push(d+E),m&&w.push(d+C)),g){const _=`${d}${this.options.contextSeparator||"_"}${n.context}`;w.push(_),h&&(n.ordinal&&E.startsWith(N)&&w.push(_+E.replace(N,this.options.pluralSeparator)),w.push(_+E),m&&w.push(_+C))}}let k;for(;k=w.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(O,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Pn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class mV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wd.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>a===s?!0:!a.includes("-")&&!s.includes("-")?!1:!!(a.includes("-")&&!s.includes("-")&&a.slice(0,a.indexOf("-"))===s||a.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Pn(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=Pn(t)&&s&&!a;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Pn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Pn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const gV={zero:0,one:1,two:2,few:3,many:4,other:5},bV={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class YMe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=wd.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=GO(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),bV;if(!t.match(/-|_/))return bV;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>gV[r]-gV[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 yV=(e,t,n,i=".",r=!0)=>{let s=QMe(e,t,n);return!s&&r&&Pn(n)&&(s=KL(e,n,i),s===void 0&&(s=KL(t,n,i))),s},vV=e=>e.replace(/\$/g,"$$$$");class xV{constructor(t={}){var n;this.logger=wd.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:VMe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?pf(s):a||"{{",this.suffix=l?pf(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?pf(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?pf(d):"",this.nestingPrefix=h?pf(h):m||pf("$t("),this.nestingSuffix=g?pf(g):b||pf(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const x=yV(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,i,{...r,...n,interpolationkey:g}):x}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(yV(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(a=u(b),a===void 0)if(typeof d=="function"){const y=d(t,s,r);a=Pn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!Pn(a)&&!this.useRawValueToEscape&&(a=RP(a));const v=g.safeValue(a);if(t=t.replace(s[0],vV(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${pf(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];a={...i},a=a.replace&&!Pn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),a),a),s&&r[0]===t&&!Pn(s))return s;Pn(s)||(s=RP(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],vV(RP(s))),this.regexp.lastIndex=0}return t}}const ZMe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},wV=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const a=i+JSON.stringify(s);let l=t[a];return l||(l=e(GO(i),r),t[a]=l),l(n)}},JMe=e=>(t,n,i)=>e(GO(n),i)(t);class e5e{constructor(t={}){this.logger=wd.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?wV:JMe;this.formats={number:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s});return l=>a.format(l)}),currency:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>a.format(l)}),datetime:i((r,s)=>{const a=new Intl.DateTimeFormat(r,{...s});return l=>a.format(l)}),relativetime:i((r,s)=>{const a=new Intl.RelativeTimeFormat(r,{...s});return l=>a.format(l,s.range||"day")}),list:i((r,s)=>{const a=new Intl.ListFormat(r,{...s});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=wV(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),a=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=ZMe(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 t5e=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class n5e extends Oj{constructor(t,n,i,r={}){var s,a;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=wd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},a={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,d=!1,a[h]===void 0&&(a[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],a=r[1];n&&this.emit("failedLoading",s,a,n),!n&&i&&this.store.addResourceBundle(s,a,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{UMe(c.loaded,[s],a),t5e(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,a)},s);return}a(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Pn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,a,l)})}saveMissing(t,n,i,r,s,a={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...a,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const PP=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Pn(e[1])&&(t.defaultValue=e[1]),Pn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),OV=e=>(Pn(e.ns)&&(e.ns=[e.ns]),Pn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),TC=()=>{},i5e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zw extends Oj{constructor(t={},n){if(super(),this.options=OV(t),this.services={},this.logger=wd,this.modules={external:[]},i5e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Pn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=PP();this.options={...i,...this.options,...OV(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?wd.init(r(this.modules.logger),this.options):wd.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=e5e;const d=new mV(this.options);this.store=new pV(this.options.resources,this.options);const f=this.services;f.logger=wd,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new YMe(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 xV(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new n5e(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 GA(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=TC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=T1(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=TC){var s,a;let i=n;const r=Pn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=T1();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=TC),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Cfe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},a=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Pn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Pn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,a=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||a.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Kg(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Kg(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Kg(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Pn(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=i,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,t)&&(!r||a(s,t)))}loadNamespaces(t,n){const i=T1();return this.options.ns?(Pn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=T1();Pn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(a=>!r.includes(a)&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=r.concat(s),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new mV(PP());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new Zw(t,n);return i.createInstance=Zw.createInstance,i}cloneInstance(t={},n=TC){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Zw(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new pV(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...PP().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new xV(u)}return s.translator=new GA(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ho=Zw.createInstance();Ho.createInstance;Ho.dir;Ho.init;Ho.loadResources;Ho.reloadResources;Ho.use;Ho.changeLanguage;Ho.getFixedT;Ho.t;Ho.exists;Ho.setDefaultNamespace;Ho.hasLoadedNamespace;Ho.loadNamespaces;Ho.loadLanguages;var Afe={exports:{}},Gn={};/** * @license React * react.production.js * @@ -51,7 +51,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var X8=Symbol.for("react.transitional.element"),i5e=Symbol.for("react.portal"),r5e=Symbol.for("react.fragment"),s5e=Symbol.for("react.strict_mode"),a5e=Symbol.for("react.profiler"),o5e=Symbol.for("react.consumer"),l5e=Symbol.for("react.context"),c5e=Symbol.for("react.forward_ref"),u5e=Symbol.for("react.suspense"),d5e=Symbol.for("react.memo"),Afe=Symbol.for("react.lazy"),f5e=Symbol.for("react.activity"),SV=Symbol.iterator;function h5e(e){return e===null||typeof e!="object"?null:(e=SV&&e[SV]||e["@@iterator"],typeof e=="function"?e:null)}var _fe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nfe=Object.assign,jfe={};function mx(e,t,n){this.props=e,this.context=t,this.refs=jfe,this.updater=n||_fe}mx.prototype.isReactComponent={};mx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rfe(){}Rfe.prototype=mx.prototype;function Y8(e,t,n){this.props=e,this.context=t,this.refs=jfe,this.updater=n||_fe}var Z8=Y8.prototype=new Rfe;Z8.constructor=Y8;Nfe(Z8,mx.prototype);Z8.isPureReactComponent=!0;var kV=Array.isArray;function XL(){}var Gr={H:null,A:null,T:null,S:null},Ife=Object.prototype.hasOwnProperty;function J8(e,t,n){var i=n.ref;return{$$typeof:X8,type:e,key:t,ref:i!==void 0?i:null,props:n}}function p5e(e,t){return J8(e.type,t,e.props)}function e9(e){return typeof e=="object"&&e!==null&&e.$$typeof===X8}function m5e(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var EV=/\/+/g;function DP(e,t){return typeof e=="object"&&e!==null&&e.key!=null?m5e(""+e.key):t.toString(36)}function g5e(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(XL,XL):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function X0(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case X8:case i5e:a=!0;break;case Afe:return a=e._init,X0(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+DP(e,0):i,kV(r)?(n="",a!=null&&(n=a.replace(EV,"$&/")+"/"),X0(r,t,n,"",function(u){return u})):r!=null&&(e9(r)&&(r=p5e(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(EV,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(kV(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function TV(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(v5e[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(x5e);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let a=[s,null];const l=s.indexOf("=");l>-1&&(a=[s.slice(0,l),s.slice(l+1)]),t.attrs[a[0]]=a[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _C=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,w5e=/<\/?([^\s]+?)[/\s>]/,O5e=/^\s*$/,S5e=/^(script|style)$/i,xw="\0",k5e=Object.create(null);function Pfe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xw).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xw).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(xw)>-1&&(t.attrs[n]=i.split(xw).join("<"))}t.children.length&&Pfe(t.children)})}function E5e(e,t){const n=t&&t.components||k5e,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(x){return i.indexOf(x)>-1};let b="",v=0;_C.lastIndex=0;let y;for(;y=_C.exec(e);){const x=y[0];b+=e.slice(v,y.index);const O=x.match(w5e);x.startsWith("",e}}function T5e(e){return e.reduce(function(t,n){return t+Dfe("",n)},"")}var A5e={parse:E5e,stringify:T5e};const _2=(e,t,n,i)=>{var s,a,l,c;const r=[n,{code:t,...i||{}}];if((a=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&a.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);ml(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},AV={},Uy=(e,t,n,i)=>{ml(n)&&AV[n]||(ml(n)&&(AV[n]=new Date),_2(e,t,n,i))},Mfe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},YL=(e,t,n)=>{e.loadNamespaces(t,Mfe(e,n))},_V=(e,t,n,i)=>{if(ml(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return YL(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Mfe(e,i))},_5e=(e,t,n={})=>!t.languages||!t.languages.length?(Uy(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),ml=e=>typeof e=="string",Hf=e=>typeof e=="object"&&e!==null,N5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,j5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},R5e=e=>j5e[e],Lfe=e=>e.replace(N5e,R5e);let ZL={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Lfe,transDefaultProps:void 0};const I5e=(e={})=>{ZL={...ZL,...e}},t9=()=>ZL;let $fe;const P5e=e=>{$fe=e},n9=()=>$fe,N2=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},ww=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Ep(t):t},D5e=e=>Array.isArray(e)&&e.every(p.isValidElement),Ep=e=>Array.isArray(e)?e:[e],M5e=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},L5e=e=>{const t={};if(!e)return t;const n=i=>{Ep(i).forEach(s=>{ml(s)||(N2(s)?n(ww(s)):Hf(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},JL=(e,t,n,i)=>{if(!e)return"";let r="";const s=Ep(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(ml(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=ml(m)?m:JL(m,t,n,i);r+=`<${d}>${b}`;return}const g=JL(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){_2(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Hf(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}_2(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}_2(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},$5e=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(O=>`<${O}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=O=>{Ep(O).forEach(k=>{ml(k)||(N2(k)?d(ww(k)):Hf(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=O=>/^\d+$/.test(O)||l.indexOf(O)>-1||f.indexOf(O)>-1,m=A5e.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(O,w,k)=>{var C;const S=ww(O),E=y(S,w.children,k);return D5e(S)&&E.length===0||(C=O.props)!=null&&C.i18nIsDynamicList?S:E},v=(O,w,k,S,E)=>{O.dummy?(O.children=w,k.push(p.cloneElement(O,{key:S},E?void 0:w))):k.push(...p.Children.map([O],C=>{var _;if(C.type===p.Fragment||((_=C.props)==null?void 0:_.i18nIsDynamicList)!==void 0){const j={key:S};return C&&C.props&&Object.keys(C.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(j[A]=C.props[A])}),p.createElement(C.type,j,E?null:w)}const N={key:S};return C&&C.props&&Object.keys(C.props).forEach(j=>{j==="ref"||j==="children"||(N[j]=C.props[j])}),p.cloneElement(C,N,E?null:w)}))},y=(O,w,k)=>{const S=Ep(O),E=Ep(w),C={};return E.reduce((N,_,j)=>{var F,T;const A=((T=(F=_.children)==null?void 0:F[0])==null?void 0:T.content)&&i.services.interpolator.interpolate(_.children[0].content,g,i.language);if(_.type==="tag"){let P=S[parseInt(_.name,10)];!P&&t&&(P=t[_.name]),k.length===1&&!P&&(P=k[0][_.name]),P||(P={});const R={..._.attrs};a&&Object.keys(R).forEach(K=>{const Q=R[K];ml(Q)&&(R[K]=Lfe(Q))});const L=Object.keys(R).length!==0?M5e({props:R},P):P,M=p.isValidElement(L),U=M&&N2(_,!0)&&!_.voidElement,I=c&&Hf(L)&&L.dummy&&!M,H=Hf(t)&&Object.hasOwnProperty.call(t,_.name);if(ml(L)){const K=i.services.interpolator.interpolate(L,g,i.language);N.push(K)}else if(N2(L)||U){const K=b(L,_,k);v(L,K,N,j)}else if(I){const K=y(S,_.children,k);v(L,K,N,j)}else if(Number.isNaN(parseFloat(_.name)))if(H){const K=b(L,_,k);v(L,K,N,j,_.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(_.name)>-1)if(_.voidElement)N.push(p.createElement(_.name,{key:`${_.name}-${j}`}));else{const K=C[_.name]||0;C[_.name]=K+1;let Q,q=0;for(let le=0;le`);else{const K=y(S,_.children,k);N.push(`<${_.name}>${K}`)}else if(Hf(L)&&!M){const K=_.children[0]?A:null;K&&N.push(K)}else v(L,A,N,j,_.children.length!==1||!A)}else if(_.type==="text"){const P=r.transWrapTextNodes,R=typeof r.unescape=="function"?r.unescape:t9().unescape,L=a?R(i.services.interpolator.interpolate(_.content,g,i.language)):i.services.interpolator.interpolate(_.content,g,i.language);P?N.push(p.createElement(P,{key:`${_.name}-${j}`},L)):N.push(L)}return N},[])},x=y([{dummy:!0,children:e||[]}],m,Ep(e||[]));return ww(x[0])},Ffe=(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})},F5e=(e,t)=>e.map((n,i)=>Ffe(n,i,t)),B5e=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:Ffe(e[i],i,t)})}),n},U5e=(e,t,n,i)=>e?Array.isArray(e)?F5e(e,t):Hf(e)?B5e(e,t):(Uy(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,Q5e=e=>!Hf(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function z5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var I,H,K,Q,q,B;const g=d||n9();if(!g)return Uy(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(ee=>ee),v={...t9(),...(I=g.options)==null?void 0:I.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=ml(y)?[y]:y||["translation"];const{transDefaultProps:x}=v,O=x!=null&&x.tOptions?{...x.tOptions,...s}:s,w=h??(x==null?void 0:x.shouldUnescape),k=x!=null&&x.values?{...x.values,...a}:a,S=x!=null&&x.components?{...x.components,...c}:c,E=JL(e,v,g,i),C=l||(O==null?void 0:O.defaultValue)||E||v.transEmptyNodeValue||(typeof i=="function"?Kg(i):i),{hashTransKey:N}=v,_=i||(N?N(E||C):E||C);(Q=(K=g.options)==null?void 0:K.interpolation)!=null&&Q.defaultVariables?a=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=k;const j=L5e(e);j&&typeof j.count=="number"&&t===void 0&&(t=j.count);const A=a||t!==void 0&&!((B=(q=g.options)==null?void 0:q.interpolation)!=null&&B.alwaysFormat)||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},F={...O,context:r||O.context,count:t,...a,...A,defaultValue:C,ns:y};let T=_?b(_,F):C;T===_&&C&&(T=C);const P=U5e(S,T,g,i);let R=P||e,L=null;Q5e(P)&&(L=P,R=e);const M=$5e(R,L,T,g,v,F,w),U=n??v.defaultTransParent;return U?p.createElement(U,m,M):M}const V5e={type:"3rdParty",init(e){I5e(e.options.react),P5e(e)}},Bfe=p.createContext();class H5e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function KA({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var x;const{i18n:g,defaultNS:b}=p.useContext(Bfe)||{},v=d||g||n9(),y=f||(v==null?void 0:v.t.bind(v));return z5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:a,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((x=v==null?void 0:v.options)==null?void 0:x.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var Ufe={exports:{}},Qfe={};/** + */var X8=Symbol.for("react.transitional.element"),r5e=Symbol.for("react.portal"),s5e=Symbol.for("react.fragment"),a5e=Symbol.for("react.strict_mode"),o5e=Symbol.for("react.profiler"),l5e=Symbol.for("react.consumer"),c5e=Symbol.for("react.context"),u5e=Symbol.for("react.forward_ref"),d5e=Symbol.for("react.suspense"),f5e=Symbol.for("react.memo"),_fe=Symbol.for("react.lazy"),h5e=Symbol.for("react.activity"),SV=Symbol.iterator;function p5e(e){return e===null||typeof e!="object"?null:(e=SV&&e[SV]||e["@@iterator"],typeof e=="function"?e:null)}var Nfe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jfe=Object.assign,Rfe={};function mx(e,t,n){this.props=e,this.context=t,this.refs=Rfe,this.updater=n||Nfe}mx.prototype.isReactComponent={};mx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ife(){}Ife.prototype=mx.prototype;function Y8(e,t,n){this.props=e,this.context=t,this.refs=Rfe,this.updater=n||Nfe}var Z8=Y8.prototype=new Ife;Z8.constructor=Y8;jfe(Z8,mx.prototype);Z8.isPureReactComponent=!0;var kV=Array.isArray;function XL(){}var Gr={H:null,A:null,T:null,S:null},Pfe=Object.prototype.hasOwnProperty;function J8(e,t,n){var i=n.ref;return{$$typeof:X8,type:e,key:t,ref:i!==void 0?i:null,props:n}}function m5e(e,t){return J8(e.type,t,e.props)}function e9(e){return typeof e=="object"&&e!==null&&e.$$typeof===X8}function g5e(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var EV=/\/+/g;function DP(e,t){return typeof e=="object"&&e!==null&&e.key!=null?g5e(""+e.key):t.toString(36)}function b5e(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(XL,XL):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function X0(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case X8:case r5e:a=!0;break;case _fe:return a=e._init,X0(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+DP(e,0):i,kV(r)?(n="",a!=null&&(n=a.replace(EV,"$&/")+"/"),X0(r,t,n,"",function(u){return u})):r!=null&&(e9(r)&&(r=m5e(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(EV,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(kV(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function TV(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(x5e[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(w5e);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let a=[s,null];const l=s.indexOf("=");l>-1&&(a=[s.slice(0,l),s.slice(l+1)]),t.attrs[a[0]]=a[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _C=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,O5e=/<\/?([^\s]+?)[/\s>]/,S5e=/^\s*$/,k5e=/^(script|style)$/i,xw="\0",E5e=Object.create(null);function Dfe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xw).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xw).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(xw)>-1&&(t.attrs[n]=i.split(xw).join("<"))}t.children.length&&Dfe(t.children)})}function C5e(e,t){const n=t&&t.components||E5e,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(x){return i.indexOf(x)>-1};let b="",v=0;_C.lastIndex=0;let y;for(;y=_C.exec(e);){const x=y[0];b+=e.slice(v,y.index);const O=x.match(O5e);x.startsWith("",e}}function A5e(e){return e.reduce(function(t,n){return t+Mfe("",n)},"")}var _5e={parse:C5e,stringify:A5e};const _2=(e,t,n,i)=>{var s,a,l,c;const r=[n,{code:t,...i||{}}];if((a=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&a.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);ml(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},AV={},Uy=(e,t,n,i)=>{ml(n)&&AV[n]||(ml(n)&&(AV[n]=new Date),_2(e,t,n,i))},Lfe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},YL=(e,t,n)=>{e.loadNamespaces(t,Lfe(e,n))},_V=(e,t,n,i)=>{if(ml(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return YL(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Lfe(e,i))},N5e=(e,t,n={})=>!t.languages||!t.languages.length?(Uy(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),ml=e=>typeof e=="string",Hf=e=>typeof e=="object"&&e!==null,j5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,R5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},I5e=e=>R5e[e],$fe=e=>e.replace(j5e,I5e);let ZL={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$fe,transDefaultProps:void 0};const P5e=(e={})=>{ZL={...ZL,...e}},t9=()=>ZL;let Ffe;const D5e=e=>{Ffe=e},n9=()=>Ffe,N2=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},ww=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Ep(t):t},M5e=e=>Array.isArray(e)&&e.every(p.isValidElement),Ep=e=>Array.isArray(e)?e:[e],L5e=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},$5e=e=>{const t={};if(!e)return t;const n=i=>{Ep(i).forEach(s=>{ml(s)||(N2(s)?n(ww(s)):Hf(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},JL=(e,t,n,i)=>{if(!e)return"";let r="";const s=Ep(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(ml(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=ml(m)?m:JL(m,t,n,i);r+=`<${d}>${b}`;return}const g=JL(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){_2(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Hf(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}_2(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}_2(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},F5e=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(O=>`<${O}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=O=>{Ep(O).forEach(k=>{ml(k)||(N2(k)?d(ww(k)):Hf(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=O=>/^\d+$/.test(O)||l.indexOf(O)>-1||f.indexOf(O)>-1,m=_5e.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(O,w,k)=>{var C;const S=ww(O),E=y(S,w.children,k);return M5e(S)&&E.length===0||(C=O.props)!=null&&C.i18nIsDynamicList?S:E},v=(O,w,k,S,E)=>{O.dummy?(O.children=w,k.push(p.cloneElement(O,{key:S},E?void 0:w))):k.push(...p.Children.map([O],C=>{var _;if(C.type===p.Fragment||((_=C.props)==null?void 0:_.i18nIsDynamicList)!==void 0){const j={key:S};return C&&C.props&&Object.keys(C.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(j[A]=C.props[A])}),p.createElement(C.type,j,E?null:w)}const N={key:S};return C&&C.props&&Object.keys(C.props).forEach(j=>{j==="ref"||j==="children"||(N[j]=C.props[j])}),p.cloneElement(C,N,E?null:w)}))},y=(O,w,k)=>{const S=Ep(O),E=Ep(w),C={};return E.reduce((N,_,j)=>{var F,T;const A=((T=(F=_.children)==null?void 0:F[0])==null?void 0:T.content)&&i.services.interpolator.interpolate(_.children[0].content,g,i.language);if(_.type==="tag"){let P=S[parseInt(_.name,10)];!P&&t&&(P=t[_.name]),k.length===1&&!P&&(P=k[0][_.name]),P||(P={});const R={..._.attrs};a&&Object.keys(R).forEach(K=>{const Q=R[K];ml(Q)&&(R[K]=$fe(Q))});const L=Object.keys(R).length!==0?L5e({props:R},P):P,M=p.isValidElement(L),U=M&&N2(_,!0)&&!_.voidElement,I=c&&Hf(L)&&L.dummy&&!M,H=Hf(t)&&Object.hasOwnProperty.call(t,_.name);if(ml(L)){const K=i.services.interpolator.interpolate(L,g,i.language);N.push(K)}else if(N2(L)||U){const K=b(L,_,k);v(L,K,N,j)}else if(I){const K=y(S,_.children,k);v(L,K,N,j)}else if(Number.isNaN(parseFloat(_.name)))if(H){const K=b(L,_,k);v(L,K,N,j,_.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(_.name)>-1)if(_.voidElement)N.push(p.createElement(_.name,{key:`${_.name}-${j}`}));else{const K=C[_.name]||0;C[_.name]=K+1;let Q,q=0;for(let le=0;le`);else{const K=y(S,_.children,k);N.push(`<${_.name}>${K}`)}else if(Hf(L)&&!M){const K=_.children[0]?A:null;K&&N.push(K)}else v(L,A,N,j,_.children.length!==1||!A)}else if(_.type==="text"){const P=r.transWrapTextNodes,R=typeof r.unescape=="function"?r.unescape:t9().unescape,L=a?R(i.services.interpolator.interpolate(_.content,g,i.language)):i.services.interpolator.interpolate(_.content,g,i.language);P?N.push(p.createElement(P,{key:`${_.name}-${j}`},L)):N.push(L)}return N},[])},x=y([{dummy:!0,children:e||[]}],m,Ep(e||[]));return ww(x[0])},Bfe=(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})},B5e=(e,t)=>e.map((n,i)=>Bfe(n,i,t)),U5e=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:Bfe(e[i],i,t)})}),n},Q5e=(e,t,n,i)=>e?Array.isArray(e)?B5e(e,t):Hf(e)?U5e(e,t):(Uy(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,z5e=e=>!Hf(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function V5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var I,H,K,Q,q,B;const g=d||n9();if(!g)return Uy(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(ee=>ee),v={...t9(),...(I=g.options)==null?void 0:I.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=ml(y)?[y]:y||["translation"];const{transDefaultProps:x}=v,O=x!=null&&x.tOptions?{...x.tOptions,...s}:s,w=h??(x==null?void 0:x.shouldUnescape),k=x!=null&&x.values?{...x.values,...a}:a,S=x!=null&&x.components?{...x.components,...c}:c,E=JL(e,v,g,i),C=l||(O==null?void 0:O.defaultValue)||E||v.transEmptyNodeValue||(typeof i=="function"?Kg(i):i),{hashTransKey:N}=v,_=i||(N?N(E||C):E||C);(Q=(K=g.options)==null?void 0:K.interpolation)!=null&&Q.defaultVariables?a=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=k;const j=$5e(e);j&&typeof j.count=="number"&&t===void 0&&(t=j.count);const A=a||t!==void 0&&!((B=(q=g.options)==null?void 0:q.interpolation)!=null&&B.alwaysFormat)||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},F={...O,context:r||O.context,count:t,...a,...A,defaultValue:C,ns:y};let T=_?b(_,F):C;T===_&&C&&(T=C);const P=Q5e(S,T,g,i);let R=P||e,L=null;z5e(P)&&(L=P,R=e);const M=F5e(R,L,T,g,v,F,w),U=n??v.defaultTransParent;return U?p.createElement(U,m,M):M}const H5e={type:"3rdParty",init(e){P5e(e.options.react),D5e(e)}},Ufe=p.createContext();class q5e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function KA({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var x;const{i18n:g,defaultNS:b}=p.useContext(Ufe)||{},v=d||g||n9(),y=f||(v==null?void 0:v.t.bind(v));return V5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:a,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((x=v==null?void 0:v.options)==null?void 0:x.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var Qfe={exports:{}},zfe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -59,7 +59,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ov=p;function q5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W5e=typeof Object.is=="function"?Object.is:q5e,G5e=Ov.useState,K5e=Ov.useEffect,X5e=Ov.useLayoutEffect,Y5e=Ov.useDebugValue;function Z5e(e,t){var n=t(),i=G5e({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return X5e(function(){r.value=n,r.getSnapshot=t,MP(r)&&s({inst:r})},[e,n,t]),K5e(function(){return MP(r)&&s({inst:r}),e(function(){MP(r)&&s({inst:r})})},[e]),Y5e(n),n}function MP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!W5e(e,n)}catch{return!0}}function J5e(e,t){return t()}var eLe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?J5e:Z5e;Qfe.useSyncExternalStore=Ov.useSyncExternalStore!==void 0?Ov.useSyncExternalStore:eLe;Ufe.exports=Qfe;var zfe=Ufe.exports;const tLe=(e,t)=>{if(ml(t))return t;if(Hf(t)&&ml(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},nLe={t:tLe,ready:!1},iLe=()=>()=>{},Te=(e,t={})=>{var N,_,j;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(Bfe)||{},s=n||i||n9();s&&!s.reportNamespaces&&(s.reportNamespaces=new H5e),s||Uy(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const a=p.useMemo(()=>{var A;return{...t9(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((N=s==null?void 0:s.options)==null?void 0:N.defaultNS),d=ml(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(j=(_=s==null?void 0:s.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||j.call(_,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return iLe;const{bindI18n:F,bindI18nStore:T}=a,P=()=>{h.current+=1,A()};return F&&s.on(F,P),T&&s.store.on(T,P),()=>{F&&F.split(" ").forEach(R=>s.off(R,P)),T&&T.split(" ").forEach(R=>s.store.off(R,P))}},[s,a]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return nLe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(M=>_5e(M,s,a)),F=t.lng||s.language,T=h.current,P=g.current;if(P&&P.ready===A&&P.lng===F&&P.keyPrefix===c&&P.revision===T)return P;const L={t:s.getFixedT(F,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:F,keyPrefix:c,revision:T};return g.current=L,L},[s,f,c,a,t.lng]),[v,y]=p.useState(0),{t:x,ready:O}=zfe.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!O&&!l){const A=()=>y(F=>F+1);t.lng?_V(s,t.lng,f,A):YL(s,f,A)}},[s,t.lng,f,O,l,v]);const w=s||{},k=p.useRef(null),S=p.useRef(),E=A=>{const F=Object.getOwnPropertyDescriptors(A);F.__original&&delete F.__original;const T=Object.create(Object.getPrototypeOf(A),F);if(!Object.prototype.hasOwnProperty.call(T,"__original"))try{Object.defineProperty(T,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return T},C=p.useMemo(()=>{const A=w,F=A==null?void 0:A.language;let T=A;A&&(k.current&&k.current.__original===A?S.current!==F?(T=E(A),k.current=T,S.current=F):T=k.current:(T=E(A),k.current=T,S.current=F));const P=!O&&!l?(...L)=>(Uy(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),x(...L)):x,R=[P,T,O];return R.t=P,R.i18n=T,R.ready=O,R},[x,w,O,w.resolvedLanguage,w.language,w.languages]);if(s&&l&&!O){let A=!1;try{A=!1}catch{}throw A&&Uy(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(F=>{const T=()=>F();t.lng?_V(s,t.lng,f,T):YL(s,f,T)})}return C},Vfe=MMe(),an=Ho.createInstance();an.use(V5e).init({resources:{"en-US":{adk:ure,app:Cre,conversation:nse},"zh-CN":{adk:Tle,app:zle,conversation:vce}},lng:Vfe,fallbackLng:xj,supportedLngs:[...K8],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Sfe(Vfe);an.on("languageChanged",e=>{const t=wj(e)??xj;Sfe(t)});const rLe=Object.assign({"./resources/en-US/adk.json":LDe,"./resources/en-US/app.json":$De,"./resources/en-US/automations.json":FDe,"./resources/en-US/common.json":UDe,"./resources/en-US/conversation.json":QDe,"./resources/en-US/create.json":zDe,"./resources/en-US/cronjobs.json":HDe,"./resources/en-US/feedback.json":WDe,"./resources/en-US/migrations.json":KDe,"./resources/en-US/newChat.json":XDe,"./resources/en-US/sandbox.json":YDe,"./resources/en-US/shell.json":JDe,"./resources/en-US/sidebar.json":tMe,"./resources/en-US/skills.json":nMe,"./resources/en-US/ui.json":rMe,"./resources/en-US/websiteIntegration.json":aMe,"./resources/en-US/workspaceTools.json":oMe,"./resources/zh-CN/adk.json":lMe,"./resources/zh-CN/app.json":cMe,"./resources/zh-CN/automations.json":uMe,"./resources/zh-CN/common.json":fMe,"./resources/zh-CN/conversation.json":hMe,"./resources/zh-CN/create.json":pMe,"./resources/zh-CN/cronjobs.json":gMe,"./resources/zh-CN/feedback.json":yMe,"./resources/zh-CN/migrations.json":xMe,"./resources/zh-CN/newChat.json":wMe,"./resources/zh-CN/sandbox.json":OMe,"./resources/zh-CN/shell.json":kMe,"./resources/zh-CN/sidebar.json":CMe,"./resources/zh-CN/skills.json":TMe,"./resources/zh-CN/ui.json":_Me,"./resources/zh-CN/websiteIntegration.json":jMe,"./resources/zh-CN/workspaceTools.json":RMe});function sLe(){const e={};for(const[t,n]of Object.entries(rLe)){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(sLe()))for(const[n,i]of Object.entries(t??{}))an.addResourceBundle(e,n,i,!0,!0);async function aLe(e){LMe(e),await an.changeLanguage(e)}var Hfe={exports:{}},Sj={},qfe={exports:{}},Wfe={};/** + */var Ov=p;function W5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G5e=typeof Object.is=="function"?Object.is:W5e,K5e=Ov.useState,X5e=Ov.useEffect,Y5e=Ov.useLayoutEffect,Z5e=Ov.useDebugValue;function J5e(e,t){var n=t(),i=K5e({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return Y5e(function(){r.value=n,r.getSnapshot=t,MP(r)&&s({inst:r})},[e,n,t]),X5e(function(){return MP(r)&&s({inst:r}),e(function(){MP(r)&&s({inst:r})})},[e]),Z5e(n),n}function MP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!G5e(e,n)}catch{return!0}}function eLe(e,t){return t()}var tLe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eLe:J5e;zfe.useSyncExternalStore=Ov.useSyncExternalStore!==void 0?Ov.useSyncExternalStore:tLe;Qfe.exports=zfe;var Vfe=Qfe.exports;const nLe=(e,t)=>{if(ml(t))return t;if(Hf(t)&&ml(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},iLe={t:nLe,ready:!1},rLe=()=>()=>{},Te=(e,t={})=>{var N,_,j;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(Ufe)||{},s=n||i||n9();s&&!s.reportNamespaces&&(s.reportNamespaces=new q5e),s||Uy(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const a=p.useMemo(()=>{var A;return{...t9(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((N=s==null?void 0:s.options)==null?void 0:N.defaultNS),d=ml(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(j=(_=s==null?void 0:s.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||j.call(_,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return rLe;const{bindI18n:F,bindI18nStore:T}=a,P=()=>{h.current+=1,A()};return F&&s.on(F,P),T&&s.store.on(T,P),()=>{F&&F.split(" ").forEach(R=>s.off(R,P)),T&&T.split(" ").forEach(R=>s.store.off(R,P))}},[s,a]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return iLe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(M=>N5e(M,s,a)),F=t.lng||s.language,T=h.current,P=g.current;if(P&&P.ready===A&&P.lng===F&&P.keyPrefix===c&&P.revision===T)return P;const L={t:s.getFixedT(F,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:F,keyPrefix:c,revision:T};return g.current=L,L},[s,f,c,a,t.lng]),[v,y]=p.useState(0),{t:x,ready:O}=Vfe.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!O&&!l){const A=()=>y(F=>F+1);t.lng?_V(s,t.lng,f,A):YL(s,f,A)}},[s,t.lng,f,O,l,v]);const w=s||{},k=p.useRef(null),S=p.useRef(),E=A=>{const F=Object.getOwnPropertyDescriptors(A);F.__original&&delete F.__original;const T=Object.create(Object.getPrototypeOf(A),F);if(!Object.prototype.hasOwnProperty.call(T,"__original"))try{Object.defineProperty(T,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return T},C=p.useMemo(()=>{const A=w,F=A==null?void 0:A.language;let T=A;A&&(k.current&&k.current.__original===A?S.current!==F?(T=E(A),k.current=T,S.current=F):T=k.current:(T=E(A),k.current=T,S.current=F));const P=!O&&!l?(...L)=>(Uy(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),x(...L)):x,R=[P,T,O];return R.t=P,R.i18n=T,R.ready=O,R},[x,w,O,w.resolvedLanguage,w.language,w.languages]);if(s&&l&&!O){let A=!1;try{A=!1}catch{}throw A&&Uy(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(F=>{const T=()=>F();t.lng?_V(s,t.lng,f,T):YL(s,f,T)})}return C},Hfe=LMe(),an=Ho.createInstance();an.use(H5e).init({resources:{"en-US":{adk:dre,app:Tre,conversation:ise},"zh-CN":{adk:Ale,app:Vle,conversation:xce}},lng:Hfe,fallbackLng:xj,supportedLngs:[...K8],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});kfe(Hfe);an.on("languageChanged",e=>{const t=wj(e)??xj;kfe(t)});const sLe=Object.assign({"./resources/en-US/adk.json":$De,"./resources/en-US/app.json":FDe,"./resources/en-US/automations.json":BDe,"./resources/en-US/common.json":QDe,"./resources/en-US/conversation.json":zDe,"./resources/en-US/create.json":VDe,"./resources/en-US/cronjobs.json":qDe,"./resources/en-US/feedback.json":GDe,"./resources/en-US/migrations.json":XDe,"./resources/en-US/newChat.json":YDe,"./resources/en-US/sandbox.json":ZDe,"./resources/en-US/shell.json":eMe,"./resources/en-US/sidebar.json":nMe,"./resources/en-US/skills.json":iMe,"./resources/en-US/ui.json":sMe,"./resources/en-US/websiteIntegration.json":oMe,"./resources/en-US/workspaceTools.json":lMe,"./resources/zh-CN/adk.json":cMe,"./resources/zh-CN/app.json":uMe,"./resources/zh-CN/automations.json":dMe,"./resources/zh-CN/common.json":hMe,"./resources/zh-CN/conversation.json":pMe,"./resources/zh-CN/create.json":mMe,"./resources/zh-CN/cronjobs.json":bMe,"./resources/zh-CN/feedback.json":vMe,"./resources/zh-CN/migrations.json":wMe,"./resources/zh-CN/newChat.json":OMe,"./resources/zh-CN/sandbox.json":SMe,"./resources/zh-CN/shell.json":EMe,"./resources/zh-CN/sidebar.json":TMe,"./resources/zh-CN/skills.json":AMe,"./resources/zh-CN/ui.json":NMe,"./resources/zh-CN/websiteIntegration.json":RMe,"./resources/zh-CN/workspaceTools.json":IMe});function aLe(){const e={};for(const[t,n]of Object.entries(sLe)){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(aLe()))for(const[n,i]of Object.entries(t??{}))an.addResourceBundle(e,n,i,!0,!0);async function oLe(e){$Me(e),await an.changeLanguage(e)}var qfe={exports:{}},Sj={},Wfe={exports:{}},Gfe={};/** * @license React * scheduler.production.js * @@ -67,7 +67,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(R,L){var M=R.length;R.push(L);e:for(;0>>1,I=R[U];if(0>>1;Ur(Q,M))qr(B,Q)?(R[U]=B,R[q]=M,U=q):(R[U]=Q,R[K]=M,U=K);else if(qr(B,M))R[U]=B,R[q]=M,U=q;else break e}}return L}function r(R,L){var M=R.sortIndex-L.sortIndex;return M!==0?M:R.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var L=n(u);L!==null;){if(L.callback===null)i(u);else if(L.startTime<=R)i(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function k(R){if(b=!1,w(R),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var L=n(u);L!==null&&P(k,L.startTime-R)}}var S=!1,E=-1,C=5,N=-1;function _(){return v?!0:!(e.unstable_now()-NR&&_());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var I=U(f.expirationTime<=R);if(R=e.unstable_now(),typeof I=="function"){f.callback=I,w(R),L=!0;break t}f===n(c)&&i(c),w(R)}else i(c);f=n(c)}if(f!==null)L=!0;else{var H=n(u);H!==null&&P(k,H.startTime-R),L=!1}}break e}finally{f=null,h=M,m=!1}L=void 0}}finally{L?A():S=!1}}}var A;if(typeof O=="function")A=function(){O(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,T=F.port2;F.port1.onmessage=j,A=function(){T.postMessage(null)}}else A=function(){y(j,0)};function P(R,L){E=y(function(){R(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125U?(R.sortIndex=M,t(u,R),n(c)===null&&R===n(u)&&(b?(x(E),E=-1):b=!0,P(k,M-U))):(R.sortIndex=I,t(c,R),g||m||(g=!0,S||(S=!0,A()))),R},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(R){var L=h;return function(){var M=h;h=L;try{return R.apply(this,arguments)}finally{h=M}}}})(Wfe);qfe.exports=Wfe;var oLe=qfe.exports,Gfe={exports:{}},qo={};/** + */(function(e){function t(R,L){var M=R.length;R.push(L);e:for(;0>>1,I=R[U];if(0>>1;Ur(Q,M))qr(B,Q)?(R[U]=B,R[q]=M,U=q):(R[U]=Q,R[K]=M,U=K);else if(qr(B,M))R[U]=B,R[q]=M,U=q;else break e}}return L}function r(R,L){var M=R.sortIndex-L.sortIndex;return M!==0?M:R.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var L=n(u);L!==null;){if(L.callback===null)i(u);else if(L.startTime<=R)i(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function k(R){if(b=!1,w(R),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var L=n(u);L!==null&&P(k,L.startTime-R)}}var S=!1,E=-1,C=5,N=-1;function _(){return v?!0:!(e.unstable_now()-NR&&_());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var I=U(f.expirationTime<=R);if(R=e.unstable_now(),typeof I=="function"){f.callback=I,w(R),L=!0;break t}f===n(c)&&i(c),w(R)}else i(c);f=n(c)}if(f!==null)L=!0;else{var H=n(u);H!==null&&P(k,H.startTime-R),L=!1}}break e}finally{f=null,h=M,m=!1}L=void 0}}finally{L?A():S=!1}}}var A;if(typeof O=="function")A=function(){O(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,T=F.port2;F.port1.onmessage=j,A=function(){T.postMessage(null)}}else A=function(){y(j,0)};function P(R,L){E=y(function(){R(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125U?(R.sortIndex=M,t(u,R),n(c)===null&&R===n(u)&&(b?(x(E),E=-1):b=!0,P(k,M-U))):(R.sortIndex=I,t(c,R),g||m||(g=!0,S||(S=!0,A()))),R},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(R){var L=h;return function(){var M=h;h=L;try{return R.apply(this,arguments)}finally{h=M}}}})(Gfe);Wfe.exports=Gfe;var lLe=Wfe.exports,Kfe={exports:{}},qo={};/** * @license React * react-dom.production.js * @@ -75,7 +75,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lLe=p;function Kfe(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xfe)}catch(e){console.error(e)}}Xfe(),Gfe.exports=qo;var Li=Gfe.exports;/** + */var cLe=p;function Xfe(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Yfe)}catch(e){console.error(e)}}Yfe(),Kfe.exports=qo;var Li=Kfe.exports;/** * @license React * react-dom-client.production.js * @@ -83,15 +83,15 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ya=oLe,Yfe=p,dLe=Li;function dt(e){var t="https://react.dev/errors/"+e;if(1fy||(e.current=s3[fy],s3[fy]=null,fy--)}function Dr(e,t){fy++,s3[fy]=e.current,e.current=t}var Rd=Hd(null),KO=Hd(null),Hp=Hd(null),XA=Hd(null);function YA(e,t){switch(Dr(Hp,t),Dr(KO,e),Dr(Rd,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?LH(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=LH(t),e=Sme(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fa(Rd),Dr(Rd,e)}function Sv(){Fa(Rd),Fa(KO),Fa(Hp)}function a3(e){e.memoizedState!==null&&Dr(XA,e);var t=Rd.current,n=Sme(t,e.type);t!==n&&(Dr(KO,e),Dr(Rd,n))}function ZA(e){KO.current===e&&(Fa(Rd),Fa(KO)),XA.current===e&&(Fa(XA),aS._currentValue=Xg)}var LP,RV;function hg(e){if(LP===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);LP=t&&t[1]||"",RV=-1fy||(e.current=s3[fy],s3[fy]=null,fy--)}function Dr(e,t){fy++,s3[fy]=e.current,e.current=t}var Rd=Hd(null),KO=Hd(null),Hp=Hd(null),XA=Hd(null);function YA(e,t){switch(Dr(Hp,t),Dr(KO,e),Dr(Rd,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?LH(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=LH(t),e=kme(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fa(Rd),Dr(Rd,e)}function Sv(){Fa(Rd),Fa(KO),Fa(Hp)}function a3(e){e.memoizedState!==null&&Dr(XA,e);var t=Rd.current,n=kme(t,e.type);t!==n&&(Dr(KO,e),Dr(Rd,n))}function ZA(e){KO.current===e&&(Fa(Rd),Fa(KO)),XA.current===e&&(Fa(XA),aS._currentValue=Xg)}var LP,RV;function hg(e){if(LP===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);LP=t&&t[1]||"",RV=-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{$P=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?hg(n):""}function gLe(e,t){switch(e.tag){case 26:case 27:case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return e.child!==t&&t!==null?hg("Suspense Fallback"):hg("Suspense");case 19:return hg("SuspenseList");case 0:case 15:return FP(e.type,!1);case 11:return FP(e.type.render,!1);case 1:return FP(e.type,!0);case 31:return hg("Activity");default:return""}}function IV(e){try{var t="",n=null;do t+=gLe(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{$P=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?hg(n):""}function bLe(e,t){switch(e.tag){case 26:case 27:case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return e.child!==t&&t!==null?hg("Suspense Fallback"):hg("Suspense");case 19:return hg("SuspenseList");case 0:case 15:return FP(e.type,!1);case 11:return FP(e.type.render,!1);case 1:return FP(e.type,!0);case 31:return hg("Activity");default:return""}}function IV(e){try{var t="",n=null;do t+=bLe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var o3=Object.prototype.hasOwnProperty,s9=ya.unstable_scheduleCallback,BP=ya.unstable_cancelCallback,bLe=ya.unstable_shouldYield,yLe=ya.unstable_requestPaint,nc=ya.unstable_now,vLe=ya.unstable_getCurrentPriorityLevel,rhe=ya.unstable_ImmediatePriority,she=ya.unstable_UserBlockingPriority,JA=ya.unstable_NormalPriority,xLe=ya.unstable_LowPriority,ahe=ya.unstable_IdlePriority,wLe=ya.log,OLe=ya.unstable_setDisableYieldValue,Ck=null,ic=null;function Pp(e){if(typeof wLe=="function"&&OLe(e),ic&&typeof ic.setStrictMode=="function")try{ic.setStrictMode(Ck,e)}catch{}}var rc=Math.clz32?Math.clz32:ELe,SLe=Math.log,kLe=Math.LN2;function ELe(e){return e>>>=0,e===0?32:31-(SLe(e)/kLe|0)|0}var jC=256,RC=262144,IC=4194304;function pg(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ej(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=pg(i):(a&=l,a!==0?r=pg(a):n||(n=l&~e,n!==0&&(r=pg(n))))):(l=i&~s,l!==0?r=pg(l):a!==0?r=pg(a):n||(n=i&~e,n!==0&&(r=pg(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function Tk(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function CLe(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 ohe(){var e=IC;return IC<<=1,!(IC&62914560)&&(IC=4194304),e}function UP(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ak(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function TLe(e,t,n,i,r,s){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ILe=/[\n"\\]/g;function Fc(e){return e.replace(ILe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function u3(e,t,n,i,r,s,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pc(t)):e.value!==""+Pc(t)&&(e.value=""+Pc(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?d3(e,a,Pc(t)):n!=null?d3(e,a,Pc(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Pc(l):e.removeAttribute("name")}function ghe(e,t,n,i,r,s,a,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){c3(e);return}n=n!=null?""+Pc(n):"",t=t!=null?""+Pc(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),c3(e)}function d3(e,t,n){t==="number"&&e_(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function zy(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h3=!1;if(ph)try{var _1={};Object.defineProperty(_1,"passive",{get:function(){h3=!0}}),window.addEventListener("test",_1,_1),window.removeEventListener("test",_1,_1)}catch{h3=!1}var Dp=null,d9=null,I2=null;function whe(){if(I2)return I2;var e,t=d9,n=t.length,i,r="value"in Dp?Dp.value:Dp.textContent,s=r.length;for(e=0;e=eO),VV=" ",HV=!1;function She(e,t){switch(e){case"keyup":return o3e.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function khe(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var my=!1;function c3e(e,t){switch(e){case"compositionend":return khe(t);case"keypress":return t.which!==32?null:(HV=!0,VV);case"textInput":return e=t.data,e===VV&&HV?null:e;default:return null}}function u3e(e,t){if(my)return e==="compositionend"||!h9&&She(e,t)?(e=whe(),I2=d9=Dp=null,my=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=XV(n)}}function Ahe(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ahe(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _he(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=e_(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=e_(e.document)}return t}function p9(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 y3e=ph&&"documentMode"in document&&11>=document.documentMode,gy=null,p3=null,nO=null,m3=!1;function ZV(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;m3||gy==null||gy!==e_(i)||(i=gy,"selectionStart"in i&&p9(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nO&&ZO(nO,i)||(nO=i,i=y_(p3,"onSelect"),0>=a,r-=a,Od=1<<32-rc(t)+r|n<C?(N=E,E=null):N=E.sibling;var _=h(y,E,O[C],w);if(_===null){E===null&&(E=N);break}e&&E&&_.alternate===null&&t(y,E),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_,E=N}if(C===O.length)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;CC?(N=E,E=null):N=E.sibling;var j=h(y,E,_.value,w);if(j===null){E===null&&(E=N);break}e&&E&&j.alternate===null&&t(y,E),x=s(j,x,C),S===null?k=j:S.sibling=j,S=j,E=N}if(_.done)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;!_.done;C++,_=O.next())_=f(y,_.value,w),_!==null&&(x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return Mi&&Pf(y,C),k}for(E=i(E);!_.done;C++,_=O.next())_=m(E,y,C,_.value,w),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?C:_.key),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return e&&E.forEach(function(A){return t(y,A)}),Mi&&Pf(y,C),k}function v(y,x,O,w){if(typeof O=="object"&&O!==null&&O.type===dy&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case NC:e:{for(var k=O.key;x!==null;){if(x.key===k){if(k=O.type,k===dy){if(x.tag===7){n(y,x.sibling),w=r(x,O.props.children),w.return=y,y=w;break e}}else if(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vp&&mg(k)===x.type){n(y,x.sibling),w=r(x,O.props),j1(w,O),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}O.type===dy?(w=Yg(O.props.children,y.mode,w,O.key),w.return=y,y=w):(w=D2(O.type,O.key,O.props,null,y.mode,w),j1(w,O),w.return=y,y=w)}return a(y);case Ow:e:{for(k=O.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===O.containerInfo&&x.stateNode.implementation===O.implementation){n(y,x.sibling),w=r(x,O.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=XP(O,y.mode,w),w.return=y,y=w}return a(y);case vp:return O=mg(O),v(y,x,O,w)}if(Sw(O))return g(y,x,O,w);if(A1(O)){if(k=A1(O),typeof k!="function")throw Error(dt(150));return O=k.call(O),b(y,x,O,w)}if(typeof O.then=="function")return v(y,x,LC(O),w);if(O.$$typeof===qf)return v(y,x,MC(y,O),w);$C(y,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,x!==null&&x.tag===6?(n(y,x.sibling),w=r(x,O),w.return=y,y=w):(n(y,x),w=KP(O,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,O,w){try{tS=0;var k=v(y,x,O,w);return qy=null,k}catch(E){if(E===vx||E===jj)throw E;var S=Xl(29,E,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var hb=Vhe(!0),Hhe=Vhe(!1),xp=!1;function S9(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function O3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wp(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gp(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,tr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=n_(e),Mhe(e,null,n),t}return Nj(e,i,t,n),n_(e)}function rO(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,che(e,n)}}function ZP(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var S3=!1;function sO(){if(S3){var e=Hy;if(e!==null)throw e}}function aO(e,t,n,i){S3=!1;var r=e.updateQueue;xp=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;a=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(Ai&h)===h:(i&h)===h){h!==0&&h===Cv&&(S3=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Xr({},f,h);break e;case 2:xp=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),dm|=a,e.lanes=a,e.memoizedState=f}}function qhe(e,t){if(typeof e!="function")throw Error(dt(191,e));e.call(t)}function Whe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=Dn.T,l={};Dn.T=l,M9(e,!1,t,n);try{var c=r(),u=Dn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=T3e(c,i);oO(e,t,d,sc(e))}else oO(e,t,i,sc(e))}catch(f){oO(e,t,{then:function(){},status:"rejected",reason:f},sc())}finally{nr.p=s,a!==null&&l.types!==null&&(a.types=l.types),Dn.T=a}}function I3e(){}function A3(e,t,n,i){if(e.tag!==5)throw Error(dt(476));var r=ype(e).queue;bpe(e,r,t,Xg,n===null?I3e:function(){return vpe(e),n(i)})}function ype(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xg,baseState:Xg,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:Xg},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vpe(e){var t=ype(e);t.next===null&&(t=e.alternate.memoizedState),oO(e,t.next.queue,{},sc())}function D9(){return to(aS)}function xpe(){return Bs().memoizedState}function wpe(){return Bs().memoizedState}function P3e(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=sc();e=Wp(n);var i=Gp(t,e,n);i!==null&&(gl(i,t,n),rO(i,t,n)),t={cache:x9()},e.payload=t;return}t=t.return}}function D3e(e,t,n){var i=sc();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dj(e)?Spe(t,n):(n=g9(e,t,n,i),n!==null&&(gl(n,e,i),kpe(n,t,i)))}function Ope(e,t,n){var i=sc();oO(e,t,n,i)}function oO(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dj(e))Spe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(r.hasEagerState=!0,r.eagerState=l,uc(l,a))return Nj(e,t,r,0),Tr===null&&_j(),!1}catch{}finally{}if(n=g9(e,t,r,i),n!==null)return gl(n,e,i),kpe(n,t,i),!0}return!1}function M9(e,t,n,i){if(i={lane:2,revertLane:H9(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dj(e)){if(t)throw Error(dt(479))}else t=g9(e,n,i,2),t!==null&&gl(t,e,2)}function Dj(e){var t=e.alternate;return e===Zn||t!==null&&t===Zn}function Spe(e,t){Wy=l_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kpe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,che(e,n)}}var iS={readContext:to,use:Ij,useCallback:Os,useContext:Os,useEffect:Os,useImperativeHandle:Os,useLayoutEffect:Os,useInsertionEffect:Os,useMemo:Os,useReducer:Os,useRef:Os,useState:Os,useDebugValue:Os,useDeferredValue:Os,useTransition:Os,useSyncExternalStore:Os,useId:Os,useHostTransitionStatus:Os,useFormState:Os,useActionState:Os,useOptimistic:Os,useMemoCache:Os,useCacheRefresh:Os};iS.useEffectEvent=Os;var Epe={readContext:to,use:Ij,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:hH,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$2(4194308,4,fpe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $2(4194308,4,e,t)},useInsertionEffect:function(e,t){$2(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var i=e();if(pb){Pp(!0);try{e()}finally{Pp(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Ro();if(n!==void 0){var r=n(t);if(pb){Pp(!0);try{n(t)}finally{Pp(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=D3e.bind(null,Zn,e),[i.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=C3(e);var t=e.queue,n=Ope.bind(null,Zn,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:I9,useDeferredValue:function(e,t){var n=Ro();return P9(n,e,t)},useTransition:function(){var e=C3(!1);return e=bpe.bind(null,Zn,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Zn,r=Ro();if(Mi){if(n===void 0)throw Error(dt(407));n=n()}else{if(n=t(),Tr===null)throw Error(dt(349));Ai&127||Zhe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,hH(epe.bind(null,i,s,e),[e]),i.flags|=2048,Av(9,{destroy:void 0},Jhe.bind(null,i,s,n,t),null),n},useId:function(){var e=Ro(),t=Tr.identifierPrefix;if(Mi){var n=Sd,i=Od;n=(i&~(1<<32-rc(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=c_++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}s[Za]=t,s[vl]=i;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(no(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&gf(t)}}return Qr(t),aD(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&gf(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(dt(166));if(e=Hp.current,T0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=Ja,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Za]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Ome(e.nodeValue,n)),e||cm(t,!0)}else e=v_(e).createTextNode(i),e[Za]=t,t.stateNode=e}return Qr(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=T0(t),n!==null){if(e===null){if(!i)throw Error(dt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(dt(557));e[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),e=!1}else n=YP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if(t.flags&128)throw Error(dt(558))}return Qr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=T0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(dt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(dt(317));r[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),r=!1}else r=YP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),FC(t,t.updateQueue),Qr(t),null);case 4:return Sv(),e===null&&q9(t.stateNode.containerInfo),Qr(t),null;case 10:return Jf(t.type),Qr(t),null;case 19:if(Fa(Ms),i=t.memoizedState,i===null)return Qr(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)R1(i,!1);else{if(Es!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=o_(e),s!==null){for(t.flags|=128,R1(i,!1),e=s.updateQueue,t.updateQueue=e,FC(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Lhe(n,e),n=n.sibling;return Dr(Ms,Ms.current&1|2),Mi&&Pf(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&nc()>h_&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304)}else{if(!r)if(e=o_(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,FC(t,e),R1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mi)return Qr(t),null}else 2*nc()-i.renderingStartTime>h_&&n!==536870912&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=nc(),e.sibling=null,n=Ms.current,Dr(Ms,r?n&1|2:n&1),Mi&&Pf(t,i.treeForkCount),e):(Qr(t),null);case 22:case 23:return Gl(t),k9(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Qr(t),t.subtreeFlags&6&&(t.flags|=8192)):Qr(t),n=t.updateQueue,n!==null&&FC(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Fa(Zg),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jf(Ys),Qr(t),null;case 25:return null;case 30:return null}throw Error(dt(156,t.tag))}function B3e(e,t){switch(v9(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jf(Ys),Sv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ZA(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(dt(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(dt(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fa(Ms),null;case 4:return Sv(),null;case 10:return Jf(t.type),null;case 22:case 23:return Gl(t),k9(),e!==null&&Fa(Zg),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jf(Ys),null;case 25:return null;default:return null}}function Lpe(e,t){switch(v9(t),t.tag){case 3:Jf(Ys),Sv();break;case 26:case 27:case 5:ZA(t);break;case 4:Sv();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:Fa(Ms);break;case 10:Jf(t.type);break;case 22:case 23:Gl(t),k9(),e!==null&&Fa(Zg);break;case 24:Jf(Ys)}}function Ik(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,a=n.inst;i=s(),a.destroy=i}n=n.next}while(n!==r)}}catch(l){hr(t,t.return,l)}}function um(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var a=i.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){hr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){hr(t,t.return,d)}}function $pe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Whe(t,n)}catch(i){hr(e,e.return,i)}}}function Fpe(e,t,n){n.props=mb(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){hr(e,t,i)}}function lO(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){hr(e,t,r)}}function kd(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){hr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){hr(e,t,r)}else n.current=null}function Bpe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){hr(e,e.return,r)}}function oD(e,t,n){try{var i=e.stateNode;l4e(i,e.type,n,t),i[vl]=t}catch(r){hr(e,e.return,r)}}function Upe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dm(e.type)||e.tag===4}function lD(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Upe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Dm(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I3(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wf));else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(I3(e,t,n),e=e.sibling;e!==null;)I3(e,t,n),e=e.sibling}function f_(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(f_(e,t,n),e=e.sibling;e!==null;)f_(e,t,n),e=e.sibling}function Qpe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);no(t,i,n),t[Za]=e,t[vl]=n}catch(s){hr(e,e.return,s)}}var Bf=!1,Xs=!1,cD=!1,CH=typeof WeakSet=="function"?WeakSet:Set,Na=null;function U3e(e,t){if(e=e.containerInfo,B3=S_,e=_he(e),p9(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=a+r),f!==s||i!==0&&f.nodeType!==3||(c=a+i),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===s&&++d===i&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(U3={focusedElem:e,selectionRange:n},S_=!1,Na=t;Na!==null;)if(t=Na,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Na=e;else for(;Na!==null;){switch(t=Na,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),no(s,i,n),s[Za]=e,Ia(s),i=s;break e;case"link":var a=qH("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=YV(l,b),x=YV(l,v);if(y&&x&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==x.node||m.focusOffset!==x.offset)){var O=f.createRange();O.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(O),m.extend(x.node,x.offset)):(O.setEnd(x.node,x.offset),m.addRange(O))}}}}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,Dn.T=null,n=M3,M3=null;var s=Xp,a=eh;if(ga=0,Nv=Xp=null,eh=0,tr&6)throw Error(dt(331));var l=tr;if(tr|=4,Jpe(s.current),Xpe(s,s.current,a,n),tr=l,Pk(0,!1),ic&&typeof ic.onPostCommitFiberRoot=="function")try{ic.onPostCommitFiberRoot(Ck,s)}catch{}return!0}finally{nr.p=r,Dn.T=i,pme(e,t)}}function NH(e,t,n){t=Bc(n,t),t=N3(e.stateNode,t,2),e=Gp(e,t,2),e!==null&&(Ak(e,2),qd(e))}function hr(e,t,n){if(e.tag===3)NH(e,e,n);else for(;t!==null;){if(t.tag===3){NH(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kp===null||!Kp.has(i))){e=Bc(n,e),n=Npe(2),i=Gp(t,n,2),i!==null&&(jpe(n,i,t,e),Ak(i,2),qd(i));break}}t=t.return}}function dD(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new V3e;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)||(Q9=!0,r.add(n),e=K3e.bind(null,e,t,n),t.then(e,e))}function K3e(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tr===e&&(Ai&n)===n&&(Es===4||Es===3&&(Ai&62914560)===Ai&&300>nc()-Mj?!(tr&2)&&jv(e,0):z9|=n,_v===Ai&&(_v=0)),qd(e)}function gme(e,t){t===0&&(t=ohe()),e=zb(e,t),e!==null&&(Ak(e,t),qd(e))}function X3e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gme(e,n)}function Y3e(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(dt(314))}i!==null&&i.delete(t),gme(e,n)}function Z3e(e,t){return s9(e,t)}var g_=null,Z0=null,$3=!1,b_=!1,fD=!1,$p=0;function qd(e){e!==Z0&&e.next===null&&(Z0===null?g_=Z0=e:Z0=Z0.next=e),b_=!0,$3||($3=!0,e4e())}function Pk(e,t){if(!fD&&b_){fD=!0;do for(var n=!1,i=g_;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var a=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-rc(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,jH(i,s))}else s=Ai,s=Ej(i,i===Tr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||Tk(i,s)||(n=!0,jH(i,s));i=i.next}while(n);fD=!1}}function J3e(){bme()}function bme(){b_=$3=!1;var e=0;$p!==0&&u4e()&&(e=$p);for(var t=nc(),n=null,i=g_;i!==null;){var r=i.next,s=yme(i,t);s===0?(i.next=null,n===null?g_=r:n.next=r,r===null&&(Z0=n)):(n=i,(e!==0||s&3)&&(b_=!0)),i=r}ga!==0&&ga!==5||Pk(e),$p!==0&&($p=0)}function yme(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&&MH(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Tme(e,t,n){var i=wx;if(i&&typeof t=="string"&&t){var r=Fc(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),zH.has(r)||(zH.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function v4e(e){Ph.D(e),Tme("dns-prefetch",e,null)}function x4e(e,t){Ph.C(e,t),Tme("preconnect",e,t)}function w4e(e,t,n){Ph.L(e,t,n);var i=wx;if(i&&e&&t){var r='link[rel="preload"][as="'+Fc(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Fc(n.imageSizes)+'"]')):r+='[href="'+Fc(e)+'"]';var s=r;switch(t){case"style":s=Rv(e);break;case"script":s=Ox(e)}nu.has(s)||(e=Xr({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nu.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(Dk(s))||t==="script"&&i.querySelector(Mk(s))||(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function O4e(e,t){Ph.m(e,t);var n=wx;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Fc(i)+'"][href="'+Fc(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ox(e)}if(!nu.has(s)&&(e=Xr({rel:"modulepreload",href:e},t),nu.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Mk(s)))return}i=n.createElement("link"),no(i,"link",e),Ia(i),n.head.appendChild(i)}}}function S4e(e,t,n){Ph.S(e,t,n);var i=wx;if(i&&e){var r=Qy(i).hoistableStyles,s=Rv(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(Dk(s)))l.loading=5;else{e=Xr({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nu.get(s))&&W9(e,n);var c=a=i.createElement("link");Ia(c),no(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Q2(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function k4e(e,t){Ph.X(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0},t),(t=nu.get(r))&&G9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function E4e(e,t){Ph.M(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0,type:"module"},t),(t=nu.get(r))&&G9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function VH(e,t,n,i){var r=(r=Hp.current)?x_(r):null;if(!r)throw Error(dt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Rv(n.href),n=Qy(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Rv(n.href);var s=Qy(r).hoistableStyles,a=s.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=r.querySelector(Dk(e)))&&!s._p&&(a.instance=s,a.state.loading=5),nu.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nu.set(e,n),s||C4e(r,e,n,a.state))),t&&i===null)throw Error(dt(528,""));return a}if(t&&i!==null)throw Error(dt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ox(n),n=Qy(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(dt(444,e))}}function Rv(e){return'href="'+Fc(e)+'"'}function Dk(e){return'link[rel="stylesheet"]['+e+"]"}function Ame(e){return Xr({},e,{"data-precedence":e.precedence,precedence:null})}function C4e(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),no(t,"link",n),Ia(t),e.head.appendChild(t))}function Ox(e){return'[src="'+Fc(e)+'"]'}function Mk(e){return"script[async]"+e}function HH(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Fc(n.href)+'"]');if(i)return t.instance=i,Ia(i),i;var r=Xr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ia(i),no(i,"style",r),Q2(i,n.precedence,e),t.instance=i;case"stylesheet":r=Rv(n.href);var s=e.querySelector(Dk(r));if(s)return t.state.loading|=4,t.instance=s,Ia(s),s;i=Ame(n),(r=nu.get(r))&&W9(i,r),s=(e.ownerDocument||e).createElement("link"),Ia(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),t.state.loading|=4,Q2(s,n.precedence,e),t.instance=s;case"script":return s=Ox(n.src),(r=e.querySelector(Mk(s)))?(t.instance=r,Ia(r),r):(i=n,(r=nu.get(s))&&(i=Xr({},n),G9(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ia(r),no(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(dt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Q2(i,n.precedence,e));return t.instance}function Q2(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,a=0;a title"):null)}function T4e(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 _me(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function A4e(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Rv(i.href),s=t.querySelector(Dk(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=w_.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ia(s);return}s=t.ownerDocument||t,i=Ame(i),(r=nu.get(r))&&W9(i,r),s=s.createElement("link"),Ia(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=w_.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var yD=0;function _4e(e,t){return e.stylesheets&&e.count===0&&V2(e,e.stylesheets),0yD?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function w_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)V2(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var O_=null;function V2(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,O_=new Map,t.forEach(N4e,e),O_=null,w_.call(e))}function N4e(e,t){if(!(t.state.loading&4)){var n=O_.get(e);if(n)var i=n.get(null);else{n=new Map,O_.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lme)}catch(e){console.error(e)}}Lme(),Hfe.exports=Sj;var $4e=Hfe.exports;const F4e=px($4e),J9=p.createContext({});function Uj(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qj=p.createContext(null),cS=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class B4e 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 U4e({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(cS);return p.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=r.current;if(t||!i.current||!a||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}}var o3=Object.prototype.hasOwnProperty,s9=ya.unstable_scheduleCallback,BP=ya.unstable_cancelCallback,yLe=ya.unstable_shouldYield,vLe=ya.unstable_requestPaint,nc=ya.unstable_now,xLe=ya.unstable_getCurrentPriorityLevel,she=ya.unstable_ImmediatePriority,ahe=ya.unstable_UserBlockingPriority,JA=ya.unstable_NormalPriority,wLe=ya.unstable_LowPriority,ohe=ya.unstable_IdlePriority,OLe=ya.log,SLe=ya.unstable_setDisableYieldValue,Ck=null,ic=null;function Pp(e){if(typeof OLe=="function"&&SLe(e),ic&&typeof ic.setStrictMode=="function")try{ic.setStrictMode(Ck,e)}catch{}}var rc=Math.clz32?Math.clz32:CLe,kLe=Math.log,ELe=Math.LN2;function CLe(e){return e>>>=0,e===0?32:31-(kLe(e)/ELe|0)|0}var jC=256,RC=262144,IC=4194304;function pg(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ej(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=pg(i):(a&=l,a!==0?r=pg(a):n||(n=l&~e,n!==0&&(r=pg(n))))):(l=i&~s,l!==0?r=pg(l):a!==0?r=pg(a):n||(n=i&~e,n!==0&&(r=pg(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function Tk(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function TLe(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 lhe(){var e=IC;return IC<<=1,!(IC&62914560)&&(IC=4194304),e}function UP(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ak(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ALe(e,t,n,i,r,s){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var PLe=/[\n"\\]/g;function Fc(e){return e.replace(PLe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function u3(e,t,n,i,r,s,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pc(t)):e.value!==""+Pc(t)&&(e.value=""+Pc(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?d3(e,a,Pc(t)):n!=null?d3(e,a,Pc(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Pc(l):e.removeAttribute("name")}function bhe(e,t,n,i,r,s,a,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){c3(e);return}n=n!=null?""+Pc(n):"",t=t!=null?""+Pc(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),c3(e)}function d3(e,t,n){t==="number"&&e_(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function zy(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h3=!1;if(ph)try{var _1={};Object.defineProperty(_1,"passive",{get:function(){h3=!0}}),window.addEventListener("test",_1,_1),window.removeEventListener("test",_1,_1)}catch{h3=!1}var Dp=null,d9=null,I2=null;function Ohe(){if(I2)return I2;var e,t=d9,n=t.length,i,r="value"in Dp?Dp.value:Dp.textContent,s=r.length;for(e=0;e=eO),VV=" ",HV=!1;function khe(e,t){switch(e){case"keyup":return l3e.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ehe(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var my=!1;function u3e(e,t){switch(e){case"compositionend":return Ehe(t);case"keypress":return t.which!==32?null:(HV=!0,VV);case"textInput":return e=t.data,e===VV&&HV?null:e;default:return null}}function d3e(e,t){if(my)return e==="compositionend"||!h9&&khe(e,t)?(e=Ohe(),I2=d9=Dp=null,my=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=XV(n)}}function _he(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_he(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nhe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=e_(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=e_(e.document)}return t}function p9(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 v3e=ph&&"documentMode"in document&&11>=document.documentMode,gy=null,p3=null,nO=null,m3=!1;function ZV(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;m3||gy==null||gy!==e_(i)||(i=gy,"selectionStart"in i&&p9(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nO&&ZO(nO,i)||(nO=i,i=y_(p3,"onSelect"),0>=a,r-=a,Od=1<<32-rc(t)+r|n<C?(N=E,E=null):N=E.sibling;var _=h(y,E,O[C],w);if(_===null){E===null&&(E=N);break}e&&E&&_.alternate===null&&t(y,E),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_,E=N}if(C===O.length)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;CC?(N=E,E=null):N=E.sibling;var j=h(y,E,_.value,w);if(j===null){E===null&&(E=N);break}e&&E&&j.alternate===null&&t(y,E),x=s(j,x,C),S===null?k=j:S.sibling=j,S=j,E=N}if(_.done)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;!_.done;C++,_=O.next())_=f(y,_.value,w),_!==null&&(x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return Mi&&Pf(y,C),k}for(E=i(E);!_.done;C++,_=O.next())_=m(E,y,C,_.value,w),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?C:_.key),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return e&&E.forEach(function(A){return t(y,A)}),Mi&&Pf(y,C),k}function v(y,x,O,w){if(typeof O=="object"&&O!==null&&O.type===dy&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case NC:e:{for(var k=O.key;x!==null;){if(x.key===k){if(k=O.type,k===dy){if(x.tag===7){n(y,x.sibling),w=r(x,O.props.children),w.return=y,y=w;break e}}else if(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vp&&mg(k)===x.type){n(y,x.sibling),w=r(x,O.props),j1(w,O),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}O.type===dy?(w=Yg(O.props.children,y.mode,w,O.key),w.return=y,y=w):(w=D2(O.type,O.key,O.props,null,y.mode,w),j1(w,O),w.return=y,y=w)}return a(y);case Ow:e:{for(k=O.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===O.containerInfo&&x.stateNode.implementation===O.implementation){n(y,x.sibling),w=r(x,O.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=XP(O,y.mode,w),w.return=y,y=w}return a(y);case vp:return O=mg(O),v(y,x,O,w)}if(Sw(O))return g(y,x,O,w);if(A1(O)){if(k=A1(O),typeof k!="function")throw Error(dt(150));return O=k.call(O),b(y,x,O,w)}if(typeof O.then=="function")return v(y,x,LC(O),w);if(O.$$typeof===qf)return v(y,x,MC(y,O),w);$C(y,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,x!==null&&x.tag===6?(n(y,x.sibling),w=r(x,O),w.return=y,y=w):(n(y,x),w=KP(O,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,O,w){try{tS=0;var k=v(y,x,O,w);return qy=null,k}catch(E){if(E===vx||E===jj)throw E;var S=Xl(29,E,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var hb=Hhe(!0),qhe=Hhe(!1),xp=!1;function S9(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function O3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wp(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gp(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,tr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=n_(e),Lhe(e,null,n),t}return Nj(e,i,t,n),n_(e)}function rO(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,uhe(e,n)}}function ZP(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var S3=!1;function sO(){if(S3){var e=Hy;if(e!==null)throw e}}function aO(e,t,n,i){S3=!1;var r=e.updateQueue;xp=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;a=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(Ai&h)===h:(i&h)===h){h!==0&&h===Cv&&(S3=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Xr({},f,h);break e;case 2:xp=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),dm|=a,e.lanes=a,e.memoizedState=f}}function Whe(e,t){if(typeof e!="function")throw Error(dt(191,e));e.call(t)}function Ghe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=Dn.T,l={};Dn.T=l,M9(e,!1,t,n);try{var c=r(),u=Dn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=A3e(c,i);oO(e,t,d,sc(e))}else oO(e,t,i,sc(e))}catch(f){oO(e,t,{then:function(){},status:"rejected",reason:f},sc())}finally{nr.p=s,a!==null&&l.types!==null&&(a.types=l.types),Dn.T=a}}function P3e(){}function A3(e,t,n,i){if(e.tag!==5)throw Error(dt(476));var r=vpe(e).queue;ype(e,r,t,Xg,n===null?P3e:function(){return xpe(e),n(i)})}function vpe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xg,baseState:Xg,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:Xg},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xpe(e){var t=vpe(e);t.next===null&&(t=e.alternate.memoizedState),oO(e,t.next.queue,{},sc())}function D9(){return to(aS)}function wpe(){return Bs().memoizedState}function Ope(){return Bs().memoizedState}function D3e(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=sc();e=Wp(n);var i=Gp(t,e,n);i!==null&&(gl(i,t,n),rO(i,t,n)),t={cache:x9()},e.payload=t;return}t=t.return}}function M3e(e,t,n){var i=sc();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dj(e)?kpe(t,n):(n=g9(e,t,n,i),n!==null&&(gl(n,e,i),Epe(n,t,i)))}function Spe(e,t,n){var i=sc();oO(e,t,n,i)}function oO(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dj(e))kpe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(r.hasEagerState=!0,r.eagerState=l,uc(l,a))return Nj(e,t,r,0),Tr===null&&_j(),!1}catch{}finally{}if(n=g9(e,t,r,i),n!==null)return gl(n,e,i),Epe(n,t,i),!0}return!1}function M9(e,t,n,i){if(i={lane:2,revertLane:H9(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dj(e)){if(t)throw Error(dt(479))}else t=g9(e,n,i,2),t!==null&&gl(t,e,2)}function Dj(e){var t=e.alternate;return e===Zn||t!==null&&t===Zn}function kpe(e,t){Wy=l_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Epe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,uhe(e,n)}}var iS={readContext:to,use:Ij,useCallback:Os,useContext:Os,useEffect:Os,useImperativeHandle:Os,useLayoutEffect:Os,useInsertionEffect:Os,useMemo:Os,useReducer:Os,useRef:Os,useState:Os,useDebugValue:Os,useDeferredValue:Os,useTransition:Os,useSyncExternalStore:Os,useId:Os,useHostTransitionStatus:Os,useFormState:Os,useActionState:Os,useOptimistic:Os,useMemoCache:Os,useCacheRefresh:Os};iS.useEffectEvent=Os;var Cpe={readContext:to,use:Ij,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:hH,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$2(4194308,4,hpe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $2(4194308,4,e,t)},useInsertionEffect:function(e,t){$2(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var i=e();if(pb){Pp(!0);try{e()}finally{Pp(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Ro();if(n!==void 0){var r=n(t);if(pb){Pp(!0);try{n(t)}finally{Pp(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=M3e.bind(null,Zn,e),[i.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=C3(e);var t=e.queue,n=Spe.bind(null,Zn,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:I9,useDeferredValue:function(e,t){var n=Ro();return P9(n,e,t)},useTransition:function(){var e=C3(!1);return e=ype.bind(null,Zn,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Zn,r=Ro();if(Mi){if(n===void 0)throw Error(dt(407));n=n()}else{if(n=t(),Tr===null)throw Error(dt(349));Ai&127||Jhe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,hH(tpe.bind(null,i,s,e),[e]),i.flags|=2048,Av(9,{destroy:void 0},epe.bind(null,i,s,n,t),null),n},useId:function(){var e=Ro(),t=Tr.identifierPrefix;if(Mi){var n=Sd,i=Od;n=(i&~(1<<32-rc(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=c_++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}s[Za]=t,s[vl]=i;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(no(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&gf(t)}}return Qr(t),aD(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&gf(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(dt(166));if(e=Hp.current,T0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=Ja,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Za]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Sme(e.nodeValue,n)),e||cm(t,!0)}else e=v_(e).createTextNode(i),e[Za]=t,t.stateNode=e}return Qr(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=T0(t),n!==null){if(e===null){if(!i)throw Error(dt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(dt(557));e[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),e=!1}else n=YP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if(t.flags&128)throw Error(dt(558))}return Qr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=T0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(dt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(dt(317));r[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),r=!1}else r=YP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),FC(t,t.updateQueue),Qr(t),null);case 4:return Sv(),e===null&&q9(t.stateNode.containerInfo),Qr(t),null;case 10:return Jf(t.type),Qr(t),null;case 19:if(Fa(Ms),i=t.memoizedState,i===null)return Qr(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)R1(i,!1);else{if(Es!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=o_(e),s!==null){for(t.flags|=128,R1(i,!1),e=s.updateQueue,t.updateQueue=e,FC(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$he(n,e),n=n.sibling;return Dr(Ms,Ms.current&1|2),Mi&&Pf(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&nc()>h_&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304)}else{if(!r)if(e=o_(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,FC(t,e),R1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mi)return Qr(t),null}else 2*nc()-i.renderingStartTime>h_&&n!==536870912&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=nc(),e.sibling=null,n=Ms.current,Dr(Ms,r?n&1|2:n&1),Mi&&Pf(t,i.treeForkCount),e):(Qr(t),null);case 22:case 23:return Gl(t),k9(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Qr(t),t.subtreeFlags&6&&(t.flags|=8192)):Qr(t),n=t.updateQueue,n!==null&&FC(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Fa(Zg),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jf(Ys),Qr(t),null;case 25:return null;case 30:return null}throw Error(dt(156,t.tag))}function U3e(e,t){switch(v9(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jf(Ys),Sv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ZA(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(dt(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(dt(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fa(Ms),null;case 4:return Sv(),null;case 10:return Jf(t.type),null;case 22:case 23:return Gl(t),k9(),e!==null&&Fa(Zg),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jf(Ys),null;case 25:return null;default:return null}}function $pe(e,t){switch(v9(t),t.tag){case 3:Jf(Ys),Sv();break;case 26:case 27:case 5:ZA(t);break;case 4:Sv();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:Fa(Ms);break;case 10:Jf(t.type);break;case 22:case 23:Gl(t),k9(),e!==null&&Fa(Zg);break;case 24:Jf(Ys)}}function Ik(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,a=n.inst;i=s(),a.destroy=i}n=n.next}while(n!==r)}}catch(l){hr(t,t.return,l)}}function um(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var a=i.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){hr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){hr(t,t.return,d)}}function Fpe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ghe(t,n)}catch(i){hr(e,e.return,i)}}}function Bpe(e,t,n){n.props=mb(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){hr(e,t,i)}}function lO(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){hr(e,t,r)}}function kd(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){hr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){hr(e,t,r)}else n.current=null}function Upe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){hr(e,e.return,r)}}function oD(e,t,n){try{var i=e.stateNode;c4e(i,e.type,n,t),i[vl]=t}catch(r){hr(e,e.return,r)}}function Qpe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dm(e.type)||e.tag===4}function lD(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qpe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Dm(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I3(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wf));else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(I3(e,t,n),e=e.sibling;e!==null;)I3(e,t,n),e=e.sibling}function f_(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(f_(e,t,n),e=e.sibling;e!==null;)f_(e,t,n),e=e.sibling}function zpe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);no(t,i,n),t[Za]=e,t[vl]=n}catch(s){hr(e,e.return,s)}}var Bf=!1,Xs=!1,cD=!1,CH=typeof WeakSet=="function"?WeakSet:Set,Na=null;function Q3e(e,t){if(e=e.containerInfo,B3=S_,e=Nhe(e),p9(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=a+r),f!==s||i!==0&&f.nodeType!==3||(c=a+i),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===s&&++d===i&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(U3={focusedElem:e,selectionRange:n},S_=!1,Na=t;Na!==null;)if(t=Na,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Na=e;else for(;Na!==null;){switch(t=Na,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),no(s,i,n),s[Za]=e,Ia(s),i=s;break e;case"link":var a=qH("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=YV(l,b),x=YV(l,v);if(y&&x&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==x.node||m.focusOffset!==x.offset)){var O=f.createRange();O.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(O),m.extend(x.node,x.offset)):(O.setEnd(x.node,x.offset),m.addRange(O))}}}}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,Dn.T=null,n=M3,M3=null;var s=Xp,a=eh;if(ga=0,Nv=Xp=null,eh=0,tr&6)throw Error(dt(331));var l=tr;if(tr|=4,eme(s.current),Ype(s,s.current,a,n),tr=l,Pk(0,!1),ic&&typeof ic.onPostCommitFiberRoot=="function")try{ic.onPostCommitFiberRoot(Ck,s)}catch{}return!0}finally{nr.p=r,Dn.T=i,mme(e,t)}}function NH(e,t,n){t=Bc(n,t),t=N3(e.stateNode,t,2),e=Gp(e,t,2),e!==null&&(Ak(e,2),qd(e))}function hr(e,t,n){if(e.tag===3)NH(e,e,n);else for(;t!==null;){if(t.tag===3){NH(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kp===null||!Kp.has(i))){e=Bc(n,e),n=jpe(2),i=Gp(t,n,2),i!==null&&(Rpe(n,i,t,e),Ak(i,2),qd(i));break}}t=t.return}}function dD(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new H3e;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)||(Q9=!0,r.add(n),e=X3e.bind(null,e,t,n),t.then(e,e))}function X3e(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tr===e&&(Ai&n)===n&&(Es===4||Es===3&&(Ai&62914560)===Ai&&300>nc()-Mj?!(tr&2)&&jv(e,0):z9|=n,_v===Ai&&(_v=0)),qd(e)}function bme(e,t){t===0&&(t=lhe()),e=zb(e,t),e!==null&&(Ak(e,t),qd(e))}function Y3e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bme(e,n)}function Z3e(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(dt(314))}i!==null&&i.delete(t),bme(e,n)}function J3e(e,t){return s9(e,t)}var g_=null,Z0=null,$3=!1,b_=!1,fD=!1,$p=0;function qd(e){e!==Z0&&e.next===null&&(Z0===null?g_=Z0=e:Z0=Z0.next=e),b_=!0,$3||($3=!0,t4e())}function Pk(e,t){if(!fD&&b_){fD=!0;do for(var n=!1,i=g_;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var a=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-rc(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,jH(i,s))}else s=Ai,s=Ej(i,i===Tr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||Tk(i,s)||(n=!0,jH(i,s));i=i.next}while(n);fD=!1}}function e4e(){yme()}function yme(){b_=$3=!1;var e=0;$p!==0&&d4e()&&(e=$p);for(var t=nc(),n=null,i=g_;i!==null;){var r=i.next,s=vme(i,t);s===0?(i.next=null,n===null?g_=r:n.next=r,r===null&&(Z0=n)):(n=i,(e!==0||s&3)&&(b_=!0)),i=r}ga!==0&&ga!==5||Pk(e),$p!==0&&($p=0)}function vme(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&&MH(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Ame(e,t,n){var i=wx;if(i&&typeof t=="string"&&t){var r=Fc(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),zH.has(r)||(zH.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function x4e(e){Ph.D(e),Ame("dns-prefetch",e,null)}function w4e(e,t){Ph.C(e,t),Ame("preconnect",e,t)}function O4e(e,t,n){Ph.L(e,t,n);var i=wx;if(i&&e&&t){var r='link[rel="preload"][as="'+Fc(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Fc(n.imageSizes)+'"]')):r+='[href="'+Fc(e)+'"]';var s=r;switch(t){case"style":s=Rv(e);break;case"script":s=Ox(e)}nu.has(s)||(e=Xr({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nu.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(Dk(s))||t==="script"&&i.querySelector(Mk(s))||(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function S4e(e,t){Ph.m(e,t);var n=wx;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Fc(i)+'"][href="'+Fc(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ox(e)}if(!nu.has(s)&&(e=Xr({rel:"modulepreload",href:e},t),nu.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Mk(s)))return}i=n.createElement("link"),no(i,"link",e),Ia(i),n.head.appendChild(i)}}}function k4e(e,t,n){Ph.S(e,t,n);var i=wx;if(i&&e){var r=Qy(i).hoistableStyles,s=Rv(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(Dk(s)))l.loading=5;else{e=Xr({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nu.get(s))&&W9(e,n);var c=a=i.createElement("link");Ia(c),no(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Q2(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function E4e(e,t){Ph.X(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0},t),(t=nu.get(r))&&G9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function C4e(e,t){Ph.M(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0,type:"module"},t),(t=nu.get(r))&&G9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function VH(e,t,n,i){var r=(r=Hp.current)?x_(r):null;if(!r)throw Error(dt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Rv(n.href),n=Qy(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Rv(n.href);var s=Qy(r).hoistableStyles,a=s.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=r.querySelector(Dk(e)))&&!s._p&&(a.instance=s,a.state.loading=5),nu.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nu.set(e,n),s||T4e(r,e,n,a.state))),t&&i===null)throw Error(dt(528,""));return a}if(t&&i!==null)throw Error(dt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ox(n),n=Qy(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(dt(444,e))}}function Rv(e){return'href="'+Fc(e)+'"'}function Dk(e){return'link[rel="stylesheet"]['+e+"]"}function _me(e){return Xr({},e,{"data-precedence":e.precedence,precedence:null})}function T4e(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),no(t,"link",n),Ia(t),e.head.appendChild(t))}function Ox(e){return'[src="'+Fc(e)+'"]'}function Mk(e){return"script[async]"+e}function HH(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Fc(n.href)+'"]');if(i)return t.instance=i,Ia(i),i;var r=Xr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ia(i),no(i,"style",r),Q2(i,n.precedence,e),t.instance=i;case"stylesheet":r=Rv(n.href);var s=e.querySelector(Dk(r));if(s)return t.state.loading|=4,t.instance=s,Ia(s),s;i=_me(n),(r=nu.get(r))&&W9(i,r),s=(e.ownerDocument||e).createElement("link"),Ia(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),t.state.loading|=4,Q2(s,n.precedence,e),t.instance=s;case"script":return s=Ox(n.src),(r=e.querySelector(Mk(s)))?(t.instance=r,Ia(r),r):(i=n,(r=nu.get(s))&&(i=Xr({},n),G9(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ia(r),no(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(dt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Q2(i,n.precedence,e));return t.instance}function Q2(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,a=0;a title"):null)}function A4e(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 Nme(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function _4e(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Rv(i.href),s=t.querySelector(Dk(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=w_.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ia(s);return}s=t.ownerDocument||t,i=_me(i),(r=nu.get(r))&&W9(i,r),s=s.createElement("link"),Ia(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=w_.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var yD=0;function N4e(e,t){return e.stylesheets&&e.count===0&&V2(e,e.stylesheets),0yD?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function w_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)V2(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var O_=null;function V2(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,O_=new Map,t.forEach(j4e,e),O_=null,w_.call(e))}function j4e(e,t){if(!(t.state.loading&4)){var n=O_.get(e);if(n)var i=n.get(null);else{n=new Map,O_.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($me)}catch(e){console.error(e)}}$me(),qfe.exports=Sj;var F4e=qfe.exports;const B4e=px(F4e),J9=p.createContext({});function Uj(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qj=p.createContext(null),cS=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class U4e 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 Q4e({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(cS);return p.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=r.current;if(t||!i.current||!a||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -99,37 +99,37 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(B4e,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const Q4e=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=Uj(z4e),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(U4e,{isPresent:n,children:e})),o.jsx(Qj.Provider,{value:d,children:e})};function z4e(){return new Map}function $me(e=!0){const t=p.useContext(Qj);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const a=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const HC=e=>e.key||"";function eq(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const eF=typeof window<"u",Fme=eF?p.useLayoutEffect:p.useEffect,Ru=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=$me(a),u=p.useMemo(()=>eq(e),[e]),d=a&&!l?[]:u.map(HC),f=p.useRef(!0),h=p.useRef(u),m=Uj(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);Fme(()=>{f.current=!1,h.current=u;for(let w=0;w{const k=HC(w),S=a&&!l?!1:u===v||d.includes(k),E=()=>{if(m.has(k))m.set(k,!0);else return;let C=!0;m.forEach(N=>{N||(C=!1)}),C&&(O==null||O(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(Q4e,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:E,children:w},k)})})},ac=e=>e;let Bme=ac;const V4e={useManualTiming:!1};function H4e(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const qC=["read","resolveKeyframes","update","preRender","render","postRender"],q4e=40;function Ume(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=qC.reduce((y,x)=>(y[x]=H4e(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,q4e),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:qC.reduce((y,x)=>{const O=a[x];return y[x]=(w,k=!1,S=!1)=>(n||g(),O.schedule(w,k,S)),y},{}),cancel:y=>{for(let x=0;xtq[e].some(n=>!!t[n])};function W4e(e){for(const t in e)Pv[t]={...Pv[t],...e[t]}}const G4e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function E_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||G4e.has(e)}let zme=e=>!E_(e);function Vme(e){e&&(zme=t=>t.startsWith("on")?!E_(t):e(t))}try{Vme(require("@emotion/is-prop-valid").default)}catch{}function K4e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(zme(r)||n===!0&&E_(r)||!t&&!E_(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function X4e({children:e,isValidProp:t,...n}){t&&Vme(t),n={...p.useContext(cS),...n},n.isStatic=Uj(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(cS.Provider,{value:i,children:e})}function Y4e(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const zj=p.createContext({});function uS(e){return typeof e=="string"||Array.isArray(e)}function Vj(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const tF=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],nF=["initial",...tF];function Hj(e){return Vj(e.animate)||nF.some(t=>uS(e[t]))}function Hme(e){return!!(Hj(e)||e.variants)}function Z4e(e,t){if(Hj(e)){const{initial:n,animate:i}=e;return{initial:n===!1||uS(n)?n:void 0,animate:uS(i)?i:void 0}}return e.inherit!==!1?t:{}}function J4e(e){const{initial:t,animate:n}=Z4e(e,p.useContext(zj));return p.useMemo(()=>({initial:t,animate:n}),[nq(t),nq(n)])}function nq(e){return Array.isArray(e)?e.join(" "):e}const e6e=Symbol.for("motionComponentSymbol");function Sy(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function t6e(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):Sy(n)&&(n.current=i))},[t])}const iF=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),n6e="framerAppearId",qme="data-"+iF(n6e),{schedule:rF}=Ume(queueMicrotask,!1),Wme=p.createContext({});function i6e(e,t,n,i,r){var s,a;const{visualElement:l}=p.useContext(zj),c=p.useContext(Qme),u=p.useContext(Qj),d=p.useContext(cS).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(Wme);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&r6e(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[qme],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return Fme(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),rF.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 r6e(e,t,n,i){const{layoutId:r,layout:s,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gme(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Sy(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function Gme(e){if(e)return e.options.allowProjection!==!1?e.projection:Gme(e.parent)}function s6e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&W4e(e);function l(u,d){let f;const h={...p.useContext(cS),...u,layoutId:a6e(u)},{isStatic:m}=h,g=J4e(u),b=i(u,m);if(!m&&eF){o6e();const v=l6e(h);f=v.MeasureLayout,g.visualElement=i6e(r,b,h,t,v.ProjectionNode)}return o.jsxs(zj.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,t6e(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(a=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&a!==void 0?a:""})`}`;const c=p.forwardRef(l);return c[e6e]=r,c}function a6e({layoutId:e}){const t=p.useContext(J9).id;return t&&e!==void 0?t+"-"+e:e}function o6e(e,t){p.useContext(Qme).strict}function l6e(e){const{drag:t,layout:n}=Pv;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const c6e=["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 sF(e){return typeof e!="string"||e.includes("-")?!1:!!(c6e.indexOf(e)>-1||/[A-Z]/u.test(e))}function iq(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function aF(e,t,n,i){if(typeof t=="function"){const[r,s]=iq(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]=iq(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const K3=e=>Array.isArray(e),u6e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),d6e=e=>K3(e)?e[e.length-1]||0:e,mo=e=>!!(e&&e.getVelocity);function q2(e){const t=mo(e)?e.get():e;return u6e(t)?t.toValue():t}function f6e({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:h6e(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const Kme=e=>(t,n)=>{const i=p.useContext(zj),r=p.useContext(Qj),s=()=>f6e(e,t,i,r);return n?s():Uj(s)};function h6e(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=q2(s[h]);let{initial:a,animate:l}=e;const c=Hj(e),u=Hme(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Vj(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),Yme=Xme("--"),p6e=Xme("var(--"),oF=e=>p6e(e)?m6e.test(e.split("/*")[0].trim()):!1,m6e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zme=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vh=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},dS={...kx,transform:e=>vh(0,1,e)},WC={...kx,default:1},Lk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mp=Lk("deg"),Id=Lk("%"),Rn=Lk("px"),g6e=Lk("vh"),b6e=Lk("vw"),rq={...Id,parse:e=>Id.parse(e)/100,transform:e=>Id.transform(e*100)},y6e={borderWidth:Rn,borderTopWidth:Rn,borderRightWidth:Rn,borderBottomWidth:Rn,borderLeftWidth:Rn,borderRadius:Rn,radius:Rn,borderTopLeftRadius:Rn,borderTopRightRadius:Rn,borderBottomRightRadius:Rn,borderBottomLeftRadius:Rn,width:Rn,maxWidth:Rn,height:Rn,maxHeight:Rn,top:Rn,right:Rn,bottom:Rn,left:Rn,padding:Rn,paddingTop:Rn,paddingRight:Rn,paddingBottom:Rn,paddingLeft:Rn,margin:Rn,marginTop:Rn,marginRight:Rn,marginBottom:Rn,marginLeft:Rn,backgroundPositionX:Rn,backgroundPositionY:Rn},v6e={rotate:mp,rotateX:mp,rotateY:mp,rotateZ:mp,scale:WC,scaleX:WC,scaleY:WC,scaleZ:WC,skew:mp,skewX:mp,skewY:mp,distance:Rn,translateX:Rn,translateY:Rn,translateZ:Rn,x:Rn,y:Rn,z:Rn,perspective:Rn,transformPerspective:Rn,opacity:dS,originX:rq,originY:rq,originZ:Rn},sq={...kx,transform:Math.round},lF={...y6e,...v6e,zIndex:sq,size:Rn,fillOpacity:dS,strokeOpacity:dS,numOctaves:sq},x6e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},w6e=Sx.length;function O6e(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),Jme=()=>({...dF(),attrs:{}}),fF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ege(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 tge=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 nge(e,t,n,i){ege(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(tge.has(r)?r:iF(r),t.attrs[r])}const C_={};function T6e(e){Object.assign(C_,e)}function ige(e,{layout:t,layoutId:n}){return Hb.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!C_[e]||e==="opacity")}function hF(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(mo(r[a])||t.style&&mo(t.style[a])||ige(a,e)||((i=n==null?void 0:n.getValue(a))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function rge(e,t,n){const i=hF(e,t,n);for(const r in e)if(mo(e[r])||mo(t[r])){const s=Sx.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function A6e(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 oq=["x","y","width","height","cx","cy","r"],_6e={useVisualState:Kme({scrapeMotionValuesFromProps:rge,createRenderState:Jme,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Hb.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{A6e(n,i),Kr.render(()=>{uF(i,r,fF(n.tagName),e.transformTemplate),nge(n,i)})})}})},N6e={useVisualState:Kme({scrapeMotionValuesFromProps:hF,createRenderState:dF})};function sge(e,t,n){for(const i in t)!mo(t[i])&&!ige(i,n)&&(e[i]=t[i])}function j6e({transformTemplate:e},t){return p.useMemo(()=>{const n=dF();return cF(n,t,e),Object.assign({},n.vars,n.style)},[t])}function R6e(e,t){const n=e.style||{},i={};return sge(i,n,e),Object.assign(i,j6e(e,t)),i}function I6e(e,t){const n={},i=R6e(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 P6e(e,t,n,i){const r=p.useMemo(()=>{const s=Jme();return uF(s,t,fF(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};sge(s,e.style,e),r.style={...s,...r.style}}return r}function D6e(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(sF(n)?P6e:I6e)(i,s,a,n),u=K4e(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>mo(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function M6e(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...sF(i)?_6e:N6e,preloadedFeatures:e,useRender:D6e(r),createVisualElement:t,Component:i};return s6e(a)}}function age(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(W2===void 0&&Pd.set(qa.isProcessing||V4e.useManualTiming?qa.timestamp:performance.now()),W2),set:e=>{W2=e,queueMicrotask(L6e)}};function mF(e,t){e.indexOf(t)===-1&&e.push(t)}function gF(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class bF{constructor(){this.subscriptions=[]}add(t){return mF(this.subscriptions,t),()=>gF(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 F6e{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pd.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Pd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$6e(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 bF);const i=this.events[t].add(n);return t==="change"?()=>{i(),Kr.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Pd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>lq)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,lq);return lge(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fS(e,t){return new F6e(e,t)}function B6e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,fS(n))}function U6e(e,t){const n=qj(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=d6e(s[a]);B6e(e,a,l)}}function Q6e(e){return!!(mo(e)&&e.add)}function X3(e,t){const n=e.getValue("willChange");if(Q6e(n))return n.add(t)}function cge(e){return e.props[qme]}function yF(e){let t;return()=>(t===void 0&&(t=e()),t)}const z6e=yF(()=>window.ScrollTimeline!==void 0);class V6e{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(z6e()&&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 H6e extends V6e{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const th=e=>e*1e3,nh=e=>e/1e3;function vF(e){return typeof e=="function"}function cq(e,t){e.timeline=t,e.onfinish=null}const xF=e=>Array.isArray(e)&&typeof e[0]=="number",q6e={linearEasing:void 0};function W6e(e,t){const n=yF(e);return()=>{var i;return(i=q6e[t])!==null&&i!==void 0?i:n()}}const T_=W6e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dv=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},uge=(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})`,Y3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tw([0,.65,.55,1]),circOut:Tw([.55,0,1,.45]),backIn:Tw([.31,.01,.66,-.59]),backOut:Tw([.33,1.53,.69,.99])};function fge(e,t){if(e)return typeof e=="function"&&T_()?uge(e,t):xF(e)?Tw(e):Array.isArray(e)?e.map(n=>fge(n,t)||Y3.easeOut):Y3[e]}const hge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G6e=1e-7,K6e=12;function X6e(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=hge(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>G6e&&++lX6e(s,0,1,e,n);return s=>s===0||s===1?s:hge(r(s),t,i)}const pge=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mge=e=>t=>1-e(1-t),gge=$k(.33,1.53,.69,.99),wF=mge(gge),bge=pge(wF),yge=e=>(e*=2)<1?.5*wF(e):.5*(2-Math.pow(2,-10*(e-1))),OF=e=>1-Math.sin(Math.acos(e)),vge=mge(OF),xge=pge(OF),wge=e=>/^0[^.\s]+$/u.test(e);function Y6e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wge(e):!0}const hO=e=>Math.round(e*1e5)/1e5,SF=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Z6e(e){return e==null}const J6e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kF=(e,t)=>n=>!!(typeof n=="string"&&J6e.test(n)&&n.startsWith(e)||t&&!Z6e(n)&&Object.prototype.hasOwnProperty.call(n,t)),Oge=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(SF);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},e$e=e=>vh(0,255,e),xD={...kx,transform:e=>Math.round(e$e(e))},Pg={test:kF("rgb","red"),parse:Oge("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+xD.transform(e)+", "+xD.transform(t)+", "+xD.transform(n)+", "+hO(dS.transform(i))+")"};function t$e(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Z3={test:kF("#"),parse:t$e,transform:Pg.transform},ky={test:kF("hsl","hue"),parse:Oge("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Id.transform(hO(t))+", "+Id.transform(hO(n))+", "+hO(dS.transform(i))+")"},fo={test:e=>Pg.test(e)||Z3.test(e)||ky.test(e),parse:e=>Pg.test(e)?Pg.parse(e):ky.test(e)?ky.parse(e):Z3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pg.transform(e):ky.transform(e)},n$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function i$e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(SF))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(n$e))===null||n===void 0?void 0:n.length)||0)>0}const Sge="number",kge="color",r$e="var",s$e="var(",uq="${}",a$e=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(a$e,c=>(fo.test(c)?(i.color.push(s),r.push(kge),n.push(fo.parse(c))):c.startsWith(s$e)?(i.var.push(s),r.push(r$e),n.push(c)):(i.number.push(s),r.push(Sge),n.push(parseFloat(c))),++s,uq)).split(uq);return{values:n,split:l,indexes:i,types:r}}function Ege(e){return hS(e).values}function Cge(e){const{split:t,types:n}=hS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function l$e(e){const t=Ege(e);return Cge(e)(t.map(o$e))}const hm={test:i$e,parse:Ege,createTransformer:Cge,getAnimatableNone:l$e},c$e=new Set(["brightness","contrast","saturate","opacity"]);function u$e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(SF)||[];if(!i)return e;const r=n.replace(i,"");let s=c$e.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const d$e=/\b([a-z-]*)\(.*?\)/gu,J3={...hm,getAnimatableNone:e=>{const t=e.match(d$e);return t?t.map(u$e).join(" "):e}},f$e={...lF,color:fo,backgroundColor:fo,outlineColor:fo,fill:fo,stroke:fo,borderColor:fo,borderTopColor:fo,borderRightColor:fo,borderBottomColor:fo,borderLeftColor:fo,filter:J3,WebkitFilter:J3},EF=e=>f$e[e];function Tge(e,t){let n=EF(e);return n!==J3&&(n=hm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const h$e=new Set(["auto","none","0"]);function p$e(e,t,n){let i=0,r;for(;ie===kx||e===Rn,fq=(e,t)=>parseFloat(e.split(", ")[t]),hq=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return fq(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?fq(s[1],e):0}},m$e=new Set(["x","y","z"]),g$e=Sx.filter(e=>!m$e.has(e));function b$e(e){const t=[];return g$e.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Mv={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:hq(4,13),y:hq(5,14)};Mv.translateX=Mv.x;Mv.translateY=Mv.y;const tb=new Set;let e4=!1,t4=!1;function Age(){if(t4){const e=Array.from(tb).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=b$e(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,a])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}t4=!1,e4=!1,tb.forEach(e=>e.complete()),tb.clear()}function _ge(){tb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(t4=!0)})}function y$e(){_ge(),Age()}class CF{constructor(t,n,i,r,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tb.add(this),e4||(e4=!0,Kr.read(_ge),Kr.resolveKeyframes(Age))):(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),v$e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function x$e(e){const t=v$e.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function jge(e,t,n=1){const[i,r]=x$e(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return Nge(a)?parseFloat(a):a}return oF(r)?jge(r,t,n+1):r}const Rge=e=>t=>t.test(e),w$e={test:e=>e==="auto",parse:e=>e},Ige=[kx,Rn,Id,mp,b6e,g6e,w$e],pq=e=>Ige.find(Rge(e));class Pge extends CF{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 mq=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hm.test(e)||e==="0")&&!e.startsWith("url("));function O$e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Wj(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(k$e),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const E$e=40;class Dge{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Pd.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>E$e?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&y$e(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Pd.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!S$e(t,i,r,s))if(a)this.options.duration=0;else{c&&c(Wj(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const n4=2e4;function Mge(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=n4?1/0:t}const vs=(e,t,n)=>e+(t-e)*n;function wD(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function C$e({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,a=0;if(!t)r=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=wD(c,l,e+1/3),s=wD(c,l,e),a=wD(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function A_(e,t){return n=>n>0?t:e}const OD=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},T$e=[Z3,Pg,ky],A$e=e=>T$e.find(t=>t.test(e));function gq(e){const t=A$e(e);if(!t)return!1;let n=t.parse(e);return t===ky&&(n=C$e(n)),n}const bq=(e,t)=>{const n=gq(e),i=gq(t);if(!n||!i)return A_(e,t);const r={...n};return s=>(r.red=OD(n.red,i.red,s),r.green=OD(n.green,i.green,s),r.blue=OD(n.blue,i.blue,s),r.alpha=vs(n.alpha,i.alpha,s),Pg.transform(r))},_$e=(e,t)=>n=>t(e(n)),Fk=(...e)=>e.reduce(_$e),i4=new Set(["none","hidden"]);function N$e(e,t){return i4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function j$e(e,t){return n=>vs(e,t,n)}function TF(e){return typeof e=="number"?j$e:typeof e=="string"?oF(e)?A_:fo.test(e)?bq:P$e:Array.isArray(e)?Lge:typeof e=="object"?fo.test(e)?bq:R$e:A_}function Lge(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>TF(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function I$e(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=hm.createTransformer(t),i=hS(e),r=hS(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?i4.has(e)&&!r.values.length||i4.has(t)&&!i.values.length?N$e(e,t):Fk(Lge(I$e(i,r),r.values),n):A_(e,t)};function $ge(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vs(e,t,n):TF(e)(e,t)}const D$e=5;function Fge(e,t,n){const i=Math.max(t-D$e,0);return lge(n-e(i),t-i)}const Ss={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},SD=.001;function M$e({duration:e=Ss.duration,bounce:t=Ss.bounce,velocity:n=Ss.velocity,mass:i=Ss.mass}){let r,s,a=1-t;a=vh(Ss.minDamping,Ss.maxDamping,a),e=vh(Ss.minDuration,Ss.maxDuration,nh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,m=r4(u,a),g=Math.exp(-f);return SD-h/m*g},s=u=>{const f=u*a*e,h=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=r4(Math.pow(u,2),a);return(-r(u)+SD>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-SD+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=$$e(r,s,l);if(e=th(e),isNaN(c))return{stiffness:Ss.stiffness,damping:Ss.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const L$e=12;function $$e(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function U$e(e){let t={velocity:Ss.velocity,stiffness:Ss.stiffness,damping:Ss.damping,mass:Ss.mass,isResolvedFromDuration:!1,...e};if(!yq(e,B$e)&&yq(e,F$e))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*vh(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ss.mass,stiffness:r,damping:s}}else{const n=M$e(e);t={...t,...n,mass:Ss.mass},t.isResolvedFromDuration=!0}return t}function Bge(e=Ss.visualDuration,t=Ss.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=U$e({...n,velocity:-nh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=nh(Math.sqrt(c/d)),x=Math.abs(v)<5;i||(i=x?Ss.restSpeed.granular:Ss.restSpeed.default),r||(r=x?Ss.restDelta.granular:Ss.restDelta.default);let O;if(b<1){const k=r4(y,b);O=S=>{const E=Math.exp(-b*y*S);return a-E*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)O=k=>a-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);O=S=>{const E=Math.exp(-b*y*S),C=Math.min(k*S,300);return a-E*((g+b*y*v)*Math.sinh(C)+k*v*Math.cosh(C))/k}}const w={calculatedDuration:m&&f||null,next:k=>{const S=O(k);if(m)l.done=k>=f;else{let E=0;b<1&&(E=k===0?th(g):Fge(O,k,S));const C=Math.abs(E)<=i,N=Math.abs(a-S)<=r;l.done=C&&N}return l.value=l.done?a:S,l},toString:()=>{const k=Math.min(Mge(w),n4),S=uge(E=>w.next(k*E).value,k,30);return k+"ms "+S}};return w}function vq({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=C=>l!==void 0&&Cc,g=C=>l===void 0?c:c===void 0||Math.abs(l-C)-b*Math.exp(-C/i),O=C=>y+x(C),w=C=>{const N=x(C),_=O(C);h.done=Math.abs(N)<=u,h.value=h.done?y:_};let k,S;const E=C=>{m(h.value)&&(k=C,S=Bge({keyframes:[h.value,g(h.value)],velocity:Fge(O,C,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:C=>{let N=!1;return!S&&k===void 0&&(N=!0,w(C),E(C)),k!==void 0&&C>=k?S.next(C-k):(!N&&w(C),h)}}}const Q$e=$k(.42,0,1,1),z$e=$k(0,0,.58,1),Uge=$k(.42,0,.58,1),V$e=e=>Array.isArray(e)&&typeof e[0]!="number",H$e={linear:ac,easeIn:Q$e,easeInOut:Uge,easeOut:z$e,circIn:OF,circInOut:xge,circOut:vge,backIn:wF,backInOut:bge,backOut:gge,anticipate:yge},xq=e=>{if(xF(e)){Bme(e.length===4);const[t,n,i,r]=e;return $k(t,n,i,r)}else if(typeof e=="string")return H$e[e];return e};function q$e(e,t,n){const i=[],r=n||$ge,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=q$e(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(vh(e[0],e[s-1],d)):u}function G$e(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Dv(0,t,i);e.push(vs(n,1,r))}}function K$e(e){const t=[0];return G$e(t,e.length-1),t}function X$e(e,t){return e.map(n=>n*t)}function Y$e(e,t){return e.map(()=>t||Uge).splice(0,e.length-1)}function __({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=V$e(i)?i.map(xq):xq(i),s={done:!1,value:t[0]},a=X$e(n&&n.length===t.length?n:K$e(t),e),l=W$e(a,t,{ease:Array.isArray(r)?r:Y$e(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const Z$e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Kr.update(t,!0),stop:()=>fm(t),now:()=>qa.isProcessing?qa.timestamp:Pd.now()}},J$e={decay:vq,inertia:vq,tween:__,keyframes:__,spring:Bge},e8e=e=>e/100;class AF extends Dge{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,a=(r==null?void 0:r.KeyframeResolver)||CF,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:a=0}=this.options,l=vF(n)?n:J$e[n]||__;let c,u;l!==__&&typeof t[0]!="number"&&(c=Fk(e8e,$ge(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Mge(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:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let O=this.currentTime,w=s;if(m){const C=Math.min(this.currentTime,d)/f;let N=Math.floor(C),_=C%1;!_&&C>=1&&(_=1),_===1&&N--,N=Math.min(N,m+1),!!(N%2)&&(g==="reverse"?(_=1-_,b&&(_-=b/f)):g==="mirror"&&(w=a)),O=vh(0,1,_)*f}const k=x?{done:!1,value:c[0]}:w.next(O);l&&(k.value=l(k.value));let{done:S}=k;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&r!==void 0&&(k.value=Wj(c,this.options,r)),v&&v(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nh(t.calculatedDuration):0}get time(){return nh(this.currentTime)}set time(t){t=th(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Z$e,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const t8e=new Set(["opacity","clipPath","filter","transform"]);function n8e(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=fge(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const i8e=yF(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),N_=10,r8e=2e4;function s8e(e){return vF(e.type)||e.type==="spring"||!dge(e.ease)}function a8e(e,t){const n=new AF({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(a,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&T_()&&o8e(s)&&(s=Qge[s]),s8e(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=a8e(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,a="keyframes"}const d=n8e(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(cq(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Wj(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=th(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return ac;const{animation:i}=n;cq(i,t)}return ac}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new AF({...m,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=th(this.time);u.setWithVelocity(g.sample(b-N_).value,g.sample(b).value,N_)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return i8e()&&i&&t8e.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const l8e={type:"spring",stiffness:500,damping:25,restSpeed:10},c8e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),u8e={type:"keyframes",duration:.8},d8e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},f8e=(e,{keyframes:t})=>t.length>2?u8e:Hb.has(e)?e.startsWith("scale")?c8e(t[1]):l8e:d8e;function h8e({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const _F=(e,t,n,i={},r,s)=>a=>{const l=pF(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-th(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};h8e(l)||(d={...d,...f8e(e,d)}),d.duration&&(d.duration=th(d.duration)),d.repeatDelay&&(d.repeatDelay=th(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=Wj(d.keyframes,l);if(h!==void 0)return Kr.update(()=>{d.onUpdate(h),d.onComplete()}),new H6e([])}return!s&&wq.supports(d)?new wq(d):new AF(d)};function p8e({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function zge(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(a=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&p8e(d,f))continue;const g={delay:n,...pF(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=cge(e);if(y){const x=window.MotionHandoffAnimation(y,f,Kr);x!==null&&(g.startTime=x,b=!0)}}X3(e,f),h.start(_F(f,h,m,e.shouldReduceMotion&&oge.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Kr.update(()=>{l&&U6e(e,l)})}),u}function s4(e,t,n={}){var i;const r=qj(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(zge(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return m8e(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function m8e(e,t,n=0,i=0,r=1,s){const a=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(g8e).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(s4(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function g8e(e,t){return e.sortNodePosition(t)}function b8e(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>s4(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=s4(e,t,n);else{const r=typeof t=="function"?qj(e,t,n.custom):t;i=Promise.all(zge(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const y8e=nF.length;function Vge(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Vge(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})=>b8e(e,n,i)))}function O8e(e){let t=w8e(e),n=Oq(),i=!0;const r=c=>(u,d)=>{var f;const h=qj(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=Vge(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&w,N=!1;const _=Array.isArray(O)?O:[O];let j=_.reduce(r(y),{});k===!1&&(j={});const{prevResolvedValues:A={}}=x,F={...A,...j},T=L=>{C=!0,h.has(L)&&(N=!0,h.delete(L)),x.needsAnimating[L]=!0;const M=e.getValue(L);M&&(M.liveStyle=!1)};for(const L in F){const M=j[L],U=A[L];if(m.hasOwnProperty(L))continue;let I=!1;K3(M)&&K3(U)?I=!age(M,U):I=M!==U,I?M!=null?T(L):h.add(L):M!==void 0&&h.has(L)?T(L):x.protectedKeys[L]=!0}x.prevProp=O,x.prevResolvedValues=j,x.isActive&&(m={...m,...j}),i&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&E)||N)&&f.push(..._.map(L=>({animation:L,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),O=e.getValue(y);O&&(O.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Oq(),i=!0}}}function S8e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!age(t,e):!1}function eg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Oq(){return{animate:eg(!0),whileInView:eg(),whileHover:eg(),whileTap:eg(),whileDrag:eg(),whileFocus:eg(),exit:eg()}}class Mm{constructor(t){this.isMounted=!1,this.node=t}update(){}}class k8e extends Mm{constructor(t){super(t),t.animationState||(t.animationState=O8e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vj(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let E8e=0;class C8e extends Mm{constructor(){super(...arguments),this.id=E8e++}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 T8e={animation:{Feature:k8e},exit:{Feature:C8e}},vu={x:!1,y:!1};function Hge(){return vu.x||vu.y}function A8e(e){return e==="x"||e==="y"?vu[e]?null:(vu[e]=!0,()=>{vu[e]=!1}):vu.x||vu.y?null:(vu.x=vu.y=!0,()=>{vu.x=vu.y=!1})}const NF=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function pS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Bk(e){return{point:{x:e.pageX,y:e.pageY}}}const _8e=e=>t=>NF(t)&&e(t,Bk(t));function pO(e,t,n,i){return pS(e,t,_8e(n),i)}const Sq=(e,t)=>Math.abs(e-t);function N8e(e,t){const n=Sq(e.x,t.x),i=Sq(e.y,t.y);return Math.sqrt(n**2+i**2)}class qge{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=ED(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=N8e(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=qa;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=kD(h,this.transformPagePoint),Kr.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=ED(f.type==="pointercancel"?this.lastMoveEventInfo:kD(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!NF(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=Bk(t),l=kD(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qa;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,ED(l,this.history)),this.removeListeners=Fk(pO(this.contextWindow,"pointermove",this.handlePointerMove),pO(this.contextWindow,"pointerup",this.handlePointerUp),pO(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fm(this.updatePoint)}}function kD(e,t){return t?{point:t(e.point)}:e}function kq(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ED({point:e},t){return{point:e,delta:kq(e,Wge(t)),offset:kq(e,j8e(t)),velocity:R8e(t,.1)}}function j8e(e){return e[0]}function Wge(e){return e[e.length-1]}function R8e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=Wge(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>th(t)));)n--;if(!i)return{x:0,y:0};const s=nh(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Gge=1e-4,I8e=1-Gge,P8e=1+Gge,Kge=.01,D8e=0-Kge,M8e=0+Kge;function fc(e){return e.max-e.min}function L8e(e,t,n){return Math.abs(e-t)<=n}function Eq(e,t,n,i=.5){e.origin=i,e.originPoint=vs(t.min,t.max,e.origin),e.scale=fc(n)/fc(t),e.translate=vs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=I8e&&e.scale<=P8e||isNaN(e.scale))&&(e.scale=1),(e.translate>=D8e&&e.translate<=M8e||isNaN(e.translate))&&(e.translate=0)}function mO(e,t,n,i){Eq(e.x,t.x,n.x,i?i.originX:void 0),Eq(e.y,t.y,n.y,i?i.originY:void 0)}function Cq(e,t,n){e.min=n.min+t.min,e.max=e.min+fc(t)}function $8e(e,t,n){Cq(e.x,t.x,n.x),Cq(e.y,t.y,n.y)}function Tq(e,t,n){e.min=t.min-n.min,e.max=e.min+fc(t)}function gO(e,t,n){Tq(e.x,t.x,n.x),Tq(e.y,t.y,n.y)}function F8e(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?vs(n,e,i.max):Math.min(e,n)),e}function Aq(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 B8e(e,{top:t,left:n,bottom:i,right:r}){return{x:Aq(e.x,n,r),y:Aq(e.y,t,i)}}function _q(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Dv(t.min,t.max-i,e.min):i>r&&(n=Dv(e.min,e.max-r,t.min)),vh(0,1,n)}function z8e(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 a4=.35;function V8e(e=a4){return e===!1?e=0:e===!0&&(e=a4),{x:Nq(e,"left","right"),y:Nq(e,"top","bottom")}}function Nq(e,t,n){return{min:jq(e,t),max:jq(e,n)}}function jq(e,t){return typeof e=="number"?e:e[t]||0}const Rq=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ey=()=>({x:Rq(),y:Rq()}),Iq=()=>({min:0,max:0}),Rs=()=>({x:Iq(),y:Iq()});function Rc(e){return[e("x"),e("y")]}function Xge({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function H8e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function q8e(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 CD(e){return e===void 0||e===1}function o4({scale:e,scaleX:t,scaleY:n}){return!CD(e)||!CD(t)||!CD(n)}function bg(e){return o4(e)||Yge(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yge(e){return Pq(e.x)||Pq(e.y)}function Pq(e){return e&&e!=="0%"}function j_(e,t,n){const i=e-n,r=t*i;return n+r}function Dq(e,t,n,i,r){return r!==void 0&&(e=j_(e,r,i)),j_(e,n,i)+t}function l4(e,t=0,n=1,i,r){e.min=Dq(e.min,t,n,i,r),e.max=Dq(e.max,t,n,i,r)}function Zge(e,{x:t,y:n}){l4(e.x,t.translate,t.scale,t.originPoint),l4(e.y,n.translate,n.scale,n.originPoint)}const Mq=.999999999999,Lq=1.0000000000001;function W8e(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lMq&&(t.x=1),t.yMq&&(t.y=1)}function Cy(e,t){e.min=e.min+t,e.max=e.max+t}function $q(e,t,n,i,r=.5){const s=vs(e.min,e.max,r);l4(e,t,n,s,i)}function Ty(e,t){$q(e.x,t.x,t.scaleX,t.scale,t.originX),$q(e.y,t.y,t.scaleY,t.scale,t.originY)}function Jge(e,t){return Xge(q8e(e.getBoundingClientRect(),t))}function G8e(e,t,n){const i=Jge(e,n),{scroll:r}=t;return r&&(Cy(i.x,r.offset.x),Cy(i.y,r.offset.y)),i}const ebe=({current:e})=>e?e.ownerDocument.defaultView:null,K8e=new WeakMap;class X8e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Rs(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bk(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=A8e(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rc(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Id.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const O=x.layout.layoutBox[v];O&&(y=fc(O)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Kr.postRender(()=>g(d,f)),X3(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=Y8e(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Rc(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new qge(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ebe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Kr.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!GC(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=F8e(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Sy(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=B8e(r.layoutBox,n):this.constraints=!1,this.elastic=V8e(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=z8e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Sy(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=G8e(i,r.root,this.visualElement.getTransformPagePoint());let a=U8e(r.layout.layoutBox,s);if(n){const l=n(H8e(a));this.hasMutatedConstraints=!!l,l&&(a=Xge(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Rc(d=>{if(!GC(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,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 X3(this.visualElement,t),i.start(_F(t,i,0,n,this.visualElement,!1))}stopAnimation(){Rc(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Rc(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Rc(n=>{const{drag:i}=this.getProps();if(!GC(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];s.set(t[n]-vs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sy(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Rc(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=Q8e({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rc(a=>{if(!GC(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(vs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;K8e.set(this.visualElement,this);const t=this.visualElement.current,n=pO(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Sy(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Kr.read(i);const a=pS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Rc(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:a=a4,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function GC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Y8e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Z8e extends Mm{constructor(t){super(t),this.removeGroupControls=ac,this.removeListeners=ac,this.controls=new X8e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ac}unmount(){this.removeGroupControls(),this.removeListeners()}}const Fq=e=>(t,n)=>{e&&Kr.postRender(()=>e(t,n))};class J8e extends Mm{constructor(){super(...arguments),this.removePointerDownListener=ac}onPointerDown(t){this.session=new qge(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ebe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Fq(t),onStart:Fq(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&Kr.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=pO(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const G2={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Bq(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const D1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Rn.test(e))e=parseFloat(e);else return e;const n=Bq(e,t.target.x),i=Bq(e,t.target.y);return`${n}% ${i}%`}},e9e={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=hm.parse(e);if(r.length>5)return i;const s=hm.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=vs(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),s(r)}};class t9e extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;T6e(n9e),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),G2.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,a=i.projection;return a&&(a.isPresent=s,r||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Kr.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),rF.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 tbe(e){const[t,n]=$me(),i=p.useContext(J9);return o.jsx(t9e,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(Wme),isPresent:t,safeToRemove:n})}const n9e={borderRadius:{...D1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:D1,borderTopRightRadius:D1,borderBottomLeftRadius:D1,borderBottomRightRadius:D1,boxShadow:e9e};function i9e(e,t,n){const i=mo(e)?e:fS(e);return i.start(_F("",i,t,n)),i.animation}function r9e(e){return e instanceof SVGElement&&e.tagName!=="svg"}const s9e=(e,t)=>e.depth-t.depth;class a9e{constructor(){this.children=[],this.isDirty=!1}add(t){mF(this.children,t),this.isDirty=!0}remove(t){gF(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(s9e),this.isDirty=!1,this.children.forEach(t)}}function o9e(e,t){const n=Pd.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(fm(i),e(s-t))};return Kr.read(i,!0),()=>fm(i)}const nbe=["TopLeft","TopRight","BottomLeft","BottomRight"],l9e=nbe.length,Uq=e=>typeof e=="string"?parseFloat(e):e,Qq=e=>typeof e=="number"||Rn.test(e);function c9e(e,t,n,i,r,s){r?(e.opacity=vs(0,n.opacity!==void 0?n.opacity:1,u9e(i)),e.opacityExit=vs(t.opacity!==void 0?t.opacity:1,0,d9e(i))):s&&(e.opacity=vs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(Dv(e,t,i))}function Vq(e,t){e.min=t.min,e.max=t.max}function jc(e,t){Vq(e.x,t.x),Vq(e.y,t.y)}function Hq(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function qq(e,t,n,i,r){return e-=t,e=j_(e,1/n,i),r!==void 0&&(e=j_(e,1/r,i)),e}function f9e(e,t=0,n=1,i=.5,r,s=e,a=e){if(Id.test(t)&&(t=parseFloat(t),t=vs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=vs(s.min,s.max,i);e===s&&(l-=t),e.min=qq(e.min,t,n,l,r),e.max=qq(e.max,t,n,l,r)}function Wq(e,t,[n,i,r],s,a){f9e(e,t[n],t[i],t[r],t.scale,s,a)}const h9e=["x","scaleX","originX"],p9e=["y","scaleY","originY"];function Gq(e,t,n,i){Wq(e.x,t,h9e,n?n.x:void 0,i?i.x:void 0),Wq(e.y,t,p9e,n?n.y:void 0,i?i.y:void 0)}function Kq(e){return e.translate===0&&e.scale===1}function rbe(e){return Kq(e.x)&&Kq(e.y)}function Xq(e,t){return e.min===t.min&&e.max===t.max}function m9e(e,t){return Xq(e.x,t.x)&&Xq(e.y,t.y)}function Yq(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sbe(e,t){return Yq(e.x,t.x)&&Yq(e.y,t.y)}function Zq(e){return fc(e.x)/fc(e.y)}function Jq(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class g9e{constructor(){this.members=[]}add(t){mF(this.members,t),t.scheduleRender()}remove(t){if(gF(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 b9e(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||s||a)&&(i=`translate3d(${r}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const yg={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Aw=typeof window<"u"&&window.MotionDebug!==void 0,TD=["","X","Y","Z"],y9e={visibility:"hidden"},eW=1e3;let v9e=0;function AD(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function abe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=cge(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Kr,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&abe(i)}function obe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=v9e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Aw&&(yg.totalNodes=yg.resolvedTargetDeltas=yg.recalculatedProjection=0),this.nodes.forEach(O9e),this.nodes.forEach(T9e),this.nodes.forEach(A9e),this.nodes.forEach(S9e),Aw&&window.MotionDebug.record(yg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=o9e(h,250),G2.hasAnimatedSinceResize&&(G2.hasAnimatedSinceResize=!1,this.nodes.forEach(nW))})}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()||I9e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!sbe(this.targetLayout,g)||m,O=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,O);const w={...pF(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||nW(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fm(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_9e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&abe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=w/1e3;iW(f.x,a.x,k),iW(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gO(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),j9e(this.relativeTarget,this.relativeTargetOrigin,h,k),O&&m9e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Rs()),jc(O,this.relativeTarget)),b&&(this.animationValues=d,c9e(d,u,this.latestValues,k,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kr.update(()=>{G2.hasAnimatedSinceResize=!0,this.currentAnimation=i9e(0,eW,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eW),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&lbe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Rs();const f=fc(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=fc(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}jc(l,c),Ty(l,d),mO(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new g9e),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&AD("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(tW),this.root.sharedNodes.clear()}}}function x9e(e){e.updateLayout()}function w9e(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=fc(h);h.min=i[f].min,h.max=h.min+m}):lbe(s,n.layoutBox,i)&&Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=fc(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=Ey();mO(l,i,n.layoutBox);const c=Ey();a?mO(c,e.applyTransform(r,!0),n.measuredBox):mO(c,i,n.layoutBox);const u=!rbe(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=Rs();gO(g,n.layoutBox,h.layoutBox);const b=Rs();gO(b,i,m.layoutBox),sbe(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 O9e(e){Aw&&yg.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function S9e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function k9e(e){e.clearSnapshot()}function tW(e){e.clearMeasurements()}function E9e(e){e.isLayoutDirty=!1}function C9e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nW(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function T9e(e){e.resolveTargetDelta()}function A9e(e){e.calcProjection()}function _9e(e){e.resetSkewAndRotation()}function N9e(e){e.removeLeadSnapshot()}function iW(e,t,n){e.translate=vs(t.translate,0,n),e.scale=vs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rW(e,t,n,i){e.min=vs(t.min,n.min,i),e.max=vs(t.max,n.max,i)}function j9e(e,t,n,i){rW(e.x,t.x,n.x,i),rW(e.y,t.y,n.y,i)}function R9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const I9e={duration:.45,ease:[.4,0,.1,1]},sW=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aW=sW("applewebkit/")&&!sW("chrome/")?Math.round:ac;function oW(e){e.min=aW(e.min),e.max=aW(e.max)}function P9e(e){oW(e.x),oW(e.y)}function lbe(e,t,n){return e==="position"||e==="preserve-aspect"&&!L8e(Zq(t),Zq(n),.2)}function D9e(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const M9e=obe({attachResizeListener:(e,t)=>pS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_D={current:void 0},cbe=obe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_D.current){const e=new M9e({});e.mount(window),e.setOptions({layoutScroll:!0}),_D.current=e}return _D.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),L9e={pan:{Feature:J8e},drag:{Feature:Z8e,ProjectionNode:cbe,MeasureLayout:tbe}};function $9e(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 ube(e,t){const n=$9e(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function lW(e){return t=>{t.pointerType==="touch"||Hge()||e(t)}}function F9e(e,t,n={}){const[i,r,s]=ube(e,n),a=lW(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=lW(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function cW(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class B9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=F9e(t,n=>(cW(this.node,n,"Start"),i=>cW(this.node,i,"End"))))}unmount(){}}class U9e extends Mm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fk(pS(this.node.current,"focus",()=>this.onFocus()),pS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dbe=(e,t)=>t?e===t?!0:dbe(e,t.parentElement):!1,Q9e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function z9e(e){return Q9e.has(e.tagName)||e.tabIndex!==-1}const _w=new WeakSet;function uW(e){return t=>{t.key==="Enter"&&e(t)}}function ND(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const V9e=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=uW(()=>{if(_w.has(n))return;ND(n,"down");const r=uW(()=>{ND(n,"up")}),s=()=>ND(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 dW(e){return NF(e)&&!Hge()}function H9e(e,t,n={}){const[i,r,s]=ube(e,n),a=l=>{const c=l.currentTarget;if(!dW(l)||_w.has(c))return;_w.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!dW(m)||!_w.has(c))&&(_w.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||dbe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!z9e(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>V9e(u,r),r)}),s}function fW(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class q9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=H9e(t,n=>(fW(this.node,n,"Start"),(i,{success:r})=>fW(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const c4=new WeakMap,jD=new WeakMap,W9e=e=>{const t=c4.get(e.target);t&&t(e)},G9e=e=>{e.forEach(W9e)};function K9e({root:e,...t}){const n=e||document;jD.has(n)||jD.set(n,{});const i=jD.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(G9e,{root:e,...t})),i[r]}function X9e(e,t,n){const i=K9e(t);return c4.set(e,n),i.observe(e),()=>{c4.delete(e),i.unobserve(e)}}const Y9e={some:0,all:1};class Z9e extends Mm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Y9e[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 X9e(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(J9e(t,n))&&this.startObserver()}unmount(){}}function J9e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const eFe={inView:{Feature:Z9e},tap:{Feature:q9e},focus:{Feature:U9e},hover:{Feature:B9e}},tFe={layout:{ProjectionNode:cbe,MeasureLayout:tbe}},R_={current:null},jF={current:!1};function fbe(){if(jF.current=!0,!!eF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R_.current=e.matches;e.addListener(t),t()}else R_.current=!1}const nFe=[...Ige,fo,hm],iFe=e=>nFe.find(Rge(e)),hW=new WeakMap;function rFe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(mo(r))e.addValue(i,r);else if(mo(s))e.addValue(i,fS(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(i);e.addValue(i,fS(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const pW=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class sFe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=CF,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=Pd.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),jF.current||fbe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:R_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hW.delete(this.current),this.projection&&this.projection.unmount(),fm(this.notifyUpdate),fm(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Hb.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Kr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Pv){const n=Pv[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rs()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=fS(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Nge(r)||wge(r))?r=parseFloat(r):!iFe(r)&&hm.test(n)&&(r=Tge(t,n)),this.setBaseTarget(t,mo(r)?r.get():r)),mo(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const a=aF(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(r=a[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mo(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new bF),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hbe extends sFe{constructor(){super(...arguments),this.KeyframeResolver=Pge}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function aFe(e){return window.getComputedStyle(e)}class oFe extends hbe{constructor(){super(...arguments),this.type="html",this.renderInstance=ege}readValueFromInstance(t,n){if(Hb.has(n)){const i=EF(n);return i&&i.default||0}else{const i=aFe(t),r=(Yme(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Jge(t,n)}build(t,n,i){cF(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return hF(t,n,i)}}class lFe extends hbe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Rs}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Hb.has(n)){const i=EF(n);return i&&i.default||0}return n=tge.has(n)?n:iF(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return rge(t,n,i)}build(t,n,i){uF(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){nge(t,n,i,r)}mount(t){this.isSVGTag=fF(t.tagName),super.mount(t)}}const cFe=(e,t)=>sF(e)?new lFe(t):new oFe(t,{allowProjection:e!==p.Fragment}),uFe=M6e({...T8e,...eFe,...L9e,...tFe},cFe),pr=Y4e(uFe);function RF(){!jF.current&&fbe();const[e]=p.useState(R_.current);return e}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function J0(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 dFe=["container"];function fFe(e){var t=e.container,n=t===void 0?document.body:t,i=Gj(e,dFe);return Li.createPortal(ii.createElement("div",pa({},i)),n)}function hFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function pFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function mFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function gFe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function gW(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,a=r.clientY;return[(n+s)/2,(i+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-i,2))]}return[n,i,0]}var wp=function(e,t,n,i){var r,s=n*t,a=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&a-e<=0?(r=2,l=a):e<0&&a+e<=0&&(r=3,l=-a),[r,l]};function RD(e,t,n,i,r,s,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=wp(e,s,n,innerWidth)[0],f=wp(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:a-s/r*(a-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:a,lastCY:l}}function f4(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function ID(e,t,n){var i=f4(n,innerWidth,innerHeight),r=i[0],s=i[1],a=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?a=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function XC(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,a=s===void 0?r||0:s,l=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 yFe={T:0,L:0,W:0,H:0,FIT:void 0},mbe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},vFe=["className"];function xFe(e){var t=e.className,n=t===void 0?"":t,i=Gj(e,vFe);return ii.createElement("div",pa({className:"PhotoView__Spinner "+n},i),ii.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ii.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ii.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var wFe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function OFe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=Gj(e,wFe),u=mbe();return t&&!i?ii.createElement(ii.Fragment,null,ii.createElement("img",pa({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?ii.createElement("span",{className:"PhotoView__icon"},a):ii.createElement(xFe,{className:"PhotoView__icon"}))):l?ii.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var SFe={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 kFe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,a=t.height,l=a===void 0?0:a,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,O=e.onReachMove,w=e.onReachUp,k=e.onPhotoResize,S=e.isActive,E=e.expose,C=I_(SFe),N=C[0],_=C[1],j=p.useRef(0),A=mbe(),F=N.naturalWidth,T=F===void 0?s:F,P=N.naturalHeight,R=P===void 0?l:P,L=N.width,M=L===void 0?s:L,U=N.height,I=U===void 0?l:U,H=N.loaded,K=H===void 0?!n:H,Q=N.broken,q=N.x,B=N.y,ee=N.touched,le=N.stopRaf,se=N.maskTouched,re=N.rotate,ge=N.scale,W=N.CX,X=N.CY,ae=N.lastX,ue=N.lastY,Oe=N.lastCX,ke=N.lastCY,st=N.lastScale,Le=N.touchTime,Me=N.touchLength,Ie=N.pause,qe=N.reach,Ae=nb({onScale:function(Pe){return ze(KC(Pe))},onRotate:function(Pe){re!==Pe&&(E({rotate:Pe}),_(pa({rotate:Pe},ID(T,R,Pe))))}});function ze(Pe,Et,bt){ge!==Pe&&(E({scale:Pe}),_(pa({scale:Pe},RD(q,B,M,I,ge,Pe,Et,bt),Pe<=1&&{x:0,y:0})))}var Ee=XC(function(Pe,Et,bt){if(bt===void 0&&(bt=0),(ee||se)&&S){var Mt=f4(re,M,I),$e=Mt[0],ye=Mt[1];if(bt===0&&j.current===0){var Ue=Math.abs(Pe-W)<=20,Ke=Math.abs(Et-X)<=20;if(Ue&&Ke)return void _({lastCX:Pe,lastCY:Et});j.current=Ue?Et>X?3:2:1}var ft,ut=Pe-Oe,Gt=Et-ke;if(bt===0){var Rt=wp(ut+ae,ge,$e,innerWidth)[0],zt=wp(Gt+ue,ge,ye,innerHeight);ft=function(Bt,Qe,tt,ht){return Qe&&Bt===1||ht==="x"?"x":tt&&Bt>1||ht==="y"?"y":void 0}(j.current,Rt,zt[0],qe),ft!==void 0&&O(ft,Pe,Et,ge)}if(ft==="x"||se)return void _({reach:"x"});var Z=KC(ge+(bt-Me)/100/2*ge,T/M,.2);E({scale:Z}),_(pa({touchLength:bt,reach:ft,scale:Z},RD(q,B,M,I,ge,Z,Pe,Et,ut,Gt)))}},{maxWait:8});function De(Pe){return!le&&!ee&&(A.current&&_(pa({},Pe,{pause:u})),A.current)}var J,he,_e,Ze,at,wt,Se,ve,He=(at=function(Pe){return De({x:Pe})},wt=function(Pe){return De({y:Pe})},Se=function(Pe){return A.current&&(E({scale:Pe}),_({scale:Pe})),!ee&&A.current},ve=nb({X:function(Pe){return at(Pe)},Y:function(Pe){return wt(Pe)},S:function(Pe){return Se(Pe)}}),function(Pe,Et,bt,Mt,$e,ye,Ue,Ke,ft,ut,Gt){var Rt=f4(ut,$e,ye),zt=Rt[0],Z=Rt[1],Bt=wp(Pe,Ke,zt,innerWidth),Qe=Bt[0],tt=Bt[1],ht=wp(Et,Ke,Z,innerHeight),pe=ht[0],We=ht[1],vt=Date.now()-Gt;if(vt>=200||Ke!==Ue||Math.abs(ft-Ue)>1){var vn=RD(Pe,Et,$e,ye,Ue,Ke),Ki=vn.x,Fe=vn.y,Pt=Qe?tt:Ki!==Pe?Ki:null,pn=pe?We:Fe!==Et?Fe:null;return Pt!==null&&Cg(Pe,Pt,ve.X),pn!==null&&Cg(Et,pn,ve.Y),void(Ke!==Ue&&Cg(Ue,Ke,ve.S))}var Jt=(Pe-bt)/vt,en=(Et-Mt)/vt,Un=Math.sqrt(Math.pow(Jt,2)+Math.pow(en,2)),wn=!1,oi=!1;(function(Oi,mi){var bn,qi=Oi,ri=0,zi=0,as=function(xs){bn||(bn=xs);var os=xs-bn,ia=Math.sign(Oi),Nr=-.001*ia,As=Math.sign(-qi)*Math.pow(qi,2)*2e-4,Vs=qi*os+(Nr+As)*Math.pow(os,2)/2;ri+=Vs,bn=xs,ia*(qi+=(Nr+As)*os)<=0?_r():mi(ri)?Lr():_r()};function Lr(){zi=requestAnimationFrame(as)}function _r(){cancelAnimationFrame(zi)}Lr()})(Un,function(Oi){var mi=Pe+Oi*(Jt/Un),bn=Et+Oi*(en/Un),qi=wp(mi,Ue,zt,innerWidth),ri=qi[0],zi=qi[1],as=wp(bn,Ue,Z,innerHeight),Lr=as[0],_r=as[1];if(ri&&!wn&&(wn=!0,Qe?Cg(mi,zi,ve.X):bW(zi,mi+(mi-zi),ve.X)),Lr&&!oi&&(oi=!0,pe?Cg(bn,_r,ve.Y):bW(_r,bn+(bn-_r),ve.Y)),wn&&oi)return!1;var xs=wn||ve.X(zi),os=oi||ve.Y(_r);return xs&&os})}),Je=(J=y,he=function(Pe,Et){qe||ze(ge!==1?1:Math.max(2,T/M),Pe,Et)},_e=p.useRef(0),Ze=XC(function(){_e.current=0,J.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Pe=[].slice.call(arguments);_e.current+=1,Ze.apply(void 0,Pe),_e.current>=2&&(Ze.cancel(),_e.current=0,he.apply(void 0,Pe))});function Ce(Pe,Et){if(j.current=0,(ee||se)&&S){_({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var bt=KC(ge,T/M);if(He(q,B,ae,ue,M,I,ge,bt,st,re,Le),w(Pe,Et),W===Pe&&X===Et){if(ee)return void Je(Pe,Et);se&&x(Pe,Et)}}}function Wt(Pe,Et,bt){bt===void 0&&(bt=0),_({touched:!0,CX:Pe,CY:Et,lastCX:Pe,lastCY:Et,lastX:q,lastY:B,lastScale:ge,touchLength:bt,touchTime:Date.now()})}function ln(Pe){_({maskTouched:!0,CX:Pe.clientX,CY:Pe.clientY,lastX:q,lastY:B})}J0(Ef?void 0:"mousemove",function(Pe){Pe.preventDefault(),Ee(Pe.clientX,Pe.clientY)}),J0(Ef?void 0:"mouseup",function(Pe){Ce(Pe.clientX,Pe.clientY)}),J0(Ef?"touchmove":void 0,function(Pe){Pe.preventDefault();var Et=gW(Pe);Ee.apply(void 0,Et)},{passive:!1}),J0(Ef?"touchend":void 0,function(Pe){var Et=Pe.changedTouches[0];Ce(Et.clientX,Et.clientY)},{passive:!1}),J0("resize",XC(function(){K&&!ee&&(_(ID(T,R,re)),k())},{maxWait:8})),d4(function(){S&&E(pa({scale:ge,rotate:re},Ae))},[S]);var cn=function(Pe,Et,bt,Mt,$e,ye,Ue,Ke,ft,ut){var Gt=function(Ki,Fe,Pt,pn,Jt){var en=p.useRef(!1),Un=I_({lead:!0,scale:Pt}),wn=Un[0],oi=wn.lead,Oi=wn.scale,mi=Un[1],bn=XC(function(qi){try{return Jt(!0),mi({lead:!1,scale:qi}),Promise.resolve()}catch(ri){return Promise.reject(ri)}},{wait:pn});return d4(function(){en.current?(Jt(!1),mi({lead:!0}),bn(Pt)):en.current=!0},[Pt]),oi?[Ki*Oi,Fe*Oi,Pt/Oi]:[Ki*Pt,Fe*Pt,1]}(ye,Ue,Ke,ft,ut),Rt=Gt[0],zt=Gt[1],Z=Gt[2],Bt=function(Ki,Fe,Pt,pn,Jt){var en=p.useState(yFe),Un=en[0],wn=en[1],oi=p.useState(0),Oi=oi[0],mi=oi[1],bn=p.useRef(),qi=nb({OK:function(){return Ki&&mi(4)}});function ri(zi){Jt(!1),mi(zi)}return p.useEffect(function(){if(bn.current||(bn.current=Date.now()),Pt){if(function(zi,as){var Lr=zi&&zi.current;if(Lr&&Lr.nodeType===1){var _r=Lr.getBoundingClientRect();as({T:_r.top,L:_r.left,W:_r.width,H:_r.height,FIT:Lr.tagName==="IMG"?getComputedStyle(Lr).objectFit:void 0})}}(Fe,wn),Ki)return Date.now()-bn.current<250?(mi(1),requestAnimationFrame(function(){mi(2),requestAnimationFrame(function(){return ri(3)})}),void setTimeout(qi.OK,pn)):void mi(4);ri(5)}},[Ki,Pt]),[Oi,Un]}(Pe,Et,bt,ft,ut),Qe=Bt[0],tt=Bt[1],ht=tt.W,pe=tt.FIT,We=innerWidth/2,vt=innerHeight/2,vn=Qe<3||Qe>4;return[vn?ht?tt.L:We:Mt+(We-ye*Ke/2),vn?ht?tt.T:vt:$e+(vt-Ue*Ke/2),Rt,vn&&pe?Rt*(tt.H/ht):zt,Qe===0?Z:vn?ht/(ye*Ke)||.01:Z,vn?pe?1:0:1,Qe,pe]}(u,c,K,q,B,M,I,ge,d,function(Pe){return _({pause:Pe})}),Ot=cn[4],jt=cn[6],ot="transform "+d+"ms "+f,gt={className:m,onMouseDown:Ef?void 0:function(Pe){Pe.stopPropagation(),Pe.button===0&&Wt(Pe.clientX,Pe.clientY,0)},onTouchStart:Ef?function(Pe){Pe.stopPropagation(),Wt.apply(void 0,gW(Pe))}:void 0,onWheel:function(Pe){if(!qe){var Et=KC(ge-Pe.deltaY/100/2,T/M);_({stopRaf:!0}),ze(Et,Pe.clientX,Pe.clientY)}},style:{width:cn[2]+"px",height:cn[3]+"px",opacity:cn[5],objectFit:jt===4?void 0:cn[7],transform:re?"rotate("+re+"deg)":void 0,transition:jt>2?ot+", opacity "+d+"ms ease, height "+(jt<4?d/2:jt>4?d:0)+"ms "+f:void 0}};return ii.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!Ef&&S?ln:void 0,onTouchStart:Ef&&S?function(Pe){return ln(Pe.touches[0])}:void 0},ii.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ot+", 0, 0, "+Ot+", "+cn[0]+", "+cn[1]+")",transition:ee||Ie?void 0:ot,willChange:S?"transform":void 0}},n?ii.createElement(OFe,pa({src:n,loaded:K,broken:Q},gt,{onPhotoLoad:function(Pe){_(pa({},Pe,Pe.loaded&&ID(Pe.naturalWidth||0,Pe.naturalHeight||0,re)))},loadingElement:b,brokenElement:v})):i&&i({attrs:gt,scale:Ot,rotate:re})))}var yW={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 EFe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,a=e.maskClosable,l=a===void 0||a,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,O=e.photoWrapClassName,w=e.loadingElement,k=e.brokenElement,S=e.images,E=e.index,C=E===void 0?0:E,N=e.onIndexChange,_=e.visible,j=e.onClose,A=e.afterClose,F=e.portalContainer,T=I_(yW),P=T[0],R=T[1],L=p.useState(0),M=L[0],U=L[1],I=P.x,H=P.touched,K=P.pause,Q=P.lastCX,q=P.lastCY,B=P.bg,ee=B===void 0?u:B,le=P.lastBg,se=P.overlay,re=P.minimal,ge=P.scale,W=P.rotate,X=P.onScale,ae=P.onRotate,ue=e.hasOwnProperty("index"),Oe=ue?C:M,ke=ue?N:U,st=p.useRef(Oe),Le=S.length,Me=S[Oe],Ie=typeof n=="boolean"?n:Le>n,qe=function(Ot,jt){var ot=p.useReducer(function(bt){return!bt},!1)[1],gt=p.useRef(0),Pe=function(bt){var Mt=p.useRef(bt);function $e(ye){Mt.current=ye}return p.useMemo(function(){(function(ye){Ot?(ye(Ot),gt.current=1):gt.current=2})($e)},[bt]),[Mt.current,$e]}(Ot),Et=Pe[1];return[Pe[0],gt.current,function(){ot(),gt.current===2&&(Et(!1),jt&&jt()),gt.current=0}]}(_,A),Ae=qe[0],ze=qe[1],Ee=qe[2];d4(function(){if(Ae)return R({pause:!0,x:Oe*-(innerWidth+_0)}),void(st.current=Oe);R(yW)},[Ae]);var De=nb({close:function(Ot){ae&&ae(0),R({overlay:!0,lastBg:ee}),j(Ot)},changeIndex:function(Ot,jt){jt===void 0&&(jt=!1);var ot=Ie?st.current+(Ot-Oe):Ot,gt=Le-1,Pe=u4(ot,0,gt),Et=Ie?ot:Pe,bt=innerWidth+_0;R({touched:!1,lastCX:void 0,lastCY:void 0,x:-bt*Et,pause:jt}),st.current=Et,ke&&ke(Ie?Ot<0?gt:Ot>gt?0:Ot:Pe)}}),J=De.close,he=De.changeIndex;function _e(Ot){return Ot?J():R({overlay:!se})}function Ze(){R({x:-(innerWidth+_0)*Oe,lastCX:void 0,lastCY:void 0,pause:!0}),st.current=Oe}function at(Ot,jt,ot,gt){Ot==="x"?function(Pe){if(Q!==void 0){var Et=Pe-Q,bt=Et;!Ie&&(Oe===0&&Et>0||Oe===Le-1&&Et<0)&&(bt=Et/2),R({touched:!0,lastCX:Q,x:-(innerWidth+_0)*st.current+bt,pause:!1})}else R({touched:!0,lastCX:Pe,x:I,pause:!1})}(jt):Ot==="y"&&function(Pe,Et){if(q!==void 0){var bt=u===null?null:u4(u,.01,u-Math.abs(Pe-q)/100/4);R({touched:!0,lastCY:q,bg:Et===1?bt:u,minimal:Et===1})}else R({touched:!0,lastCY:Pe,bg:ee,minimal:!0})}(ot,gt)}function wt(Ot,jt){var ot=Ot-(Q??Ot),gt=jt-(q??jt),Pe=!1;if(ot<-40)he(Oe+1);else if(ot>40)he(Oe-1);else{var Et=-(innerWidth+_0)*st.current;Math.abs(gt)>100&&re&&f&&(Pe=!0,J()),R({touched:!1,x:Et,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Pe||se})}}J0("keydown",function(Ot){if(_)switch(Ot.key){case"ArrowLeft":he(Oe-1,!0);break;case"ArrowRight":he(Oe+1,!0);break;case"Escape":J()}});var Se=function(Ot,jt,ot){return p.useMemo(function(){var gt=Ot.length;return ot?Ot.concat(Ot).concat(Ot).slice(gt+jt-1,gt+jt+2):Ot.slice(Math.max(jt-1,0),Math.min(jt+2,gt+1))},[Ot,jt,ot])}(S,Oe,Ie);if(!Ae)return null;var ve=se&&!ze,He=_?ee:le,Je=X&&ae&&{images:S,index:Oe,visible:_,onClose:J,onIndexChange:he,overlayVisible:ve,overlay:Me&&Me.overlay,scale:ge,rotate:W,onScale:X,onRotate:ae},Ce=i?i(ze):400,Wt=r?r(ze):mW,ln=i?i(3):600,cn=r?r(3):mW;return ii.createElement(fFe,{className:"PhotoView-Portal"+(ve?"":" PhotoView-Slider__clean")+(_?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ot){return Ot.stopPropagation()},container:F},_&&ii.createElement(gFe,null),ii.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ze===1?" PhotoView-Slider__fadeIn":ze===2?" PhotoView-Slider__fadeOut":""),style:{background:He?"rgba(0, 0, 0, "+He+")":void 0,transitionTimingFunction:Wt,transitionDuration:(H?0:Ce)+"ms",animationDuration:Ce+"ms"},onAnimationEnd:Ee}),m&&ii.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ii.createElement("div",{className:"PhotoView-Slider__Counter"},Oe+1," / ",Le),ii.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Je&&b(Je),ii.createElement(hFe,{className:"PhotoView-Slider__toolbarIcon",onClick:J}))),Se.map(function(Ot,jt){var ot=Ie||Oe!==0?st.current-1+jt:Oe+jt;return ii.createElement(kFe,{key:Ie?Ot.key+"/"+Ot.src+"/"+ot:Ot.key,item:Ot,speed:Ce,easing:Wt,visible:_,onReachMove:at,onReachUp:wt,onPhotoTap:function(){return _e(s)},onMaskTap:function(){return _e(l)},wrapClassName:O,className:x,style:{left:(innerWidth+_0)*ot+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:H||K?void 0:"transform "+ln+"ms "+cn},loadingElement:w,brokenElement:k,onPhotoResize:Ze,isActive:st.current===ot,expose:R})}),!Ef&&m&&ii.createElement(ii.Fragment,null,(Ie||Oe!==0)&&ii.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return he(Oe-1,!0)}},ii.createElement(pFe,null)),(Ie||Oe+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,a)}}),m=nb({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=p.useMemo(function(){return pa({},a,h)},[a,h]);return ii.createElement(pbe.Provider,{value:g},t,ii.createElement(EFe,pa({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var gbe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(pbe),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=nb({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(x,O){if(d){var w=d.props[x];w&&w(O)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:a,height:l})},[i]),d?p.Children.only(p.cloneElement(d,pa({},b,{ref:m}))):null};const _Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),NFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),jFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),Kj=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),YC=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),RFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),o.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),Lv=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),bbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),IFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),PFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),DFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),IF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),MFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),PF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),LFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),$Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),FFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),BFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),UFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),QFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),zFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),ybe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),VFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),o.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),HFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),qFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),o.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),vW=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),WFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),vbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),xbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),GFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),KFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),XFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),YFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),ZFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),K2=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),JFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),e7e=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),wbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),o.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),DF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(U4e,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const z4e=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=Uj(V4e),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(Q4e,{isPresent:n,children:e})),o.jsx(Qj.Provider,{value:d,children:e})};function V4e(){return new Map}function Fme(e=!0){const t=p.useContext(Qj);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const a=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const HC=e=>e.key||"";function eq(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const eF=typeof window<"u",Bme=eF?p.useLayoutEffect:p.useEffect,Ru=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=Fme(a),u=p.useMemo(()=>eq(e),[e]),d=a&&!l?[]:u.map(HC),f=p.useRef(!0),h=p.useRef(u),m=Uj(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);Bme(()=>{f.current=!1,h.current=u;for(let w=0;w{const k=HC(w),S=a&&!l?!1:u===v||d.includes(k),E=()=>{if(m.has(k))m.set(k,!0);else return;let C=!0;m.forEach(N=>{N||(C=!1)}),C&&(O==null||O(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(z4e,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:E,children:w},k)})})},ac=e=>e;let Ume=ac;const H4e={useManualTiming:!1};function q4e(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const qC=["read","resolveKeyframes","update","preRender","render","postRender"],W4e=40;function Qme(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=qC.reduce((y,x)=>(y[x]=q4e(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,W4e),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:qC.reduce((y,x)=>{const O=a[x];return y[x]=(w,k=!1,S=!1)=>(n||g(),O.schedule(w,k,S)),y},{}),cancel:y=>{for(let x=0;xtq[e].some(n=>!!t[n])};function G4e(e){for(const t in e)Pv[t]={...Pv[t],...e[t]}}const K4e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function E_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||K4e.has(e)}let Vme=e=>!E_(e);function Hme(e){e&&(Vme=t=>t.startsWith("on")?!E_(t):e(t))}try{Hme(require("@emotion/is-prop-valid").default)}catch{}function X4e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(Vme(r)||n===!0&&E_(r)||!t&&!E_(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function Y4e({children:e,isValidProp:t,...n}){t&&Hme(t),n={...p.useContext(cS),...n},n.isStatic=Uj(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(cS.Provider,{value:i,children:e})}function Z4e(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const zj=p.createContext({});function uS(e){return typeof e=="string"||Array.isArray(e)}function Vj(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const tF=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],nF=["initial",...tF];function Hj(e){return Vj(e.animate)||nF.some(t=>uS(e[t]))}function qme(e){return!!(Hj(e)||e.variants)}function J4e(e,t){if(Hj(e)){const{initial:n,animate:i}=e;return{initial:n===!1||uS(n)?n:void 0,animate:uS(i)?i:void 0}}return e.inherit!==!1?t:{}}function e6e(e){const{initial:t,animate:n}=J4e(e,p.useContext(zj));return p.useMemo(()=>({initial:t,animate:n}),[nq(t),nq(n)])}function nq(e){return Array.isArray(e)?e.join(" "):e}const t6e=Symbol.for("motionComponentSymbol");function Sy(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function n6e(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):Sy(n)&&(n.current=i))},[t])}const iF=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),i6e="framerAppearId",Wme="data-"+iF(i6e),{schedule:rF}=Qme(queueMicrotask,!1),Gme=p.createContext({});function r6e(e,t,n,i,r){var s,a;const{visualElement:l}=p.useContext(zj),c=p.useContext(zme),u=p.useContext(Qj),d=p.useContext(cS).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(Gme);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&s6e(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[Wme],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return Bme(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),rF.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 s6e(e,t,n,i){const{layoutId:r,layout:s,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Kme(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Sy(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function Kme(e){if(e)return e.options.allowProjection!==!1?e.projection:Kme(e.parent)}function a6e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&G4e(e);function l(u,d){let f;const h={...p.useContext(cS),...u,layoutId:o6e(u)},{isStatic:m}=h,g=e6e(u),b=i(u,m);if(!m&&eF){l6e();const v=c6e(h);f=v.MeasureLayout,g.visualElement=r6e(r,b,h,t,v.ProjectionNode)}return o.jsxs(zj.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,n6e(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(a=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&a!==void 0?a:""})`}`;const c=p.forwardRef(l);return c[t6e]=r,c}function o6e({layoutId:e}){const t=p.useContext(J9).id;return t&&e!==void 0?t+"-"+e:e}function l6e(e,t){p.useContext(zme).strict}function c6e(e){const{drag:t,layout:n}=Pv;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const u6e=["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 sF(e){return typeof e!="string"||e.includes("-")?!1:!!(u6e.indexOf(e)>-1||/[A-Z]/u.test(e))}function iq(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function aF(e,t,n,i){if(typeof t=="function"){const[r,s]=iq(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]=iq(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const K3=e=>Array.isArray(e),d6e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),f6e=e=>K3(e)?e[e.length-1]||0:e,mo=e=>!!(e&&e.getVelocity);function q2(e){const t=mo(e)?e.get():e;return d6e(t)?t.toValue():t}function h6e({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:p6e(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const Xme=e=>(t,n)=>{const i=p.useContext(zj),r=p.useContext(Qj),s=()=>h6e(e,t,i,r);return n?s():Uj(s)};function p6e(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=q2(s[h]);let{initial:a,animate:l}=e;const c=Hj(e),u=qme(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Vj(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),Zme=Yme("--"),m6e=Yme("var(--"),oF=e=>m6e(e)?g6e.test(e.split("/*")[0].trim()):!1,g6e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Jme=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vh=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},dS={...kx,transform:e=>vh(0,1,e)},WC={...kx,default:1},Lk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mp=Lk("deg"),Id=Lk("%"),Rn=Lk("px"),b6e=Lk("vh"),y6e=Lk("vw"),rq={...Id,parse:e=>Id.parse(e)/100,transform:e=>Id.transform(e*100)},v6e={borderWidth:Rn,borderTopWidth:Rn,borderRightWidth:Rn,borderBottomWidth:Rn,borderLeftWidth:Rn,borderRadius:Rn,radius:Rn,borderTopLeftRadius:Rn,borderTopRightRadius:Rn,borderBottomRightRadius:Rn,borderBottomLeftRadius:Rn,width:Rn,maxWidth:Rn,height:Rn,maxHeight:Rn,top:Rn,right:Rn,bottom:Rn,left:Rn,padding:Rn,paddingTop:Rn,paddingRight:Rn,paddingBottom:Rn,paddingLeft:Rn,margin:Rn,marginTop:Rn,marginRight:Rn,marginBottom:Rn,marginLeft:Rn,backgroundPositionX:Rn,backgroundPositionY:Rn},x6e={rotate:mp,rotateX:mp,rotateY:mp,rotateZ:mp,scale:WC,scaleX:WC,scaleY:WC,scaleZ:WC,skew:mp,skewX:mp,skewY:mp,distance:Rn,translateX:Rn,translateY:Rn,translateZ:Rn,x:Rn,y:Rn,z:Rn,perspective:Rn,transformPerspective:Rn,opacity:dS,originX:rq,originY:rq,originZ:Rn},sq={...kx,transform:Math.round},lF={...v6e,...x6e,zIndex:sq,size:Rn,fillOpacity:dS,strokeOpacity:dS,numOctaves:sq},w6e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},O6e=Sx.length;function S6e(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),ege=()=>({...dF(),attrs:{}}),fF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tge(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 nge=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 ige(e,t,n,i){tge(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(nge.has(r)?r:iF(r),t.attrs[r])}const C_={};function A6e(e){Object.assign(C_,e)}function rge(e,{layout:t,layoutId:n}){return Hb.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!C_[e]||e==="opacity")}function hF(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(mo(r[a])||t.style&&mo(t.style[a])||rge(a,e)||((i=n==null?void 0:n.getValue(a))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function sge(e,t,n){const i=hF(e,t,n);for(const r in e)if(mo(e[r])||mo(t[r])){const s=Sx.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function _6e(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 oq=["x","y","width","height","cx","cy","r"],N6e={useVisualState:Xme({scrapeMotionValuesFromProps:sge,createRenderState:ege,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Hb.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{_6e(n,i),Kr.render(()=>{uF(i,r,fF(n.tagName),e.transformTemplate),ige(n,i)})})}})},j6e={useVisualState:Xme({scrapeMotionValuesFromProps:hF,createRenderState:dF})};function age(e,t,n){for(const i in t)!mo(t[i])&&!rge(i,n)&&(e[i]=t[i])}function R6e({transformTemplate:e},t){return p.useMemo(()=>{const n=dF();return cF(n,t,e),Object.assign({},n.vars,n.style)},[t])}function I6e(e,t){const n=e.style||{},i={};return age(i,n,e),Object.assign(i,R6e(e,t)),i}function P6e(e,t){const n={},i=I6e(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 D6e(e,t,n,i){const r=p.useMemo(()=>{const s=ege();return uF(s,t,fF(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};age(s,e.style,e),r.style={...s,...r.style}}return r}function M6e(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(sF(n)?D6e:P6e)(i,s,a,n),u=X4e(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>mo(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function L6e(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...sF(i)?N6e:j6e,preloadedFeatures:e,useRender:M6e(r),createVisualElement:t,Component:i};return a6e(a)}}function oge(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(W2===void 0&&Pd.set(qa.isProcessing||H4e.useManualTiming?qa.timestamp:performance.now()),W2),set:e=>{W2=e,queueMicrotask($6e)}};function mF(e,t){e.indexOf(t)===-1&&e.push(t)}function gF(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class bF{constructor(){this.subscriptions=[]}add(t){return mF(this.subscriptions,t),()=>gF(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 B6e{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pd.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Pd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=F6e(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 bF);const i=this.events[t].add(n);return t==="change"?()=>{i(),Kr.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Pd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>lq)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,lq);return cge(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fS(e,t){return new B6e(e,t)}function U6e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,fS(n))}function Q6e(e,t){const n=qj(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=f6e(s[a]);U6e(e,a,l)}}function z6e(e){return!!(mo(e)&&e.add)}function X3(e,t){const n=e.getValue("willChange");if(z6e(n))return n.add(t)}function uge(e){return e.props[Wme]}function yF(e){let t;return()=>(t===void 0&&(t=e()),t)}const V6e=yF(()=>window.ScrollTimeline!==void 0);class H6e{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(V6e()&&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 q6e extends H6e{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const th=e=>e*1e3,nh=e=>e/1e3;function vF(e){return typeof e=="function"}function cq(e,t){e.timeline=t,e.onfinish=null}const xF=e=>Array.isArray(e)&&typeof e[0]=="number",W6e={linearEasing:void 0};function G6e(e,t){const n=yF(e);return()=>{var i;return(i=W6e[t])!==null&&i!==void 0?i:n()}}const T_=G6e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dv=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},dge=(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})`,Y3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tw([0,.65,.55,1]),circOut:Tw([.55,0,1,.45]),backIn:Tw([.31,.01,.66,-.59]),backOut:Tw([.33,1.53,.69,.99])};function hge(e,t){if(e)return typeof e=="function"&&T_()?dge(e,t):xF(e)?Tw(e):Array.isArray(e)?e.map(n=>hge(n,t)||Y3.easeOut):Y3[e]}const pge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,K6e=1e-7,X6e=12;function Y6e(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=pge(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>K6e&&++lY6e(s,0,1,e,n);return s=>s===0||s===1?s:pge(r(s),t,i)}const mge=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gge=e=>t=>1-e(1-t),bge=$k(.33,1.53,.69,.99),wF=gge(bge),yge=mge(wF),vge=e=>(e*=2)<1?.5*wF(e):.5*(2-Math.pow(2,-10*(e-1))),OF=e=>1-Math.sin(Math.acos(e)),xge=gge(OF),wge=mge(OF),Oge=e=>/^0[^.\s]+$/u.test(e);function Z6e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Oge(e):!0}const hO=e=>Math.round(e*1e5)/1e5,SF=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function J6e(e){return e==null}const e$e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kF=(e,t)=>n=>!!(typeof n=="string"&&e$e.test(n)&&n.startsWith(e)||t&&!J6e(n)&&Object.prototype.hasOwnProperty.call(n,t)),Sge=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(SF);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},t$e=e=>vh(0,255,e),xD={...kx,transform:e=>Math.round(t$e(e))},Pg={test:kF("rgb","red"),parse:Sge("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+xD.transform(e)+", "+xD.transform(t)+", "+xD.transform(n)+", "+hO(dS.transform(i))+")"};function n$e(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Z3={test:kF("#"),parse:n$e,transform:Pg.transform},ky={test:kF("hsl","hue"),parse:Sge("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Id.transform(hO(t))+", "+Id.transform(hO(n))+", "+hO(dS.transform(i))+")"},fo={test:e=>Pg.test(e)||Z3.test(e)||ky.test(e),parse:e=>Pg.test(e)?Pg.parse(e):ky.test(e)?ky.parse(e):Z3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pg.transform(e):ky.transform(e)},i$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function r$e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(SF))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(i$e))===null||n===void 0?void 0:n.length)||0)>0}const kge="number",Ege="color",s$e="var",a$e="var(",uq="${}",o$e=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function hS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(o$e,c=>(fo.test(c)?(i.color.push(s),r.push(Ege),n.push(fo.parse(c))):c.startsWith(a$e)?(i.var.push(s),r.push(s$e),n.push(c)):(i.number.push(s),r.push(kge),n.push(parseFloat(c))),++s,uq)).split(uq);return{values:n,split:l,indexes:i,types:r}}function Cge(e){return hS(e).values}function Tge(e){const{split:t,types:n}=hS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function c$e(e){const t=Cge(e);return Tge(e)(t.map(l$e))}const hm={test:r$e,parse:Cge,createTransformer:Tge,getAnimatableNone:c$e},u$e=new Set(["brightness","contrast","saturate","opacity"]);function d$e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(SF)||[];if(!i)return e;const r=n.replace(i,"");let s=u$e.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const f$e=/\b([a-z-]*)\(.*?\)/gu,J3={...hm,getAnimatableNone:e=>{const t=e.match(f$e);return t?t.map(d$e).join(" "):e}},h$e={...lF,color:fo,backgroundColor:fo,outlineColor:fo,fill:fo,stroke:fo,borderColor:fo,borderTopColor:fo,borderRightColor:fo,borderBottomColor:fo,borderLeftColor:fo,filter:J3,WebkitFilter:J3},EF=e=>h$e[e];function Age(e,t){let n=EF(e);return n!==J3&&(n=hm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const p$e=new Set(["auto","none","0"]);function m$e(e,t,n){let i=0,r;for(;ie===kx||e===Rn,fq=(e,t)=>parseFloat(e.split(", ")[t]),hq=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return fq(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?fq(s[1],e):0}},g$e=new Set(["x","y","z"]),b$e=Sx.filter(e=>!g$e.has(e));function y$e(e){const t=[];return b$e.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Mv={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:hq(4,13),y:hq(5,14)};Mv.translateX=Mv.x;Mv.translateY=Mv.y;const tb=new Set;let e4=!1,t4=!1;function _ge(){if(t4){const e=Array.from(tb).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=y$e(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,a])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}t4=!1,e4=!1,tb.forEach(e=>e.complete()),tb.clear()}function Nge(){tb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(t4=!0)})}function v$e(){Nge(),_ge()}class CF{constructor(t,n,i,r,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tb.add(this),e4||(e4=!0,Kr.read(Nge),Kr.resolveKeyframes(_ge))):(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),x$e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function w$e(e){const t=x$e.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function Rge(e,t,n=1){const[i,r]=w$e(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return jge(a)?parseFloat(a):a}return oF(r)?Rge(r,t,n+1):r}const Ige=e=>t=>t.test(e),O$e={test:e=>e==="auto",parse:e=>e},Pge=[kx,Rn,Id,mp,y6e,b6e,O$e],pq=e=>Pge.find(Ige(e));class Dge extends CF{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 mq=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hm.test(e)||e==="0")&&!e.startsWith("url("));function S$e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Wj(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(E$e),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const C$e=40;class Mge{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Pd.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>C$e?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&v$e(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Pd.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!k$e(t,i,r,s))if(a)this.options.duration=0;else{c&&c(Wj(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const n4=2e4;function Lge(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=n4?1/0:t}const vs=(e,t,n)=>e+(t-e)*n;function wD(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 T$e({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,a=0;if(!t)r=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=wD(c,l,e+1/3),s=wD(c,l,e),a=wD(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function A_(e,t){return n=>n>0?t:e}const OD=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},A$e=[Z3,Pg,ky],_$e=e=>A$e.find(t=>t.test(e));function gq(e){const t=_$e(e);if(!t)return!1;let n=t.parse(e);return t===ky&&(n=T$e(n)),n}const bq=(e,t)=>{const n=gq(e),i=gq(t);if(!n||!i)return A_(e,t);const r={...n};return s=>(r.red=OD(n.red,i.red,s),r.green=OD(n.green,i.green,s),r.blue=OD(n.blue,i.blue,s),r.alpha=vs(n.alpha,i.alpha,s),Pg.transform(r))},N$e=(e,t)=>n=>t(e(n)),Fk=(...e)=>e.reduce(N$e),i4=new Set(["none","hidden"]);function j$e(e,t){return i4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function R$e(e,t){return n=>vs(e,t,n)}function TF(e){return typeof e=="number"?R$e:typeof e=="string"?oF(e)?A_:fo.test(e)?bq:D$e:Array.isArray(e)?$ge:typeof e=="object"?fo.test(e)?bq:I$e:A_}function $ge(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>TF(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function P$e(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=hm.createTransformer(t),i=hS(e),r=hS(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?i4.has(e)&&!r.values.length||i4.has(t)&&!i.values.length?j$e(e,t):Fk($ge(P$e(i,r),r.values),n):A_(e,t)};function Fge(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vs(e,t,n):TF(e)(e,t)}const M$e=5;function Bge(e,t,n){const i=Math.max(t-M$e,0);return cge(n-e(i),t-i)}const Ss={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},SD=.001;function L$e({duration:e=Ss.duration,bounce:t=Ss.bounce,velocity:n=Ss.velocity,mass:i=Ss.mass}){let r,s,a=1-t;a=vh(Ss.minDamping,Ss.maxDamping,a),e=vh(Ss.minDuration,Ss.maxDuration,nh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,m=r4(u,a),g=Math.exp(-f);return SD-h/m*g},s=u=>{const f=u*a*e,h=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=r4(Math.pow(u,2),a);return(-r(u)+SD>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-SD+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=F$e(r,s,l);if(e=th(e),isNaN(c))return{stiffness:Ss.stiffness,damping:Ss.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const $$e=12;function F$e(e,t,n){let i=n;for(let r=1;r<$$e;r++)i=i-e(i)/t(i);return i}function r4(e,t){return e*Math.sqrt(1-t*t)}const B$e=["duration","bounce"],U$e=["stiffness","damping","mass"];function yq(e,t){return t.some(n=>e[n]!==void 0)}function Q$e(e){let t={velocity:Ss.velocity,stiffness:Ss.stiffness,damping:Ss.damping,mass:Ss.mass,isResolvedFromDuration:!1,...e};if(!yq(e,U$e)&&yq(e,B$e))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*vh(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ss.mass,stiffness:r,damping:s}}else{const n=L$e(e);t={...t,...n,mass:Ss.mass},t.isResolvedFromDuration=!0}return t}function Uge(e=Ss.visualDuration,t=Ss.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=Q$e({...n,velocity:-nh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=nh(Math.sqrt(c/d)),x=Math.abs(v)<5;i||(i=x?Ss.restSpeed.granular:Ss.restSpeed.default),r||(r=x?Ss.restDelta.granular:Ss.restDelta.default);let O;if(b<1){const k=r4(y,b);O=S=>{const E=Math.exp(-b*y*S);return a-E*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)O=k=>a-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);O=S=>{const E=Math.exp(-b*y*S),C=Math.min(k*S,300);return a-E*((g+b*y*v)*Math.sinh(C)+k*v*Math.cosh(C))/k}}const w={calculatedDuration:m&&f||null,next:k=>{const S=O(k);if(m)l.done=k>=f;else{let E=0;b<1&&(E=k===0?th(g):Bge(O,k,S));const C=Math.abs(E)<=i,N=Math.abs(a-S)<=r;l.done=C&&N}return l.value=l.done?a:S,l},toString:()=>{const k=Math.min(Lge(w),n4),S=dge(E=>w.next(k*E).value,k,30);return k+"ms "+S}};return w}function vq({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=C=>l!==void 0&&Cc,g=C=>l===void 0?c:c===void 0||Math.abs(l-C)-b*Math.exp(-C/i),O=C=>y+x(C),w=C=>{const N=x(C),_=O(C);h.done=Math.abs(N)<=u,h.value=h.done?y:_};let k,S;const E=C=>{m(h.value)&&(k=C,S=Uge({keyframes:[h.value,g(h.value)],velocity:Bge(O,C,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:C=>{let N=!1;return!S&&k===void 0&&(N=!0,w(C),E(C)),k!==void 0&&C>=k?S.next(C-k):(!N&&w(C),h)}}}const z$e=$k(.42,0,1,1),V$e=$k(0,0,.58,1),Qge=$k(.42,0,.58,1),H$e=e=>Array.isArray(e)&&typeof e[0]!="number",q$e={linear:ac,easeIn:z$e,easeInOut:Qge,easeOut:V$e,circIn:OF,circInOut:wge,circOut:xge,backIn:wF,backInOut:yge,backOut:bge,anticipate:vge},xq=e=>{if(xF(e)){Ume(e.length===4);const[t,n,i,r]=e;return $k(t,n,i,r)}else if(typeof e=="string")return q$e[e];return e};function W$e(e,t,n){const i=[],r=n||Fge,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=W$e(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(vh(e[0],e[s-1],d)):u}function K$e(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Dv(0,t,i);e.push(vs(n,1,r))}}function X$e(e){const t=[0];return K$e(t,e.length-1),t}function Y$e(e,t){return e.map(n=>n*t)}function Z$e(e,t){return e.map(()=>t||Qge).splice(0,e.length-1)}function __({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=H$e(i)?i.map(xq):xq(i),s={done:!1,value:t[0]},a=Y$e(n&&n.length===t.length?n:X$e(t),e),l=G$e(a,t,{ease:Array.isArray(r)?r:Z$e(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const J$e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Kr.update(t,!0),stop:()=>fm(t),now:()=>qa.isProcessing?qa.timestamp:Pd.now()}},e8e={decay:vq,inertia:vq,tween:__,keyframes:__,spring:Uge},t8e=e=>e/100;class AF extends Mge{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,a=(r==null?void 0:r.KeyframeResolver)||CF,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:a=0}=this.options,l=vF(n)?n:e8e[n]||__;let c,u;l!==__&&typeof t[0]!="number"&&(c=Fk(t8e,Fge(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Lge(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:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let O=this.currentTime,w=s;if(m){const C=Math.min(this.currentTime,d)/f;let N=Math.floor(C),_=C%1;!_&&C>=1&&(_=1),_===1&&N--,N=Math.min(N,m+1),!!(N%2)&&(g==="reverse"?(_=1-_,b&&(_-=b/f)):g==="mirror"&&(w=a)),O=vh(0,1,_)*f}const k=x?{done:!1,value:c[0]}:w.next(O);l&&(k.value=l(k.value));let{done:S}=k;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&r!==void 0&&(k.value=Wj(c,this.options,r)),v&&v(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nh(t.calculatedDuration):0}get time(){return nh(this.currentTime)}set time(t){t=th(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=J$e,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const n8e=new Set(["opacity","clipPath","filter","transform"]);function i8e(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=hge(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const r8e=yF(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),N_=10,s8e=2e4;function a8e(e){return vF(e.type)||e.type==="spring"||!fge(e.ease)}function o8e(e,t){const n=new AF({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(a,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&T_()&&l8e(s)&&(s=zge[s]),a8e(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=o8e(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,a="keyframes"}const d=i8e(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(cq(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Wj(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=th(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return ac;const{animation:i}=n;cq(i,t)}return ac}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new AF({...m,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=th(this.time);u.setWithVelocity(g.sample(b-N_).value,g.sample(b).value,N_)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return r8e()&&i&&n8e.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const c8e={type:"spring",stiffness:500,damping:25,restSpeed:10},u8e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),d8e={type:"keyframes",duration:.8},f8e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},h8e=(e,{keyframes:t})=>t.length>2?d8e:Hb.has(e)?e.startsWith("scale")?u8e(t[1]):c8e:f8e;function p8e({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const _F=(e,t,n,i={},r,s)=>a=>{const l=pF(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-th(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};p8e(l)||(d={...d,...h8e(e,d)}),d.duration&&(d.duration=th(d.duration)),d.repeatDelay&&(d.repeatDelay=th(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=Wj(d.keyframes,l);if(h!==void 0)return Kr.update(()=>{d.onUpdate(h),d.onComplete()}),new q6e([])}return!s&&wq.supports(d)?new wq(d):new AF(d)};function m8e({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Vge(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(a=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&m8e(d,f))continue;const g={delay:n,...pF(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=uge(e);if(y){const x=window.MotionHandoffAnimation(y,f,Kr);x!==null&&(g.startTime=x,b=!0)}}X3(e,f),h.start(_F(f,h,m,e.shouldReduceMotion&&lge.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Kr.update(()=>{l&&Q6e(e,l)})}),u}function s4(e,t,n={}){var i;const r=qj(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Vge(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return g8e(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function g8e(e,t,n=0,i=0,r=1,s){const a=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(b8e).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(s4(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function b8e(e,t){return e.sortNodePosition(t)}function y8e(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>s4(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=s4(e,t,n);else{const r=typeof t=="function"?qj(e,t,n.custom):t;i=Promise.all(Vge(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const v8e=nF.length;function Hge(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Hge(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})=>y8e(e,n,i)))}function S8e(e){let t=O8e(e),n=Oq(),i=!0;const r=c=>(u,d)=>{var f;const h=qj(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=Hge(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&w,N=!1;const _=Array.isArray(O)?O:[O];let j=_.reduce(r(y),{});k===!1&&(j={});const{prevResolvedValues:A={}}=x,F={...A,...j},T=L=>{C=!0,h.has(L)&&(N=!0,h.delete(L)),x.needsAnimating[L]=!0;const M=e.getValue(L);M&&(M.liveStyle=!1)};for(const L in F){const M=j[L],U=A[L];if(m.hasOwnProperty(L))continue;let I=!1;K3(M)&&K3(U)?I=!oge(M,U):I=M!==U,I?M!=null?T(L):h.add(L):M!==void 0&&h.has(L)?T(L):x.protectedKeys[L]=!0}x.prevProp=O,x.prevResolvedValues=j,x.isActive&&(m={...m,...j}),i&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&E)||N)&&f.push(..._.map(L=>({animation:L,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),O=e.getValue(y);O&&(O.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Oq(),i=!0}}}function k8e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!oge(t,e):!1}function eg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Oq(){return{animate:eg(!0),whileInView:eg(),whileHover:eg(),whileTap:eg(),whileDrag:eg(),whileFocus:eg(),exit:eg()}}class Mm{constructor(t){this.isMounted=!1,this.node=t}update(){}}class E8e extends Mm{constructor(t){super(t),t.animationState||(t.animationState=S8e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vj(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let C8e=0;class T8e extends Mm{constructor(){super(...arguments),this.id=C8e++}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 A8e={animation:{Feature:E8e},exit:{Feature:T8e}},vu={x:!1,y:!1};function qge(){return vu.x||vu.y}function _8e(e){return e==="x"||e==="y"?vu[e]?null:(vu[e]=!0,()=>{vu[e]=!1}):vu.x||vu.y?null:(vu.x=vu.y=!0,()=>{vu.x=vu.y=!1})}const NF=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function pS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Bk(e){return{point:{x:e.pageX,y:e.pageY}}}const N8e=e=>t=>NF(t)&&e(t,Bk(t));function pO(e,t,n,i){return pS(e,t,N8e(n),i)}const Sq=(e,t)=>Math.abs(e-t);function j8e(e,t){const n=Sq(e.x,t.x),i=Sq(e.y,t.y);return Math.sqrt(n**2+i**2)}class Wge{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=ED(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=j8e(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=qa;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=kD(h,this.transformPagePoint),Kr.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=ED(f.type==="pointercancel"?this.lastMoveEventInfo:kD(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!NF(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=Bk(t),l=kD(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qa;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,ED(l,this.history)),this.removeListeners=Fk(pO(this.contextWindow,"pointermove",this.handlePointerMove),pO(this.contextWindow,"pointerup",this.handlePointerUp),pO(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fm(this.updatePoint)}}function kD(e,t){return t?{point:t(e.point)}:e}function kq(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ED({point:e},t){return{point:e,delta:kq(e,Gge(t)),offset:kq(e,R8e(t)),velocity:I8e(t,.1)}}function R8e(e){return e[0]}function Gge(e){return e[e.length-1]}function I8e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=Gge(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>th(t)));)n--;if(!i)return{x:0,y:0};const s=nh(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Kge=1e-4,P8e=1-Kge,D8e=1+Kge,Xge=.01,M8e=0-Xge,L8e=0+Xge;function fc(e){return e.max-e.min}function $8e(e,t,n){return Math.abs(e-t)<=n}function Eq(e,t,n,i=.5){e.origin=i,e.originPoint=vs(t.min,t.max,e.origin),e.scale=fc(n)/fc(t),e.translate=vs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=P8e&&e.scale<=D8e||isNaN(e.scale))&&(e.scale=1),(e.translate>=M8e&&e.translate<=L8e||isNaN(e.translate))&&(e.translate=0)}function mO(e,t,n,i){Eq(e.x,t.x,n.x,i?i.originX:void 0),Eq(e.y,t.y,n.y,i?i.originY:void 0)}function Cq(e,t,n){e.min=n.min+t.min,e.max=e.min+fc(t)}function F8e(e,t,n){Cq(e.x,t.x,n.x),Cq(e.y,t.y,n.y)}function Tq(e,t,n){e.min=t.min-n.min,e.max=e.min+fc(t)}function gO(e,t,n){Tq(e.x,t.x,n.x),Tq(e.y,t.y,n.y)}function B8e(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?vs(n,e,i.max):Math.min(e,n)),e}function Aq(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 U8e(e,{top:t,left:n,bottom:i,right:r}){return{x:Aq(e.x,n,r),y:Aq(e.y,t,i)}}function _q(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Dv(t.min,t.max-i,e.min):i>r&&(n=Dv(e.min,e.max-r,t.min)),vh(0,1,n)}function V8e(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 a4=.35;function H8e(e=a4){return e===!1?e=0:e===!0&&(e=a4),{x:Nq(e,"left","right"),y:Nq(e,"top","bottom")}}function Nq(e,t,n){return{min:jq(e,t),max:jq(e,n)}}function jq(e,t){return typeof e=="number"?e:e[t]||0}const Rq=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ey=()=>({x:Rq(),y:Rq()}),Iq=()=>({min:0,max:0}),Rs=()=>({x:Iq(),y:Iq()});function Rc(e){return[e("x"),e("y")]}function Yge({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function q8e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function W8e(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 CD(e){return e===void 0||e===1}function o4({scale:e,scaleX:t,scaleY:n}){return!CD(e)||!CD(t)||!CD(n)}function bg(e){return o4(e)||Zge(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Zge(e){return Pq(e.x)||Pq(e.y)}function Pq(e){return e&&e!=="0%"}function j_(e,t,n){const i=e-n,r=t*i;return n+r}function Dq(e,t,n,i,r){return r!==void 0&&(e=j_(e,r,i)),j_(e,n,i)+t}function l4(e,t=0,n=1,i,r){e.min=Dq(e.min,t,n,i,r),e.max=Dq(e.max,t,n,i,r)}function Jge(e,{x:t,y:n}){l4(e.x,t.translate,t.scale,t.originPoint),l4(e.y,n.translate,n.scale,n.originPoint)}const Mq=.999999999999,Lq=1.0000000000001;function G8e(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lMq&&(t.x=1),t.yMq&&(t.y=1)}function Cy(e,t){e.min=e.min+t,e.max=e.max+t}function $q(e,t,n,i,r=.5){const s=vs(e.min,e.max,r);l4(e,t,n,s,i)}function Ty(e,t){$q(e.x,t.x,t.scaleX,t.scale,t.originX),$q(e.y,t.y,t.scaleY,t.scale,t.originY)}function ebe(e,t){return Yge(W8e(e.getBoundingClientRect(),t))}function K8e(e,t,n){const i=ebe(e,n),{scroll:r}=t;return r&&(Cy(i.x,r.offset.x),Cy(i.y,r.offset.y)),i}const tbe=({current:e})=>e?e.ownerDocument.defaultView:null,X8e=new WeakMap;class Y8e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Rs(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bk(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_8e(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rc(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Id.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const O=x.layout.layoutBox[v];O&&(y=fc(O)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Kr.postRender(()=>g(d,f)),X3(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=Z8e(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Rc(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Wge(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tbe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Kr.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!GC(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=B8e(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Sy(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=U8e(r.layoutBox,n):this.constraints=!1,this.elastic=H8e(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=V8e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Sy(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=K8e(i,r.root,this.visualElement.getTransformPagePoint());let a=Q8e(r.layout.layoutBox,s);if(n){const l=n(q8e(a));this.hasMutatedConstraints=!!l,l&&(a=Yge(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Rc(d=>{if(!GC(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,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 X3(this.visualElement,t),i.start(_F(t,i,0,n,this.visualElement,!1))}stopAnimation(){Rc(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Rc(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Rc(n=>{const{drag:i}=this.getProps();if(!GC(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];s.set(t[n]-vs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sy(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Rc(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=z8e({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rc(a=>{if(!GC(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(vs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;X8e.set(this.visualElement,this);const t=this.visualElement.current,n=pO(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Sy(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Kr.read(i);const a=pS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Rc(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:a=a4,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function GC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Z8e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class J8e extends Mm{constructor(t){super(t),this.removeGroupControls=ac,this.removeListeners=ac,this.controls=new Y8e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ac}unmount(){this.removeGroupControls(),this.removeListeners()}}const Fq=e=>(t,n)=>{e&&Kr.postRender(()=>e(t,n))};class e9e extends Mm{constructor(){super(...arguments),this.removePointerDownListener=ac}onPointerDown(t){this.session=new Wge(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tbe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Fq(t),onStart:Fq(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&Kr.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=pO(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const G2={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Bq(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const D1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Rn.test(e))e=parseFloat(e);else return e;const n=Bq(e,t.target.x),i=Bq(e,t.target.y);return`${n}% ${i}%`}},t9e={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=hm.parse(e);if(r.length>5)return i;const s=hm.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=vs(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),s(r)}};class n9e extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;A6e(i9e),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),G2.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,a=i.projection;return a&&(a.isPresent=s,r||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Kr.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),rF.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 nbe(e){const[t,n]=Fme(),i=p.useContext(J9);return o.jsx(n9e,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(Gme),isPresent:t,safeToRemove:n})}const i9e={borderRadius:{...D1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:D1,borderTopRightRadius:D1,borderBottomLeftRadius:D1,borderBottomRightRadius:D1,boxShadow:t9e};function r9e(e,t,n){const i=mo(e)?e:fS(e);return i.start(_F("",i,t,n)),i.animation}function s9e(e){return e instanceof SVGElement&&e.tagName!=="svg"}const a9e=(e,t)=>e.depth-t.depth;class o9e{constructor(){this.children=[],this.isDirty=!1}add(t){mF(this.children,t),this.isDirty=!0}remove(t){gF(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(a9e),this.isDirty=!1,this.children.forEach(t)}}function l9e(e,t){const n=Pd.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(fm(i),e(s-t))};return Kr.read(i,!0),()=>fm(i)}const ibe=["TopLeft","TopRight","BottomLeft","BottomRight"],c9e=ibe.length,Uq=e=>typeof e=="string"?parseFloat(e):e,Qq=e=>typeof e=="number"||Rn.test(e);function u9e(e,t,n,i,r,s){r?(e.opacity=vs(0,n.opacity!==void 0?n.opacity:1,d9e(i)),e.opacityExit=vs(t.opacity!==void 0?t.opacity:1,0,f9e(i))):s&&(e.opacity=vs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(Dv(e,t,i))}function Vq(e,t){e.min=t.min,e.max=t.max}function jc(e,t){Vq(e.x,t.x),Vq(e.y,t.y)}function Hq(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function qq(e,t,n,i,r){return e-=t,e=j_(e,1/n,i),r!==void 0&&(e=j_(e,1/r,i)),e}function h9e(e,t=0,n=1,i=.5,r,s=e,a=e){if(Id.test(t)&&(t=parseFloat(t),t=vs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=vs(s.min,s.max,i);e===s&&(l-=t),e.min=qq(e.min,t,n,l,r),e.max=qq(e.max,t,n,l,r)}function Wq(e,t,[n,i,r],s,a){h9e(e,t[n],t[i],t[r],t.scale,s,a)}const p9e=["x","scaleX","originX"],m9e=["y","scaleY","originY"];function Gq(e,t,n,i){Wq(e.x,t,p9e,n?n.x:void 0,i?i.x:void 0),Wq(e.y,t,m9e,n?n.y:void 0,i?i.y:void 0)}function Kq(e){return e.translate===0&&e.scale===1}function sbe(e){return Kq(e.x)&&Kq(e.y)}function Xq(e,t){return e.min===t.min&&e.max===t.max}function g9e(e,t){return Xq(e.x,t.x)&&Xq(e.y,t.y)}function Yq(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function abe(e,t){return Yq(e.x,t.x)&&Yq(e.y,t.y)}function Zq(e){return fc(e.x)/fc(e.y)}function Jq(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class b9e{constructor(){this.members=[]}add(t){mF(this.members,t),t.scheduleRender()}remove(t){if(gF(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 y9e(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||s||a)&&(i=`translate3d(${r}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const yg={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Aw=typeof window<"u"&&window.MotionDebug!==void 0,TD=["","X","Y","Z"],v9e={visibility:"hidden"},eW=1e3;let x9e=0;function AD(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function obe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=uge(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Kr,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&obe(i)}function lbe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=x9e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Aw&&(yg.totalNodes=yg.resolvedTargetDeltas=yg.recalculatedProjection=0),this.nodes.forEach(S9e),this.nodes.forEach(A9e),this.nodes.forEach(_9e),this.nodes.forEach(k9e),Aw&&window.MotionDebug.record(yg)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=l9e(h,250),G2.hasAnimatedSinceResize&&(G2.hasAnimatedSinceResize=!1,this.nodes.forEach(nW))})}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()||P9e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!abe(this.targetLayout,g)||m,O=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,O);const w={...pF(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||nW(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fm(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(N9e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&obe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=w/1e3;iW(f.x,a.x,k),iW(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gO(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),R9e(this.relativeTarget,this.relativeTargetOrigin,h,k),O&&g9e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Rs()),jc(O,this.relativeTarget)),b&&(this.animationValues=d,u9e(d,u,this.latestValues,k,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kr.update(()=>{G2.hasAnimatedSinceResize=!0,this.currentAnimation=r9e(0,eW,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eW),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&cbe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Rs();const f=fc(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=fc(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}jc(l,c),Ty(l,d),mO(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new b9e),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&AD("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(tW),this.root.sharedNodes.clear()}}}function w9e(e){e.updateLayout()}function O9e(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=fc(h);h.min=i[f].min,h.max=h.min+m}):cbe(s,n.layoutBox,i)&&Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=fc(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=Ey();mO(l,i,n.layoutBox);const c=Ey();a?mO(c,e.applyTransform(r,!0),n.measuredBox):mO(c,i,n.layoutBox);const u=!sbe(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=Rs();gO(g,n.layoutBox,h.layoutBox);const b=Rs();gO(b,i,m.layoutBox),abe(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 S9e(e){Aw&&yg.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function k9e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function E9e(e){e.clearSnapshot()}function tW(e){e.clearMeasurements()}function C9e(e){e.isLayoutDirty=!1}function T9e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nW(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function A9e(e){e.resolveTargetDelta()}function _9e(e){e.calcProjection()}function N9e(e){e.resetSkewAndRotation()}function j9e(e){e.removeLeadSnapshot()}function iW(e,t,n){e.translate=vs(t.translate,0,n),e.scale=vs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rW(e,t,n,i){e.min=vs(t.min,n.min,i),e.max=vs(t.max,n.max,i)}function R9e(e,t,n,i){rW(e.x,t.x,n.x,i),rW(e.y,t.y,n.y,i)}function I9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const P9e={duration:.45,ease:[.4,0,.1,1]},sW=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aW=sW("applewebkit/")&&!sW("chrome/")?Math.round:ac;function oW(e){e.min=aW(e.min),e.max=aW(e.max)}function D9e(e){oW(e.x),oW(e.y)}function cbe(e,t,n){return e==="position"||e==="preserve-aspect"&&!$8e(Zq(t),Zq(n),.2)}function M9e(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const L9e=lbe({attachResizeListener:(e,t)=>pS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_D={current:void 0},ube=lbe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_D.current){const e=new L9e({});e.mount(window),e.setOptions({layoutScroll:!0}),_D.current=e}return _D.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),$9e={pan:{Feature:e9e},drag:{Feature:J8e,ProjectionNode:ube,MeasureLayout:nbe}};function F9e(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 dbe(e,t){const n=F9e(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function lW(e){return t=>{t.pointerType==="touch"||qge()||e(t)}}function B9e(e,t,n={}){const[i,r,s]=dbe(e,n),a=lW(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=lW(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function cW(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class U9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=B9e(t,n=>(cW(this.node,n,"Start"),i=>cW(this.node,i,"End"))))}unmount(){}}class Q9e extends Mm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fk(pS(this.node.current,"focus",()=>this.onFocus()),pS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const fbe=(e,t)=>t?e===t?!0:fbe(e,t.parentElement):!1,z9e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function V9e(e){return z9e.has(e.tagName)||e.tabIndex!==-1}const _w=new WeakSet;function uW(e){return t=>{t.key==="Enter"&&e(t)}}function ND(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const H9e=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=uW(()=>{if(_w.has(n))return;ND(n,"down");const r=uW(()=>{ND(n,"up")}),s=()=>ND(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 dW(e){return NF(e)&&!qge()}function q9e(e,t,n={}){const[i,r,s]=dbe(e,n),a=l=>{const c=l.currentTarget;if(!dW(l)||_w.has(c))return;_w.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!dW(m)||!_w.has(c))&&(_w.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||fbe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!V9e(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>H9e(u,r),r)}),s}function fW(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class W9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=q9e(t,n=>(fW(this.node,n,"Start"),(i,{success:r})=>fW(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const c4=new WeakMap,jD=new WeakMap,G9e=e=>{const t=c4.get(e.target);t&&t(e)},K9e=e=>{e.forEach(G9e)};function X9e({root:e,...t}){const n=e||document;jD.has(n)||jD.set(n,{});const i=jD.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(K9e,{root:e,...t})),i[r]}function Y9e(e,t,n){const i=X9e(t);return c4.set(e,n),i.observe(e),()=>{c4.delete(e),i.unobserve(e)}}const Z9e={some:0,all:1};class J9e extends Mm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Z9e[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 Y9e(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eFe(t,n))&&this.startObserver()}unmount(){}}function eFe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tFe={inView:{Feature:J9e},tap:{Feature:W9e},focus:{Feature:Q9e},hover:{Feature:U9e}},nFe={layout:{ProjectionNode:ube,MeasureLayout:nbe}},R_={current:null},jF={current:!1};function hbe(){if(jF.current=!0,!!eF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R_.current=e.matches;e.addListener(t),t()}else R_.current=!1}const iFe=[...Pge,fo,hm],rFe=e=>iFe.find(Ige(e)),hW=new WeakMap;function sFe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(mo(r))e.addValue(i,r);else if(mo(s))e.addValue(i,fS(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(i);e.addValue(i,fS(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const pW=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class aFe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=CF,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=Pd.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),jF.current||hbe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:R_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hW.delete(this.current),this.projection&&this.projection.unmount(),fm(this.notifyUpdate),fm(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Hb.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Kr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Pv){const n=Pv[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rs()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=fS(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(jge(r)||Oge(r))?r=parseFloat(r):!rFe(r)&&hm.test(n)&&(r=Age(t,n)),this.setBaseTarget(t,mo(r)?r.get():r)),mo(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const a=aF(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(r=a[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mo(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new bF),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class pbe extends aFe{constructor(){super(...arguments),this.KeyframeResolver=Dge}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function oFe(e){return window.getComputedStyle(e)}class lFe extends pbe{constructor(){super(...arguments),this.type="html",this.renderInstance=tge}readValueFromInstance(t,n){if(Hb.has(n)){const i=EF(n);return i&&i.default||0}else{const i=oFe(t),r=(Zme(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ebe(t,n)}build(t,n,i){cF(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return hF(t,n,i)}}class cFe extends pbe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Rs}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Hb.has(n)){const i=EF(n);return i&&i.default||0}return n=nge.has(n)?n:iF(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return sge(t,n,i)}build(t,n,i){uF(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){ige(t,n,i,r)}mount(t){this.isSVGTag=fF(t.tagName),super.mount(t)}}const uFe=(e,t)=>sF(e)?new cFe(t):new lFe(t,{allowProjection:e!==p.Fragment}),dFe=L6e({...A8e,...tFe,...$9e,...nFe},uFe),pr=Z4e(dFe);function RF(){!jF.current&&hbe();const[e]=p.useState(R_.current);return e}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function J0(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 fFe=["container"];function hFe(e){var t=e.container,n=t===void 0?document.body:t,i=Gj(e,fFe);return Li.createPortal(ii.createElement("div",pa({},i)),n)}function pFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function mFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function gFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function bFe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function gW(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,a=r.clientY;return[(n+s)/2,(i+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-i,2))]}return[n,i,0]}var wp=function(e,t,n,i){var r,s=n*t,a=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&a-e<=0?(r=2,l=a):e<0&&a+e<=0&&(r=3,l=-a),[r,l]};function RD(e,t,n,i,r,s,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=wp(e,s,n,innerWidth)[0],f=wp(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:a-s/r*(a-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:a,lastCY:l}}function f4(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function ID(e,t,n){var i=f4(n,innerWidth,innerHeight),r=i[0],s=i[1],a=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?a=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function XC(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,a=s===void 0?r||0:s,l=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 vFe={T:0,L:0,W:0,H:0,FIT:void 0},gbe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},xFe=["className"];function wFe(e){var t=e.className,n=t===void 0?"":t,i=Gj(e,xFe);return ii.createElement("div",pa({className:"PhotoView__Spinner "+n},i),ii.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ii.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ii.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var OFe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function SFe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=Gj(e,OFe),u=gbe();return t&&!i?ii.createElement(ii.Fragment,null,ii.createElement("img",pa({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?ii.createElement("span",{className:"PhotoView__icon"},a):ii.createElement(wFe,{className:"PhotoView__icon"}))):l?ii.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var kFe={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 EFe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,a=t.height,l=a===void 0?0:a,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,O=e.onReachMove,w=e.onReachUp,k=e.onPhotoResize,S=e.isActive,E=e.expose,C=I_(kFe),N=C[0],_=C[1],j=p.useRef(0),A=gbe(),F=N.naturalWidth,T=F===void 0?s:F,P=N.naturalHeight,R=P===void 0?l:P,L=N.width,M=L===void 0?s:L,U=N.height,I=U===void 0?l:U,H=N.loaded,K=H===void 0?!n:H,Q=N.broken,q=N.x,B=N.y,ee=N.touched,le=N.stopRaf,se=N.maskTouched,re=N.rotate,ge=N.scale,W=N.CX,X=N.CY,ae=N.lastX,ue=N.lastY,Oe=N.lastCX,ke=N.lastCY,st=N.lastScale,Le=N.touchTime,Me=N.touchLength,Ie=N.pause,qe=N.reach,Ae=nb({onScale:function(Pe){return ze(KC(Pe))},onRotate:function(Pe){re!==Pe&&(E({rotate:Pe}),_(pa({rotate:Pe},ID(T,R,Pe))))}});function ze(Pe,Et,bt){ge!==Pe&&(E({scale:Pe}),_(pa({scale:Pe},RD(q,B,M,I,ge,Pe,Et,bt),Pe<=1&&{x:0,y:0})))}var Ee=XC(function(Pe,Et,bt){if(bt===void 0&&(bt=0),(ee||se)&&S){var Mt=f4(re,M,I),$e=Mt[0],ye=Mt[1];if(bt===0&&j.current===0){var Ue=Math.abs(Pe-W)<=20,Ke=Math.abs(Et-X)<=20;if(Ue&&Ke)return void _({lastCX:Pe,lastCY:Et});j.current=Ue?Et>X?3:2:1}var ft,ut=Pe-Oe,Gt=Et-ke;if(bt===0){var Rt=wp(ut+ae,ge,$e,innerWidth)[0],zt=wp(Gt+ue,ge,ye,innerHeight);ft=function(Bt,Qe,tt,ht){return Qe&&Bt===1||ht==="x"?"x":tt&&Bt>1||ht==="y"?"y":void 0}(j.current,Rt,zt[0],qe),ft!==void 0&&O(ft,Pe,Et,ge)}if(ft==="x"||se)return void _({reach:"x"});var Z=KC(ge+(bt-Me)/100/2*ge,T/M,.2);E({scale:Z}),_(pa({touchLength:bt,reach:ft,scale:Z},RD(q,B,M,I,ge,Z,Pe,Et,ut,Gt)))}},{maxWait:8});function De(Pe){return!le&&!ee&&(A.current&&_(pa({},Pe,{pause:u})),A.current)}var J,he,_e,Ze,at,wt,Se,ve,He=(at=function(Pe){return De({x:Pe})},wt=function(Pe){return De({y:Pe})},Se=function(Pe){return A.current&&(E({scale:Pe}),_({scale:Pe})),!ee&&A.current},ve=nb({X:function(Pe){return at(Pe)},Y:function(Pe){return wt(Pe)},S:function(Pe){return Se(Pe)}}),function(Pe,Et,bt,Mt,$e,ye,Ue,Ke,ft,ut,Gt){var Rt=f4(ut,$e,ye),zt=Rt[0],Z=Rt[1],Bt=wp(Pe,Ke,zt,innerWidth),Qe=Bt[0],tt=Bt[1],ht=wp(Et,Ke,Z,innerHeight),pe=ht[0],We=ht[1],vt=Date.now()-Gt;if(vt>=200||Ke!==Ue||Math.abs(ft-Ue)>1){var vn=RD(Pe,Et,$e,ye,Ue,Ke),Ki=vn.x,Fe=vn.y,Pt=Qe?tt:Ki!==Pe?Ki:null,pn=pe?We:Fe!==Et?Fe:null;return Pt!==null&&Cg(Pe,Pt,ve.X),pn!==null&&Cg(Et,pn,ve.Y),void(Ke!==Ue&&Cg(Ue,Ke,ve.S))}var Jt=(Pe-bt)/vt,en=(Et-Mt)/vt,Un=Math.sqrt(Math.pow(Jt,2)+Math.pow(en,2)),wn=!1,oi=!1;(function(Oi,mi){var bn,qi=Oi,ri=0,zi=0,as=function(xs){bn||(bn=xs);var os=xs-bn,ia=Math.sign(Oi),Nr=-.001*ia,As=Math.sign(-qi)*Math.pow(qi,2)*2e-4,Vs=qi*os+(Nr+As)*Math.pow(os,2)/2;ri+=Vs,bn=xs,ia*(qi+=(Nr+As)*os)<=0?_r():mi(ri)?Lr():_r()};function Lr(){zi=requestAnimationFrame(as)}function _r(){cancelAnimationFrame(zi)}Lr()})(Un,function(Oi){var mi=Pe+Oi*(Jt/Un),bn=Et+Oi*(en/Un),qi=wp(mi,Ue,zt,innerWidth),ri=qi[0],zi=qi[1],as=wp(bn,Ue,Z,innerHeight),Lr=as[0],_r=as[1];if(ri&&!wn&&(wn=!0,Qe?Cg(mi,zi,ve.X):bW(zi,mi+(mi-zi),ve.X)),Lr&&!oi&&(oi=!0,pe?Cg(bn,_r,ve.Y):bW(_r,bn+(bn-_r),ve.Y)),wn&&oi)return!1;var xs=wn||ve.X(zi),os=oi||ve.Y(_r);return xs&&os})}),Je=(J=y,he=function(Pe,Et){qe||ze(ge!==1?1:Math.max(2,T/M),Pe,Et)},_e=p.useRef(0),Ze=XC(function(){_e.current=0,J.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Pe=[].slice.call(arguments);_e.current+=1,Ze.apply(void 0,Pe),_e.current>=2&&(Ze.cancel(),_e.current=0,he.apply(void 0,Pe))});function Ce(Pe,Et){if(j.current=0,(ee||se)&&S){_({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var bt=KC(ge,T/M);if(He(q,B,ae,ue,M,I,ge,bt,st,re,Le),w(Pe,Et),W===Pe&&X===Et){if(ee)return void Je(Pe,Et);se&&x(Pe,Et)}}}function Wt(Pe,Et,bt){bt===void 0&&(bt=0),_({touched:!0,CX:Pe,CY:Et,lastCX:Pe,lastCY:Et,lastX:q,lastY:B,lastScale:ge,touchLength:bt,touchTime:Date.now()})}function ln(Pe){_({maskTouched:!0,CX:Pe.clientX,CY:Pe.clientY,lastX:q,lastY:B})}J0(Ef?void 0:"mousemove",function(Pe){Pe.preventDefault(),Ee(Pe.clientX,Pe.clientY)}),J0(Ef?void 0:"mouseup",function(Pe){Ce(Pe.clientX,Pe.clientY)}),J0(Ef?"touchmove":void 0,function(Pe){Pe.preventDefault();var Et=gW(Pe);Ee.apply(void 0,Et)},{passive:!1}),J0(Ef?"touchend":void 0,function(Pe){var Et=Pe.changedTouches[0];Ce(Et.clientX,Et.clientY)},{passive:!1}),J0("resize",XC(function(){K&&!ee&&(_(ID(T,R,re)),k())},{maxWait:8})),d4(function(){S&&E(pa({scale:ge,rotate:re},Ae))},[S]);var cn=function(Pe,Et,bt,Mt,$e,ye,Ue,Ke,ft,ut){var Gt=function(Ki,Fe,Pt,pn,Jt){var en=p.useRef(!1),Un=I_({lead:!0,scale:Pt}),wn=Un[0],oi=wn.lead,Oi=wn.scale,mi=Un[1],bn=XC(function(qi){try{return Jt(!0),mi({lead:!1,scale:qi}),Promise.resolve()}catch(ri){return Promise.reject(ri)}},{wait:pn});return d4(function(){en.current?(Jt(!1),mi({lead:!0}),bn(Pt)):en.current=!0},[Pt]),oi?[Ki*Oi,Fe*Oi,Pt/Oi]:[Ki*Pt,Fe*Pt,1]}(ye,Ue,Ke,ft,ut),Rt=Gt[0],zt=Gt[1],Z=Gt[2],Bt=function(Ki,Fe,Pt,pn,Jt){var en=p.useState(vFe),Un=en[0],wn=en[1],oi=p.useState(0),Oi=oi[0],mi=oi[1],bn=p.useRef(),qi=nb({OK:function(){return Ki&&mi(4)}});function ri(zi){Jt(!1),mi(zi)}return p.useEffect(function(){if(bn.current||(bn.current=Date.now()),Pt){if(function(zi,as){var Lr=zi&&zi.current;if(Lr&&Lr.nodeType===1){var _r=Lr.getBoundingClientRect();as({T:_r.top,L:_r.left,W:_r.width,H:_r.height,FIT:Lr.tagName==="IMG"?getComputedStyle(Lr).objectFit:void 0})}}(Fe,wn),Ki)return Date.now()-bn.current<250?(mi(1),requestAnimationFrame(function(){mi(2),requestAnimationFrame(function(){return ri(3)})}),void setTimeout(qi.OK,pn)):void mi(4);ri(5)}},[Ki,Pt]),[Oi,Un]}(Pe,Et,bt,ft,ut),Qe=Bt[0],tt=Bt[1],ht=tt.W,pe=tt.FIT,We=innerWidth/2,vt=innerHeight/2,vn=Qe<3||Qe>4;return[vn?ht?tt.L:We:Mt+(We-ye*Ke/2),vn?ht?tt.T:vt:$e+(vt-Ue*Ke/2),Rt,vn&&pe?Rt*(tt.H/ht):zt,Qe===0?Z:vn?ht/(ye*Ke)||.01:Z,vn?pe?1:0:1,Qe,pe]}(u,c,K,q,B,M,I,ge,d,function(Pe){return _({pause:Pe})}),Ot=cn[4],jt=cn[6],ot="transform "+d+"ms "+f,gt={className:m,onMouseDown:Ef?void 0:function(Pe){Pe.stopPropagation(),Pe.button===0&&Wt(Pe.clientX,Pe.clientY,0)},onTouchStart:Ef?function(Pe){Pe.stopPropagation(),Wt.apply(void 0,gW(Pe))}:void 0,onWheel:function(Pe){if(!qe){var Et=KC(ge-Pe.deltaY/100/2,T/M);_({stopRaf:!0}),ze(Et,Pe.clientX,Pe.clientY)}},style:{width:cn[2]+"px",height:cn[3]+"px",opacity:cn[5],objectFit:jt===4?void 0:cn[7],transform:re?"rotate("+re+"deg)":void 0,transition:jt>2?ot+", opacity "+d+"ms ease, height "+(jt<4?d/2:jt>4?d:0)+"ms "+f:void 0}};return ii.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!Ef&&S?ln:void 0,onTouchStart:Ef&&S?function(Pe){return ln(Pe.touches[0])}:void 0},ii.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ot+", 0, 0, "+Ot+", "+cn[0]+", "+cn[1]+")",transition:ee||Ie?void 0:ot,willChange:S?"transform":void 0}},n?ii.createElement(SFe,pa({src:n,loaded:K,broken:Q},gt,{onPhotoLoad:function(Pe){_(pa({},Pe,Pe.loaded&&ID(Pe.naturalWidth||0,Pe.naturalHeight||0,re)))},loadingElement:b,brokenElement:v})):i&&i({attrs:gt,scale:Ot,rotate:re})))}var yW={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 CFe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,a=e.maskClosable,l=a===void 0||a,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,O=e.photoWrapClassName,w=e.loadingElement,k=e.brokenElement,S=e.images,E=e.index,C=E===void 0?0:E,N=e.onIndexChange,_=e.visible,j=e.onClose,A=e.afterClose,F=e.portalContainer,T=I_(yW),P=T[0],R=T[1],L=p.useState(0),M=L[0],U=L[1],I=P.x,H=P.touched,K=P.pause,Q=P.lastCX,q=P.lastCY,B=P.bg,ee=B===void 0?u:B,le=P.lastBg,se=P.overlay,re=P.minimal,ge=P.scale,W=P.rotate,X=P.onScale,ae=P.onRotate,ue=e.hasOwnProperty("index"),Oe=ue?C:M,ke=ue?N:U,st=p.useRef(Oe),Le=S.length,Me=S[Oe],Ie=typeof n=="boolean"?n:Le>n,qe=function(Ot,jt){var ot=p.useReducer(function(bt){return!bt},!1)[1],gt=p.useRef(0),Pe=function(bt){var Mt=p.useRef(bt);function $e(ye){Mt.current=ye}return p.useMemo(function(){(function(ye){Ot?(ye(Ot),gt.current=1):gt.current=2})($e)},[bt]),[Mt.current,$e]}(Ot),Et=Pe[1];return[Pe[0],gt.current,function(){ot(),gt.current===2&&(Et(!1),jt&&jt()),gt.current=0}]}(_,A),Ae=qe[0],ze=qe[1],Ee=qe[2];d4(function(){if(Ae)return R({pause:!0,x:Oe*-(innerWidth+_0)}),void(st.current=Oe);R(yW)},[Ae]);var De=nb({close:function(Ot){ae&&ae(0),R({overlay:!0,lastBg:ee}),j(Ot)},changeIndex:function(Ot,jt){jt===void 0&&(jt=!1);var ot=Ie?st.current+(Ot-Oe):Ot,gt=Le-1,Pe=u4(ot,0,gt),Et=Ie?ot:Pe,bt=innerWidth+_0;R({touched:!1,lastCX:void 0,lastCY:void 0,x:-bt*Et,pause:jt}),st.current=Et,ke&&ke(Ie?Ot<0?gt:Ot>gt?0:Ot:Pe)}}),J=De.close,he=De.changeIndex;function _e(Ot){return Ot?J():R({overlay:!se})}function Ze(){R({x:-(innerWidth+_0)*Oe,lastCX:void 0,lastCY:void 0,pause:!0}),st.current=Oe}function at(Ot,jt,ot,gt){Ot==="x"?function(Pe){if(Q!==void 0){var Et=Pe-Q,bt=Et;!Ie&&(Oe===0&&Et>0||Oe===Le-1&&Et<0)&&(bt=Et/2),R({touched:!0,lastCX:Q,x:-(innerWidth+_0)*st.current+bt,pause:!1})}else R({touched:!0,lastCX:Pe,x:I,pause:!1})}(jt):Ot==="y"&&function(Pe,Et){if(q!==void 0){var bt=u===null?null:u4(u,.01,u-Math.abs(Pe-q)/100/4);R({touched:!0,lastCY:q,bg:Et===1?bt:u,minimal:Et===1})}else R({touched:!0,lastCY:Pe,bg:ee,minimal:!0})}(ot,gt)}function wt(Ot,jt){var ot=Ot-(Q??Ot),gt=jt-(q??jt),Pe=!1;if(ot<-40)he(Oe+1);else if(ot>40)he(Oe-1);else{var Et=-(innerWidth+_0)*st.current;Math.abs(gt)>100&&re&&f&&(Pe=!0,J()),R({touched:!1,x:Et,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Pe||se})}}J0("keydown",function(Ot){if(_)switch(Ot.key){case"ArrowLeft":he(Oe-1,!0);break;case"ArrowRight":he(Oe+1,!0);break;case"Escape":J()}});var Se=function(Ot,jt,ot){return p.useMemo(function(){var gt=Ot.length;return ot?Ot.concat(Ot).concat(Ot).slice(gt+jt-1,gt+jt+2):Ot.slice(Math.max(jt-1,0),Math.min(jt+2,gt+1))},[Ot,jt,ot])}(S,Oe,Ie);if(!Ae)return null;var ve=se&&!ze,He=_?ee:le,Je=X&&ae&&{images:S,index:Oe,visible:_,onClose:J,onIndexChange:he,overlayVisible:ve,overlay:Me&&Me.overlay,scale:ge,rotate:W,onScale:X,onRotate:ae},Ce=i?i(ze):400,Wt=r?r(ze):mW,ln=i?i(3):600,cn=r?r(3):mW;return ii.createElement(hFe,{className:"PhotoView-Portal"+(ve?"":" PhotoView-Slider__clean")+(_?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ot){return Ot.stopPropagation()},container:F},_&&ii.createElement(bFe,null),ii.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ze===1?" PhotoView-Slider__fadeIn":ze===2?" PhotoView-Slider__fadeOut":""),style:{background:He?"rgba(0, 0, 0, "+He+")":void 0,transitionTimingFunction:Wt,transitionDuration:(H?0:Ce)+"ms",animationDuration:Ce+"ms"},onAnimationEnd:Ee}),m&&ii.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ii.createElement("div",{className:"PhotoView-Slider__Counter"},Oe+1," / ",Le),ii.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Je&&b(Je),ii.createElement(pFe,{className:"PhotoView-Slider__toolbarIcon",onClick:J}))),Se.map(function(Ot,jt){var ot=Ie||Oe!==0?st.current-1+jt:Oe+jt;return ii.createElement(EFe,{key:Ie?Ot.key+"/"+Ot.src+"/"+ot:Ot.key,item:Ot,speed:Ce,easing:Wt,visible:_,onReachMove:at,onReachUp:wt,onPhotoTap:function(){return _e(s)},onMaskTap:function(){return _e(l)},wrapClassName:O,className:x,style:{left:(innerWidth+_0)*ot+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:H||K?void 0:"transform "+ln+"ms "+cn},loadingElement:w,brokenElement:k,onPhotoResize:Ze,isActive:st.current===ot,expose:R})}),!Ef&&m&&ii.createElement(ii.Fragment,null,(Ie||Oe!==0)&&ii.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return he(Oe-1,!0)}},ii.createElement(mFe,null)),(Ie||Oe+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,a)}}),m=nb({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=p.useMemo(function(){return pa({},a,h)},[a,h]);return ii.createElement(mbe.Provider,{value:g},t,ii.createElement(CFe,pa({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var bbe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(mbe),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=nb({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(x,O){if(d){var w=d.props[x];w&&w(O)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:a,height:l})},[i]),d?p.Children.only(p.cloneElement(d,pa({},b,{ref:m}))):null};const NFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),jFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),RFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),Kj=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),YC=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),IFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),o.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),Lv=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),ybe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),PFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),DFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),MFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),IF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),LFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),PF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),$Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),FFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),BFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),UFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),QFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),zFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),VFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),vbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),HFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),o.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),qFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),WFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),o.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),vW=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),GFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),xbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),wbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),KFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),XFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),YFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),ZFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),JFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),K2=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),e7e=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),t7e=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Obe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),o.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),DF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t7e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Obe=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + */const n7e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sbe=(...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 n7e={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 i7e={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 i7e=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:a,...l},c)=>p.createElement("svg",{ref:c,...n7e,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Obe("lucide",r),...l},[...a.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + */const r7e=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:a,...l},c)=>p.createElement("svg",{ref:c,...i7e,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Sbe("lucide",r),...l},[...a.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(i7e,{ref:s,iconNode:t,className:Obe(`lucide-${t7e(e)}`,i),...r}));return n.displayName=`${e}`,n};/** + */const hn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(r7e,{ref:s,iconNode:t,className:Sbe(`lucide-${n7e(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 Sbe=hn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const kbe=hn("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 r7e=hn("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 s7e=hn("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. @@ -139,27 +139,27 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s7e=hn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const a7e=hn("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 kbe=hn("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 Ebe=hn("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 Ebe=hn("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 Cbe=hn("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 a7e=hn("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 o7e=hn("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 o7e=hn("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 l7e=hn("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. @@ -169,12 +169,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const l7e=hn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const c7e=hn("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 c7e=hn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const u7e=hn("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. @@ -189,7 +189,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const u7e=hn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const d7e=hn("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. @@ -199,12 +199,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d7e=hn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const f7e=hn("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 f7e=hn("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 h7e=hn("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. @@ -214,12 +214,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const h7e=hn("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const p7e=hn("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 p7e=hn("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 m7e=hn("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. @@ -244,17 +244,17 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const m7e=hn("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 g7e=hn("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 g7e=hn("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 b7e=hn("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 b7e=hn("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 y7e=hn("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. @@ -264,22 +264,22 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const y7e=hn("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 v7e=hn("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 Cbe=hn("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 Tbe=hn("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 v7e=hn("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 x7e=hn("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 x7e=hn("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 w7e=hn("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. @@ -289,17 +289,17 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const w7e=hn("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 O7e=hn("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 O7e=hn("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 S7e=hn("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 S7e=hn("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 k7e=hn("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. @@ -319,12 +319,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tbe=hn("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 Abe=hn("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 k7e=hn("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 E7e=hn("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. @@ -334,12 +334,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const E7e=hn("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 C7e=hn("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 C7e=hn("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 T7e=hn("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. @@ -349,27 +349,27 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T7e=hn("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const A7e=hn("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 Abe=hn("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 _be=hn("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 A7e=hn("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 _7e=hn("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 _7e=hn("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 N7e=hn("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 N7e=hn("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const j7e=hn("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. @@ -379,17 +379,17 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const j7e=hn("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 R7e=hn("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 _be=hn("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 Nbe=hn("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 R7e=hn("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 I7e=hn("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. @@ -399,7 +399,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I7e=hn("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 P7e=hn("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. @@ -414,7 +414,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P7e=hn("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 D7e=hn("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. @@ -424,32 +424,32 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const D7e=hn("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 M7e=hn("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 M7e=hn("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 L7e=hn("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 Ba=hn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),OW="veadk_auth_qs",L7e=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let M1=null;function $7e(){if(M1!==null)return M1;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,a)=>{(i&&L7e.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(OW,r),M1=r):M1=sessionStorage.getItem(OW)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return M1}function Uo(e){const t=$7e();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}function V(e,t={}){return an.t(e,{...t,ns:"adk"})}function Hu(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",an.resolvedLanguage||an.language),t}function F7e(){return an.resolvedLanguage||an.language}const Wo=3e4,is=12e4,FF=1e4;function Ol(e,t=Wo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const D_="veadk_local_user",M_="veadk_local_user_tab",B7e="X-VeADK-OAuth-Refresh-Retry",U7e=[50,250],Q7e=/^[A-Za-z0-9]{1,16}$/;function Nbe(){try{const e=sessionStorage.getItem(M_);if(e)return e;const t=localStorage.getItem(D_);return t&&sessionStorage.setItem(M_,t),t}catch{try{return localStorage.getItem(D_)}catch{return null}}}function SW(e){try{sessionStorage.setItem(M_,e)}catch{}try{localStorage.setItem(D_,e)}catch{}}function z7e(){try{sessionStorage.removeItem(M_)}catch{}try{localStorage.removeItem(D_)}catch{}}function Dh(e){const t=new Headers(e),n=Nbe();return n&&t.set("X-VeADK-Local-User",n),t}async function jbe(){let e;try{e=await fetch("/web/auth-config",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,FF)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(V("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(V("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(V("identity.invalidConfigResponse"))}}function V7e(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function H7e(){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 q7e(){const[e,t]=await Promise.all([p4(),jbe()]);return e.status==="unauthenticated"&&t.length>0}function W7e(){window.location.assign("/oauth2/logout")}async function G7e(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,FF)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=U7e[e];if(t.status!==401||t.headers.get(B7e)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function p4(){const e=await G7e();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(V("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(V("identity.serviceFailed",{status:e.status}));const t=Nbe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function K7e(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 X7e(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const m4="veadk:authentication-required";let yO=null,Nw=null;function Y7e(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 Z7e(e){yO||(yO=new Promise(n=>{Nw=n}),window.dispatchEvent(new Event(m4)));const t=yO;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function J7e(){return yO!==null}function eBe(){Nw==null||Nw(),Nw=null,yO=null}async function Jj(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing"),s=n.trim().slice(0,2e3),a=s?` -${V("common.response",{response:s})}`:"";throw new Error(V("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:a}))}}const tBe=/\brun_sse\s*failed\s*:\s*404\b/i,nBe=/session not found/i,iBe=/(?:^|[::\s])not found\s*$/i,rBe=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,sBe=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,aBe=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function N0(e,t){return e.includes(t)?e:`${e} + */const Ba=hn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),OW="veadk_auth_qs",$7e=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let M1=null;function F7e(){if(M1!==null)return M1;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,a)=>{(i&&$7e.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(OW,r),M1=r):M1=sessionStorage.getItem(OW)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return M1}function Uo(e){const t=F7e();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}function V(e,t={}){return an.t(e,{...t,ns:"adk"})}function Hu(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",an.resolvedLanguage||an.language),t}function B7e(){return an.resolvedLanguage||an.language}const Wo=3e4,is=12e4,FF=1e4;function Ol(e,t=Wo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const D_="veadk_local_user",M_="veadk_local_user_tab",U7e="X-VeADK-OAuth-Refresh-Retry",Q7e=[50,250],z7e=/^[A-Za-z0-9]{1,16}$/;function jbe(){try{const e=sessionStorage.getItem(M_);if(e)return e;const t=localStorage.getItem(D_);return t&&sessionStorage.setItem(M_,t),t}catch{try{return localStorage.getItem(D_)}catch{return null}}}function SW(e){try{sessionStorage.setItem(M_,e)}catch{}try{localStorage.setItem(D_,e)}catch{}}function V7e(){try{sessionStorage.removeItem(M_)}catch{}try{localStorage.removeItem(D_)}catch{}}function Dh(e){const t=new Headers(e),n=jbe();return n&&t.set("X-VeADK-Local-User",n),t}async function Rbe(){let e;try{e=await fetch("/web/auth-config",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,FF)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(V("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(V("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(V("identity.invalidConfigResponse"))}}function H7e(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function q7e(){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 W7e(){const[e,t]=await Promise.all([p4(),Rbe()]);return e.status==="unauthenticated"&&t.length>0}function G7e(){window.location.assign("/oauth2/logout")}async function K7e(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,FF)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=Q7e[e];if(t.status!==401||t.headers.get(U7e)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function p4(){const e=await K7e();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(V("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(V("identity.serviceFailed",{status:e.status}));const t=jbe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function X7e(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 Y7e(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const m4="veadk:authentication-required";let yO=null,Nw=null;function Z7e(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 J7e(e){yO||(yO=new Promise(n=>{Nw=n}),window.dispatchEvent(new Event(m4)));const t=yO;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function eBe(){return yO!==null}function tBe(){Nw==null||Nw(),Nw=null,yO=null}async function Jj(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing"),s=n.trim().slice(0,2e3),a=s?` +${V("common.response",{response:s})}`:"";throw new Error(V("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:a}))}}const nBe=/\brun_sse\s*failed\s*:\s*404\b/i,iBe=/session not found/i,rBe=/(?:^|[::\s])not found\s*$/i,sBe=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,aBe=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,oBe=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function N0(e,t){return e.includes(t)?e:`${e} -${t}`}function Df(e){const t=String(e),n=V("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(rBe.test(t))i=N0(i,V("runSse.toolArgumentHint"));else{if(sBe.test(t))return N0(i,V("runSse.resourceCollectionExpiredHint"));if(aBe.test(t))return N0(i,V("runSse.modelQuotaHint"));tBe.test(t)&&(nBe.test(t)?i=N0(i,V("runSse.persistentMemoryHint")):iBe.test(t)&&(i=N0(i,V("runSse.unsupportedRouteHint"))))}return N0(i,V("runSse.networkConfigurationHint"))}async function*eR(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=a=>a.length>500?V("sse.truncatedData",{data:a.slice(0,500),count:a.length}):a,s=(a,l=!1)=>{const c=a.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(!(!c||c==="[DONE]"||c==="ping"))try{return JSON.parse(c)}catch{const u=r(c);throw l?new Error(V("sse.incompleteEvent",{data:u})):new Error(V("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:a,value:l}=await t.read();if(a)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const a=s(i,!0);a!==void 0&&(yield a)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const oBe="X-Studio-FaaS-Instance",lBe="X-Studio-FaaS-Request-Id";function cBe(e,t,n){var s,a;const i=((s=e.headers.get(oBe))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((a=e.headers.get(lBe))==null?void 0:a.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function kW(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 uBe(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 dBe(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 Rbe(e){var i;const t=[e.message],n=[e.statusCode?V("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?V("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function Df(e){const t=String(e),n=V("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(sBe.test(t))i=N0(i,V("runSse.toolArgumentHint"));else{if(aBe.test(t))return N0(i,V("runSse.resourceCollectionExpiredHint"));if(oBe.test(t))return N0(i,V("runSse.modelQuotaHint"));nBe.test(t)&&(iBe.test(t)?i=N0(i,V("runSse.persistentMemoryHint")):rBe.test(t)&&(i=N0(i,V("runSse.unsupportedRouteHint"))))}return N0(i,V("runSse.networkConfigurationHint"))}async function*eR(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=a=>a.length>500?V("sse.truncatedData",{data:a.slice(0,500),count:a.length}):a,s=(a,l=!1)=>{const c=a.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` +`);if(!(!c||c==="[DONE]"||c==="ping"))try{return JSON.parse(c)}catch{const u=r(c);throw l?new Error(V("sse.incompleteEvent",{data:u})):new Error(V("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:a,value:l}=await t.read();if(a)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const a=s(i,!0);a!==void 0&&(yield a)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const lBe="X-Studio-FaaS-Instance",cBe="X-Studio-FaaS-Request-Id";function uBe(e,t,n){var s,a;const i=((s=e.headers.get(lBe))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((a=e.headers.get(cBe))==null?void 0:a.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function kW(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 dBe(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 fBe(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 Ibe(e){var i;const t=[e.message],n=[e.statusCode?V("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?V("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` `)),e.detail&&e.detail!==e.message&&t.push(e.detail),e.responseBody&&!((i=e.detail)!=null&&i.includes(e.responseBody))&&t.push(V("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` -`)}async function fBe(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 hBe(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 Rbe({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 Ibe({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*hBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const a=new URLSearchParams({region:t,follow:String(r)});n&&a.set("instance_name",n),i&&a.set("session_id",i);const l=await fetch(Uo(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Hu(Dh({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await fBe(l)}));for await(const c of eR(l)){if(!dBe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const pBe=255,mBe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function gBe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!mBe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>pBe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const bBe=/RunPipeline result could not be reconciled|Polling build status failed/i;class jw extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");ki(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function Ibe(e){if(e instanceof jw)return!0;const t=e instanceof Error?e.message:String(e??"");return bBe.test(t)}function EW(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}const g4="ap-southeast-1",BF="cn-beijing",yBe="https://ark.ap-southeast.bytepluses.com/api/v3",vBe="https://ark.cn-beijing.volces.com/api/v3/",xBe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",wBe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",OBe="dola-seed-2-1-turbo-260628",SBe="doubao-seed-2-1-pro-260628",kBe="skylark-embedding-vision-250615",EBe="doubao-embedding-vision-250615",CBe="seed-2-0-lite-260228",TBe="doubao-seed-2-0-lite-260428",ABe="dola-seedream-5-0-pro-260628",_Be="doubao-seedream-5-0-260128",NBe="seededit-3-0-i2i-250628",jBe="doubao-seededit-3-0-i2i-250628",RBe="dreamina-seedance-2-0-260128",IBe="doubao-seedance-2-0-260128";function Iu(e){return e==="byteplus"?[{value:g4,label:g4}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function Ji(e){var t;return((t=Iu(e)[0])==null?void 0:t.value)||BF}const PBe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function tR(e){return typeof e=="string"&&PBe.has(e)}function xh(e,t){var i;return((i=(t?Iu(t):[...Iu("volcengine"),...Iu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function wh(e){return e==="byteplus"?OBe:SBe}function xl(e){return e==="byteplus"?yBe:vBe}function DBe(e){return e==="byteplus"?xBe:wBe}function MBe(e){return e==="byteplus"?kBe:EBe}function LBe(e){return e==="byteplus"?CBe:TBe}function $Be(e){return e==="byteplus"?ABe:_Be}function FBe(e){return e==="byteplus"?NBe:jBe}function BBe(e){return e==="byteplus"?RBe:IBe}const UF="veadk.messageFeedback.v1";function QF(e,t,n,i){return[e,t,n,i].join(":")}function zF(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(UF)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function UBe(e,t,n){if(typeof window>"u")return;const i=zF();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(UF,JSON.stringify(i))}function Pbe(e){if(typeof window>"u")return;const t=QF(e.runtimeId,e.appName,e.userId,e.sessionId),n=zF(),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(UF,JSON.stringify(n))}}const Z2="",VF=new Map;function Dbe(e,t){VF.set(e,t)}function Mbe(){VF.clear()}function Sl(e){const t=VF.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function kt(e,t={},n={},i=Wo){const r=Ol(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Hu(Dh(t.headers))},l=()=>{const d={...a,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Uo(`${Z2}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Uo(`${Z2}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Uo(`${Z2}${e}`),d)},c=async d=>{if(Y7e(d))return!0;if(d.status!==401)return!1;try{return await q7e()}catch{return!1}};let u=await l();for(;await c(u);)await Z7e(r),u=await l();return u}function An(e,t={},n=Wo){return kt(e,t,{},n)}function QBe(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 on(e,t){const n=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),i=await e.text().catch(()=>"");if(!i)return n;try{const r=JSON.parse(i),s=QBe(r.detail??r.error);return s?V("client.errorWithDetailAndRawResponse",{context:n,detail:s,response:i}):V("client.errorWithRawResponse",{context:n,response:i})}catch{return V("client.errorWithRawResponse",{context:n,response:i})}}async function HF(e,t=!1){const n=await kt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await on(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Lbe(e,t){const n=await kt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await on(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Ex(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true");const n=t.toString(),i=await kt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.loadModelsFailed")));return await i.json()}async function $be(){const e=await kt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Cx extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ds extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const Fbe=()=>V("client.privateRuntimeUnavailable"),Bbe=()=>V("client.runtimeTemporarilyUnavailable"),CW=["cn-beijing","cn-shanghai"],zBe=3e4,Tx=5*60*1e3,Ube=60*1e3;let gS="volcengine";const Xy=new Map,vg=new Map,xg=new Map,Su=new Map,kr=new Map;function qF(e,t,n){return`${t}:${e}:${n??""}`}function Qbe(e){e!==gS&&kr.clear(),gS=e}function Qk(e){const t=(e||"").trim();if(gS==="byteplus")return[t&&!t.startsWith("cn-")?t:g4];const n=t&&!t.startsWith("ap-")?t:BF;return CW.includes(n)?[n,...CW.filter(i=>i!==n)]:[n]}function nR(e){const t=(e||"").trim();return t?[t]:Qk()}function qb(...e){return e.map(t=>String(t??"")).join("")}function Lm(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function WF(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function ZC(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function zbe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function zk(e,t,n,i,r=Wo){const s=await kt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await zbe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Cx;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new Ds(Fbe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new Ds(Bbe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ds(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ds(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await on(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ds(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ds(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&Xy.set(qF(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+zBe}),c}async function Vbe(e,t){const{app:n,ep:i}=Sl(e),r=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const a=V("client.createSessionFailedWithStatus",{status:r.status}),l=await on(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function GF(e,t){const{app:n,ep:i}=Sl(e),r=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function iR(e,t,n){const{app:i,ep:r}=Sl(e),s=await kt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await on(s,V("client.getSessionFailed"));throw new Error(V("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const a=await s.json();if(r.runtimeId){const l=QF(r.runtimeId,i,t,n);a.state={...zF()[l]??{},...a.state??{}}}return a}async function Hbe(e){const{app:t,ep:n}=Sl(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await kt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},is);if(!i.ok)throw new Error(await on(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=QF(n.runtimeId,t,e.userId,e.sessionId);return UBe(s,e.eventId,r),r}async function rR(e,t={}){const n=qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Lm(Su,n,Ube);if(!t.force&&i)return i;const r=Su.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of nR(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await kt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return WF(Su,n,await u.json());s=new Error(await on(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();Su.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Su.get(n);(l==null?void 0:l.promise)===a&&Su.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function b4(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await kt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await on(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function qbe(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await kt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await on(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function Wbe(e){return Lm(Su,qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),Ube)}function VBe(e){rR(e).catch(()=>{})}function Gbe(e){rR(e,{force:!0}).catch(()=>{})}function Kbe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function J2(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of Su.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const a=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...a]:a;Su.set(i,{value:{...s,sets:Kbe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function Xbe(e){let t=null;for(const n of nR(e.region)){const i=await kt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},is);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of Su.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));Su.set(a,{value:{...c,sets:Kbe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await on(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function y4(e,t,n){const{app:i,ep:r}=Sl(e),s=await kt(`/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 HBe(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 Ybe(e,t,n,i,r){const{app:s,ep:a}=Sl(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await kt(c,{},a,is);if(!u.ok)throw new Error(await on(u,V("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(V("client.fileUnavailable"));const h=HBe(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 XF(e,t,n,i,r){const{blob:s}=await Ybe(e,t,n,i,r);return URL.createObjectURL(s)}async function qBe(e){const t=await kt("/web/media/capabilities");if(!t.ok)throw new Error(await on(t,"media capabilities failed"));return t.json()}async function Zbe(e,t,n,i){const{app:r}=Sl(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const a=await kt("/web/media",{method:"POST",body:s},{},is);if(!a.ok)throw new Error(await on(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function v4(e,t,n){const{app:i}=Sl(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await kt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await on(s,"media cleanup failed"))}function Jbe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function eA(e,t){const n=Jbe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await kt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await on(i,"media cleanup failed"))}function e0e(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=Jbe(t);if(!n)return t;const i=`${n}/content`;return Uo(`${Z2}${i}`)}async function L_(e,t,n){const{app:i,ep:r}=Sl(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await kt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await kt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await on(s,V("client.loadTraceFailed")));const a=s.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||V("client.contentTypeMissing");throw new Error(V("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(V("client.invalidTraceFormat"));return l}async function x4(e){const t=await kt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await on(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function t0e(e,t,n=!0){const i=await kt(`/web/agent-info/${e}`,{},t);if(!i.ok)throw new Error(`agent-info failed: ${i.status}`);const r=await i.json();if(n&&!r.draft)try{const s=await kt(`/web/agent-draft/${e}`,{},t);if(s.ok){const a=await s.json();r.draft=a.draft}}catch{}return{appName:e,name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function w4(e){const{app:t,ep:n}=Sl(e);return t0e(t,n,!1)}async function WBe(e,t,n){let i=null;for(const r of Qk(t)){const s={runtimeId:e,region:r};try{const a=qF(e,r),l=Xy.get(a);l&&l.expiresAt<=Date.now()&&Xy.delete(a);const c=Xy.get(a),u=n||(c==null?void 0:c.apps[0])||(await zk("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return t0e(u,s)}catch(a){if(a instanceof Cx||a instanceof Ds&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function YF(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=qb(e,t||"cn-beijing",r??""),l=Lm(vg,a,Tx);if(!s.force&&l)return l;const c=vg.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=WBe(e,t,r).then(d=>WF(vg,a,d));vg.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=vg.get(a);(d==null?void 0:d.promise)===u&&vg.set(a,{value:d.value,updatedAt:d.updatedAt})}}function n0e(e,t,n=""){return Lm(vg,qb(e,t||"cn-beijing",n),Tx)}function i0e(e,t,n=""){YF(e,t,n).catch(()=>{})}async function r0e(e,t,n,i){const{app:r,ep:s}=Sl(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await kt(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await on(l,V("client.agentSearchFailed")));return l.json()}async function s0e(e,t){const{app:n}=Sl(e),i=await kt(`/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 a0e(){return Df(V("client.emptySseBody"))}function tA(){return Df(V("client.noDisplayableSseReply"))}const GBe=3e4;function $v(){return Df(V("client.firstSseEventTimeout"))}function o0e(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(a))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},a=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error($v())))},GBe);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*O4({appName:e,userId:t,sessionId:n,text:i,attachments:r=[],invocation:s,platformTools:a,environmentMounts:l,environmentMount:c,functionResponses:u=[],signal:d,onRuntimeContext:f}){const{app:h,ep:m}=Sl(e),g=r.flatMap(k=>k.status&&k.status!=="ready"?[]:k.uri?[{fileData:{mimeType:k.mimeType,fileUri:k.uri,displayName:k.name},partMetadata:{veadkMedia:{id:k.id,uri:k.uri,name:k.name,mimeType:k.mimeType,sizeBytes:k.sizeBytes}}}]:k.data?[{inlineData:{mimeType:k.mimeType,data:k.data,displayName:k.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(k=>({functionResponse:{id:k.id,name:k.name,response:k.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const k=v[0],S=k.partMetadata;v[0]={...k,partMetadata:{...S,veadkInvocation:b}}}let y;const x=o0e(d);try{y=await kt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:h,user_id:t,session_id:n,new_message:{role:"user",parts:v},streaming:!0,...a!==void 0?{platform_tools:[...a]}:{},...l!==void 0?{environment_mounts:[...l]}:c?{environment_mount:c}:{},custom_metadata:b?{veadkInvocation:b}:void 0}),signal:x.signal},m,0)}catch(k){throw x.cleanup(),x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}const O=cBe(y,m.runtimeId??"",m.region??"");if(O&&(f==null||f(O)),!y.ok){x.cleanup();const k=await on(y,V("client.runSessionFailed"));throw new Error(Df(V("client.runSseFailedWithDetail",{status:y.status,detail:k})))}let w=!1;try{for await(const k of eR(y)){w=!0,x.clearDeadline();const S=k;typeof S.error=="string"&&(S.error=Df(S.error)),typeof S.errorMessage=="string"&&(S.errorMessage=Df(S.errorMessage)),typeof S.error_message=="string"&&(S.error_message=Df(S.error_message)),yield S}}catch(k){throw x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}finally{x.cleanup()}if(!w)throw new Error(a0e())}async function sR(e,t){const n=new URLSearchParams({name:e,region:t}),i=await kt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(V("client.invalidRuntimeNameCheck"));return{available:r.available}}async function l0e(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 kt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await on(i,V("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(V("client.invalidCloudResources"));const s=r.items.map(a=>{if(!a||typeof a!="object"||typeof a.id!="string"||typeof a.name!="string"||typeof a.region!="string"||typeof a.status!="string")throw new Error(V("client.invalidCloudResources"));return a});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function c0e(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(V("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(V("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(V("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(V("client.environmentMountMismatch"));return i})}async function u0e({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Sl(t);let a;try{a=await kt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(V("client.environmentMountNetworkFailed")):l}if(!a.ok)throw new Error(await on(a,V("client.environmentMountFailed")));return c0e(await a.json(),r)}function ZF(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 d0e(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(V("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(V("client.clipboardWriteFailed"))}}const TW={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 f0e(e){var r;const t=await kt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(V("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(V("client.invalidSystemInfo"));return s}).sort((s,a)=>(TW[s.kind]??Number.MAX_SAFE_INTEGER)-(TW[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const h0e=new Set(["preparing","queued","building","scanning","available","failed"]);function JF(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!h0e.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(V("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(V("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function p0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!h0e.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function m0e(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(V("client.invalidImageRepository"));return t}function KBe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(V("client.invalidCodeRepository"));return t}function XBe(e){const t=m0e(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function e7(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:KBe(t.gitSource),containerRepository:m0e(t.containerRepository),imageSource:XBe(t.imageSource),latestVersion:JF(t.latestVersion)}}function g0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidWorkspace"));return t}async function t7(e){const t=await kt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(g0e)}async function b0e(e,t,n,i){const r=await kt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await on(r,V("client.saveWorkspaceFailed")));return g0e(await r.json())}function y0e(e,t){return b0e("/web/workspaces","POST",e,t)}function v0e(e,t,n){return b0e(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function x0e(e,t){const n=await kt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await on(n,V("client.deleteWorkspaceFailed")))}async function Vk(e){const t=await kt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(e7)}async function w0e(e,t){const n=await kt("/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 on(n,V("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(V("client.invalidRepositoryProbe"));return i}async function O0e(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(V("client.invalidEnvironmentCode"));return i}async function S0e(e,t){const n=await kt("/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 on(n,V("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeInspection"));const s=r,a=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||a===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:a,name:s.name??"",error:s.error??""}})}async function k0e(e,t){const n=await kt("/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 on(n,V("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:e7(s.environment),error:s.error??""}})}async function E0e(e,t,n,i){let r;try{r=await kt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(V("client.studioUnavailable")):s}if(!r.ok)throw new Error(await on(r,V("client.saveEnvironmentFailed")));return e7(await r.json())}function C0e(e,t){return E0e("/web/v3/environments","POST",e,t)}function T0e(e,t,n){return E0e(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function A0e(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await on(n,V("client.deleteEnvironmentFailed")))}async function S4(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.startEnvironmentBuildFailed")));const i=JF(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function _0e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await kt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await on(r,V("client.loadEnvironmentBuildFailed")));const s=JF(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function N0e(e,t,n){const i=await kt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await on(i,V("client.loadEnvironmentManifestFailed")));return p0e(await i.json())}function AW(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(V("client.invalidEnvironmentResource"));return t}async function j0e(e){const t=await kt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(V("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:AW(n.codePipeline),containerRegistry:AW(n.containerRegistry)}}async function YBe(e,t){const n=await kt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(V("client.invalidCodexSandboxUpdate"));return i}async function aR(e){const t=await kt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(V("client.invalidUserPoolList"));return i})}const vO=new Map;function ZBe(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class xO extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function Mh(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=ZBe(n.detail??n.error);if(i)return new xO(i)}catch{return new xO({message:t})}return new xO({message:V("client.syncGithubFailed",{status:e.status})})}async function R0e(e){const t=await kt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function I0e(e){const t=await kt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function P0e(e){const t=await kt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function JBe(e){const t=await kt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function D0e(e){const t=await kt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);const n=await t.json();return n.pipelineId?n:null}async function nA(e){const t=await kt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);return t.json()}async function M0e(e){const t=await kt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function n7(e){const t=await kt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function L0e(e){const t=await kt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function Ax(e,t,n,i){var f,h,m,g,b;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&vO.set(r,s);const a=()=>{r&&vO.get(r)===s&&vO.delete(r)};let l;try{const v=!!(i!=null&&i.migrationTaskId);(f=i==null?void 0:i.onStage)==null||f.call(i,{level:"info",phase:"upload",message:V(v?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),l=await kt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:v?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:gBe((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"success",phase:"upload",message:V(v?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(v){throw a(),EW(v)?v:new jw({taskId:r,cause:v})}if(!l.ok){const v=await on(l,V("client.deploymentFailed"));throw a(),new Error(v)}let c=null;try{for await(const v of eR(l)){const y=v;if(y&&y.done){c=y;break}y&&y.message&&((m=i==null?void 0:i.onStage)==null||m.call(i,y))}}catch(v){throw a(),EW(v)?v:new jw({taskId:r,cause:v})}if(a(),!c)throw new jw({taskId:r});if(!c.success){const v=new Error(c.error||V("client.deploymentFailed"));throw Ibe(v)?new jw({taskId:r,cause:v}):v}if(!c.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!c.runtimeId&&!c.url)throw new Error(V("client.deploymentMissingConnection"));const u=(g=c.runtimeName)!=null&&g.trim()?c.agentName:e,d=((b=c.runtimeName)==null?void 0:b.trim())||c.agentName;return{apikey:c.apikey??"",url:c.url??"",agentName:u,runtimeName:d,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function $0e(e){var n;const t=await kt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||V("client.cancelDeploymentFailed",{status:t.status}))}(n=vO.get(e))==null||n.abort(),vO.delete(e)}async function eUe(e=BF){const t=await kt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const bS={title:"AgentKit Studio",logoUrl:""},k4={enabled:!1},PD={studio:!1,version:"",provider:"volcengine",branding:bS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:k4};function tUe(e){if(!e||typeof e!="object")return k4;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return k4;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 F0e(){var e,t;try{const n=await kt("/web/ui-config");if(!n.ok)return PD;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:bS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return Qbe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:bS.title,logoUrl:r?Uo(r):""},features:{...PD.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:tUe(i.telemetry)}}catch{return PD}}const B0e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function U0e(){var n,i,r,s,a;const e=await kt("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||!["all","mine"].includes((a=t.capabilities)==null?void 0:a.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function Q0e(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 kt(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function z0e(){const e=await kt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||V("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function V0e(e){const t=await kt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},is);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||V("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function H0e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const a=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await kt(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await on(l,V("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||V("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(V("client.agentUsageNonJson",{status:l.status,contentType:c})+V("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(V("client.agentUsageInvalidJson",{status:l.status,contentType:c})+V("client.retryCheckGateway"))}}function Lh(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function E4(e){const t=await kt(Lh(),{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function nUe(e,t){const n=await kt(Lh(e),{signal:t});if(!n.ok)throw new Error(await on(n,V("client.loadCronJobFailed")));return await n.json()}async function q0e(e){const t=await kt(Lh(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await on(t,V("client.createCronJobFailed")));return await t.json()}async function W0e(e,t){const n=await kt(`${Lh(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await on(n,V("client.updateCronJobFailed")));return await n.json()}async function G0e(e,t){const n=t?"enable":"disable",i=await kt(`${Lh(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await on(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function K0e(e){const t=await kt(`${Lh(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await on(t,V("client.runCronJobFailed")));return await t.json()}async function C4(e,t){const n=await kt(`${Lh(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await on(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function X0e(e,t){const n=await kt(`${Lh(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await on(n,V("client.stopCronRunFailed")));return await n.json()}async function Y0e(e){const t=await kt(Lh(e),{method:"DELETE"});if(!t.ok)throw new Error(await on(t,V("client.deleteCronJobFailed")))}class i7 extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function _x(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await kt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await on(n,V("client.loadRuntimeFailed"));throw new i7(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Fv(e,t,n={}){if(n.preferCached){const i=qF(e,t,n.currentVersion),r=Xy.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&Xy.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await zk("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Cx||i instanceof Ds||i instanceof Error)throw i;return null}}async function Z0e(e,t){const n=new URLSearchParams({region:t}),i=await kt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ds(await on(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function J0e(e,t){const n=new URLSearchParams({region:t}),i=await kt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ds(await on(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function eye(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await kt("/.well-known/agent-card.json",{},i),s=await zbe(r);if(s==="runtime_access_denied")throw new Cx;if(s==="runtime_private_endpoint_unreachable")throw new Ds(Fbe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ds(Bbe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ds(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await on(r,V("client.loadA2aCardFailed")));const a=await r.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function tye(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await kt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(V("client.runtimeApiKeyMissing"));return r.apiKey}async function nye(e,t){const n=await kt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const i=await n.text().catch(()=>"");throw new Error(i||V("client.deleteFailed",{status:n.status}))}}function iA({runtimeId:e,region:t,appName:n,currentVersion:i}){return qb(gS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function iUe({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const a=await kt(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await rUe(a));return await a.json()}function oR({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const a={runtimeId:e,region:t,appName:n,currentVersion:i},l=iA(a);if(s&&kr.delete(l),!s){const f=Lm(kr,l,Tx);if(f)return ZC(Promise.resolve(f),r);const h=(u=kr.get(l))==null?void 0:u.promise;if(h)return ZC(h,r);if(n){const m=iA({...a,appName:""}),g=(d=kr.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var x,O,w,k,S;if(v.recoveryStatus==="preparing")return((x=kr.get(l))==null?void 0:x.promise)===b&&kr.delete(l),v;const y=((w=(O=v.agent)==null?void 0:O.appName)==null?void 0:w.trim())??"";return y&&y!==n.trim()?(((k=kr.get(l))==null?void 0:k.promise)===b&&kr.delete(l),oR(a)):(((S=kr.get(l))==null?void 0:S.promise)===b&&kr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=kr.get(l))==null?void 0:y.promise)===b&&kr.delete(l),v}),kr.set(l,{promise:b,updatedAt:0}),ZC(b,r)}}}let c;return c=iUe({...a,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f;if(((m=kr.get(l))==null?void 0:m.promise)===c){kr.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const x of y){const O=iA({...a,appName:x});O!==l&&!((v=kr.get(O))!=null&&v.promise)&&kr.set(O,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f}),kr.set(l,{promise:c,updatedAt:0}),ZC(c,r)}function T4({runtimeId:e,region:t,appName:n,currentVersion:i}){return Lm(kr,iA({runtimeId:e,region:t,appName:n,currentVersion:i}),Tx)}function A4(e){return oR(e).then(()=>{},()=>{})}function _4(e,t){if(!e){kr.clear();return}for(const n of kr.keys()){const[i,r,s]=n.split("");i===gS&&s===e&&(!t||r===t)&&kr.delete(n)}}async function rUe(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?V("client.runtimeManageForbidden"):e.status===404?V(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):V("client.checkRuntimeUpdateFailed",{status:e.status})}async function sUe(e,t){let n=null;for(const i of Qk(t)){const r=await kt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await on(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function r7(e,t="cn-beijing",n={}){const i=qb(e,t||"cn-beijing"),r=Lm(xg,i,Tx);if(!n.force&&r)return r;const s=xg.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=sUe(e,t).then(l=>WF(xg,i,l));xg.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=xg.get(i);(l==null?void 0:l.promise)===a&&xg.set(i,{value:l.value,updatedAt:l.updatedAt})}}function iye(e,t="cn-beijing"){return Lm(xg,qb(e,t||"cn-beijing"),Tx)}function rye(e,t="cn-beijing"){r7(e,t).catch(()=>{})}async function wO(e){const t=await kt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await on(t,V("client.generateProjectFailed")));return t.json()}const aUe=19e4;async function sye(e){const t=await kt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},aUe);if(!t.ok)throw new Error(await on(t,V("client.generateAgentConfigFailed")));return Jj(t,V("client.generateAgentConfigFailed"))}async function aye(e,t){const n=await kt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region})});if(!n.ok)throw new Error(await on(n,V("client.createDebugRunFailed")));return Jj(n,V("client.createDebugRunFailed"))}async function oye(e,t){const n=await kt(`/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 on(n,V("client.createDebugSessionFailed")));return(await Jj(n,V("client.createDebugSessionFailed"))).id}async function lye(e,t){const n=await kt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await on(n,V("client.loadDebugTraceFailed")));const i=await Jj(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*cye({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=o0e(r);let l;try{l=await kt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:a.signal},{},0)}catch(c){throw a.cleanup(),a.timedOut()?new Error($v()):c}if(!l.ok)throw a.cleanup(),new Error(await on(l,V("client.debugRunFailed")));try{for await(const c of eR(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error($v()):c}finally{a.cleanup()}}async function ey(e){const t=await kt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await on(t,V("client.cleanupDebugRunFailed")))}function uye(e){if(!e||typeof e!="object")throw new Error(V("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(V("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(V("client.invalidSandboxVersion"));return t}async function dye(e){const t=await kt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(uye)}async function fye(e){const t=await kt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await on(t,V("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(V("client.invalidSandboxUpdate"));return{updated:n.updated,state:uye(n.state)}}const oUe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:bS,DEFAULT_STUDIO_ACCESS:B0e,GithubCicdPipelineError:xO,RuntimeAccessDeniedError:Cx,RuntimeListError:i7,RuntimeProbeError:Ds,attachGithubDeliveryCicdToSourceSync:JBe,bindGithubCicdRuntime:n7,buildEnvironment:S4,cancelAgentkitDeployment:$0e,cancelCronJobRun:X0e,checkRuntimeNameAvailability:sR,clearMessageFeedbackCache:Pbe,clearRemoteApps:Mbe,componentSearch:r0e,createCronJob:q0e,createEnvironment:C0e,createGeneratedAgentTestRun:aye,createGeneratedAgentTestSession:oye,createGithubCicdPipeline:R0e,createGithubDeliveryCicdPipeline:I0e,createGithubDeliveryRollbackPr:M0e,createSession:Vbe,createWorkspace:y0e,deleteAgentFeedbackCases:Xbe,deleteCronJob:Y0e,deleteEnvironment:A0e,deleteGeneratedAgentTestRun:ey,deleteMedia:eA,deleteRuntime:nye,deleteSession:y4,deleteSessionMedia:v4,deleteWorkspace:x0e,deployAgentkitProject:Ax,downloadArtifact:KF,ensureRuntimeRouteChannel:J0e,exportEnvironmentShareCode:O0e,fetchRemoteApps:zk,generateAgentDraftFromRequirement:sye,generateAgentProject:wO,getAgentFeedbackCases:rR,getAgentInfo:w4,getAgentOptimizations:qbe,getAgentUsage:H0e,getAutomaticEvaluationStatuses:b4,getCachedAgentFeedbackCases:Wbe,getCachedRuntimeAgentInfo:n0e,getCachedRuntimeDetail:iye,getCachedRuntimeUpdateCapability:T4,getCronJob:nUe,getEnvironmentBuild:_0e,getEnvironmentManifest:N0e,getEnvironmentResources:j0e,getGeneratedAgentTestTrace:lye,getGithubCicdRuntimeBinding:D0e,getGithubDeliveryVersions:nA,getMediaCapabilities:qBe,getMyRuntimes:eUe,getRuntimeAgentInfo:YF,getRuntimeDetail:r7,getRuntimeStudioToolCapabilities:Z0e,getRuntimeUpdateCapability:oR,getRuntimes:_x,getSandboxImageUpdates:dye,getSession:iR,getSessionTrace:L_,getStudioAccess:U0e,getStudioUpdatePermissions:z0e,getStudioUpdateStatus:Q0e,getSystemInfo:f0e,getUiConfig:F0e,httpErrorMessage:on,importEnvironmentShareCodes:k0e,initializeGithubDeliveryMain:P0e,inspectEnvironmentRepository:w0e,inspectEnvironmentShareCodes:S0e,invalidateRuntimeUpdateCapabilityCache:_4,listApps:$be,listCronJobRuns:C4,listCronJobs:E4,listDeploymentResources:l0e,listEnvironments:Vk,listIdentityUserPools:aR,listModelApiKeys:HF,listModelOptions:Ex,listSessions:GF,listWorkspaces:t7,mediaContentUrl:e0e,parseEnvironmentManifest:p0e,parseEnvironmentShareCodes:ZF,parsePreparedSessionEnvironmentMounts:c0e,prefetchAgentFeedbackCases:VBe,prefetchRuntimeAgentInfo:i0e,prefetchRuntimeDetail:rye,prefetchRuntimeUpdateCapability:A4,prepareSessionEnvironmentMounts:u0e,previewArtifact:XF,probeRuntimeA2a:eye,probeRuntimeApps:Fv,refreshAgentFeedbackCases:Gbe,registerRemoteApp:Dbe,revealModelApiKey:Lbe,revealRuntimeApiKey:tye,runCronJobNow:K0e,runGeneratedAgentTestSSE:cye,runSSE:O4,runSseEmptyResponseError:a0e,runSseFirstEventTimeoutError:$v,runSseIncompleteResponseError:tA,runtimeRegionCandidates:Qk,setClientCloudProvider:Qbe,setCronJobEnabled:G0e,startStudioUpdate:V0e,studioFetch:An,submitIssueFeedback:x4,submitMessageFeedback:Hbe,syncGithubCicdRuntime:L0e,updateCodexSandboxToolModelEnv:YBe,updateCronJob:W0e,updateEnvironment:T0e,updateSandboxTool:fye,updateWorkspace:v0e,uploadMedia:Zbe,upsertCachedAgentFeedbackCase:J2,webSearch:s0e,writeEnvironmentShareCode:d0e},Symbol.toStringTag,{value:"Module"})),_W=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rA=Object.freeze({modelName:"",current:_W,cumulative:_W}),lUe={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},cUe=24,uUe=64,dUe=16;function JC(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),a=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+a}function fUe(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=JC(t),s=n.reduce((d,f)=>d+uUe+JC(f),0),a=i.reduce((d,f)=>d+dUe+JC(f.name)+JC(f.description??""),0);return cUe+r+s+a}function hUe({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),a=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-a),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:a+c;return{systemTokens:a,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function pUe(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const a=i;return i+=s.tokens,{...s,start:a,end:i}});return Array.from({length:100},(s,a)=>{const l=a*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:a,slices:u}})}function L1(e,t){const n=e,i=n[t]??n[lUe[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function mUe(e){const t=L1(e,"promptTokenCount"),n=L1(e,"candidatesTokenCount"),i=L1(e,"thoughtsTokenCount");return{totalTokenCount:L1(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:L1(e,"cachedContentTokenCount")}}function gUe(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 hye(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const a=mUe(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:gUe(e.cumulative,a)}}function NW(e){return e.reduce((t,n)=>hye(t,n),rA)}function jW(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function bUe(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function yUe(e,t){if(!t)return e;const n=new Set(e.filter(r=>bUe(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function bb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Fp(e){return typeof e=="string"?e:""}function pye(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function vUe(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=bb(t)??{};return bb(n.result)??n}function xUe(e){var n;const t=(n=bb(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Fp((r=bb(i))==null?void 0:r.label)}):[]}function mye(e,t,n){const i=xUe(e),r=vUe(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=bb(s[c])??{};return{label:Fp(u.label)||i[c]||`方向 ${c+1}`,content:Fp(u.content),status:pye(u.status,a),error:Fp(u.error)}})}}function wUe(e){const t=bb(e),n=bb(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:Fp(n.requestId),branchIndex:n.branchIndex,label:Fp(n.label),delta:Fp(n.delta),status:pye(n.status,"running"),error:Fp(n.error)||void 0}}function OUe(e,t,n){return{branches:mye(e,t,"running").branches.map((s,a)=>a===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ha(e,t){return an.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const gye=28e4;function RW(e){try{return JSON.stringify(e).length}catch{return gye}}function SUe(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+RW(r),0);for(;t.length>1&&n>gye;)n-=RW(t.shift());return t}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ci(e){return typeof e=="string"?e:""}function s7(e,t=""){const n=Ci(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function bye(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 yye(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ci(e.command),n=Ci(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function wg(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function vye(e){const t=Ci(e.id||e.itemId||e.item_id),n=Ci(e.kind);if(!t||!n)return null;const i=s7(e.status),r=Ci(e.text||e.detail||e.delta),s=!Ci(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const a=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ci(e.title)||Ha("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Jl(l),u=Ci(c==null?void 0:c.text);if(!u)return[];const d=Ci(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const a=Ha(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=yye(e),c=bye(e)??(n==="status"&&r||void 0);return{id:t,block:wg(Ci(e.name||e.title)||a,t,i,l,c)}}return null}function xye(e){const t=Ci(e.type),n=Jl(e.item),i=Ci(n==null?void 0:n.type),r=Ci((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=s7(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Ci(n==null?void 0:n.text);return a?{id:r,block:i==="reasoning"?{kind:"thinking",text:a,done:s!=="running"}:{kind:"text",text:a},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Jl(c),d=Ci(u==null?void 0:u.text);if(!d)return[];const f=Ci(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ha("planTitle"),summary:Ha("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Ha(`command.${s}`);return{id:r,block:wg(a,r,s,yye(n??{}),bye(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Ha("projectFiles",{count:a.length}):Ha("projectFile"),c=Ha(`fileChange.${s}`,{subject:l});return{id:r,block:wg(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Ci(n==null?void 0:n.server),Ci(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ha("externalTool"),l=Ha(`mcp.${s}`,{tool:a}),c=Jl(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ci(c==null?void 0:c.message)||void 0;return{id:r,block:wg(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Ci(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Ha(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:wg(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Ha(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:wg(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Jl(e.error),l=Ci((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Ha("errorDetail");return{id:r,block:wg(Ha("errorTitle"),r,"failed",void 0,l)}}return null}function kUe(e){const t=Jl(e),n=Jl(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ci(n.toolName),r=Ci(n.requestId);if(!i||!r)return null;const s=Jl(n.event??n.activity);if(!s)return null;const a=Jl(s.item)||Ci(s.type)?xye(s):vye(s);if(!a)return null;const l=Ci(n.title||n.label),c=Ci(s.agentSessionId??s.agent_session_id),u=Ci(s.sandboxSessionId??s.sandbox_session_id),d=Ci(s.threadId??s.thread_id),f=s7(s.status,Ci(s.type)),m=Ci(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:a}}function EUe(e,t){const n=Jl(t),i=Jl((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ci(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ci(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Ci(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ci(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Jl(d);if(!f)continue;const h=Jl(f.item)||Ci(f.type)?xye(f):vye(f);h&&(h.finalAnswer||(c=N4(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function N4(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:SUe(n)}}const wye="send_a2ui_json_to_client",j4="validated_a2ui_json",R4="adk_request_credential",IW="transfer_to_agent";function CUe(e){var i,r,s,a;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function I4(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function PW(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=N4(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=N4(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function TUe(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 DW(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 P4=e=>e.functionCall??e.function_call,yS=e=>e.functionResponse??e.function_response;function AUe(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function _Ue(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function lR(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const a=r==null?void 0:r.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:_Ue(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function vS(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const NUe=new Set(["llm","sequential","parallel","loop","a2a"]);function jUe(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&NUe.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||a)return{skills:s,targetAgent:a}}}function RUe(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 IUe(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 DD(e,t,n){const i=e[e.length-1];i&&i.kind===t?i.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function eT(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Oye(e,t){var d,f,h,m,g,b;const n=e.blocks.map(v=>({...v}));let i=e.liveStart,r=e.pendingCodexProgress.slice();const s=((d=t.content)==null?void 0:d.parts)??[],a=s.flatMap(v=>{const y=wUe(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=kUe(v.partMetadata??v.part_metadata);return y?[y]:[]});if(a.length>0||l.length>0){for(const v of a)for(let y=n.length-1;y>=0;y-=1){const x=n[y];if(!(x.kind!=="tool"||x.done||x.name!==v.toolName||v.requestId&&x.callId&&x.callId!==v.requestId)){x.response=OUe(x.args,x.response,v),x.status="running";break}}for(const v of l)PW(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>P4(v)||yS(v));if(t.partial&&!c){for(const v of s){const y=vS(v);typeof y=="string"&&y&&DD(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=P4(v),x=yS(v),O=lR([v]),w=vS(v);if(typeof w=="string"&&w)DD(n,v.thought?"thinking":"text",w);else if(O.length)eT(n),RUe(n,O);else if(y)if(eT(n),y.name===IW){const k=AUe(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||an.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:k,done:!1})}else if(y.name===R4){const k=y.args??{},S=k.authConfig??k.auth_config??k,C=String(k.functionCallId??k.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:C,authUri:CUe(S),authConfig:S,done:!1})}else{const k={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(k),k.callId){const S=[];for(const E of r)E.toolName===k.name&&E.requestId===k.callId?PW(n,E):S.push(E);r=S}}else if(x){if(eT(n),x.name===IW)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="agent-transfer"&&!S.done){S.done=!0;break}}if(x.name===R4)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="auth"&&!S.done){S.done=!0;break}}for(let k=n.length-1;k>=0;k--){const S=n[k],E=S.kind==="tool"&&S.name==="delegate_to_codex_sandbox";if(S.kind==="tool"&&(!S.done||E)&&S.name===x.name&&(!x.id||!S.callId||S.callId===x.id)){const C=E?DW(S.response):"";if(S.done=!0,S.response=x.response,E){S.codexActivity=EUe(S.codexActivity,x.response),S.status=TUe(x.response);const N=DW(x.response);N&&N!==C&&DD(n,"text",N)}break}}if(x.name===wye){const k=((m=x.response)==null?void 0:m[j4])??[];if(k.length){const S=n[n.length-1];S&&S.kind==="a2ui"?S.messages.push(...k):n.push({kind:"a2ui",messages:k})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&IUe(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),eT(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function PUe(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=vS(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||lR([b]).length>0}),r=n.some(b=>{var y;const v=yS(b);return(v==null?void 0:v.name)===wye&&Array.isArray((y=v.response)==null?void 0:y[j4])&&v.response[j4].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),a=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||a||l&&c}function DUe(e){var n,i,r;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(vS(s)||lR([s]).length>0||P4(s)||yS(s)))}function $_(e="adk-stream",t){var a,l,c;let n=0;const i=new Map;let r;const s=(u,d)=>`${d}\0${u}`;if((t==null?void 0:t.role)==="assistant"){const u=((a=t.meta)==null?void 0:a.author)??"",d=((l=t.meta)==null?void 0:l.invocationId)??"",f=((c=t.meta)==null?void 0:c.localId)??`${e}-${n++}`,h=I4();h.blocks=t.blocks,h.liveStart=t.blocks.length,r=s(u,d),i.set(r,{acc:h,localId:f,meta:{...t.meta,localId:f,streaming:!0,eventId:void 0}})}return{project(u){const d=u.author&&u.author!=="user"?u.author:"",f=u.invocationId??u.invocation_id??"",h=s(d,f);let m=i.get(h);if(!m&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,m=y)}if(!m&&!DUe(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!m){const y=`${e}-${n++}`;m={acc:I4(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}m.acc=Oye(m.acc,u);const g=u.usageMetadata??u.usage_metadata,b=PUe(u,m.acc.blocks);m.meta={...m.meta,author:d||m.meta.author,localId:m.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||m.meta.tokens,ts:u.timestamp||m.meta.ts,invocationId:f||m.meta.invocationId,eventId:b&&u.id?u.id:m.meta.eventId};const v={role:"assistant",blocks:m.acc.blocks,meta:m.meta};return b?(i.delete(h),r=void 0):i.set(h,m),{turn:v,completed:b}},finish(){const u=[...i.values()].map(d=>({role:"assistant",blocks:d.acc.blocks,meta:{...d.meta,streaming:!1}}));return i.clear(),u}}}function Dg(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(a=>{var l;return((l=a.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function MUe(e,t={}){var r;let n=[],i=$_("adk-history");for(const s of e)if(s.author==="user"){const l=((r=s.content)==null?void 0:r.parts)??[];if(l.some(h=>{var m;return((m=yS(h))==null?void 0:m.name)===R4})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let m=n[h].blocks.length-1;m>=0;m--){const g=n[h].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(vS).filter(h=>!!h).join(""),u=lR(l),d=jUe(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Dg(n,h);const f=[];d&&f.push({kind:"invocation",value:d}),u.length&&f.push({kind:"attachment",files:u}),c&&f.push({kind:"text",text:c}),n.push({role:"user",blocks:f,meta:{ts:s.timestamp}}),i=$_("adk-history")}else{const l=i.project(s);l.ignored||(n=Dg(n,l.turn))}for(const s of i.finish())n=Dg(n,s);for(const s of n){const a=s.meta,l=a==null?void 0:a.eventId;if(!l)continue;const c=t[`veadk_feedback:${l}`];if(!c||typeof c!="object")continue;const u=c;u.rating!=="good"&&u.rating!=="bad"||(a.feedback=c)}return n}function cR(e,t=an.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(a=>a.text).find(Boolean);if(s)return s}return t}function Sye(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=Sye(i,t,e);if(r)return r}}function LUe(e,t){var a,l;if(e.role!=="assistant"||!t)return;const n=(a=e.meta)==null?void 0:a.author;if(!n)return;const i=Sye(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 $Ue(e,t){const n=[];return e.forEach((i,r)=>{const s=LUe(i,t),a=n[n.length-1];if(s&&(a==null?void 0:a.groupKey)===s.key){a.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function kye(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},a7=e=>{const t=FUe(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?p.cloneElement(r,a,a7(s)):r}return i})},BUe="_Badge_1viyg_1",UUe={Badge:BUe},ba=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:pi(UUe.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:a7(e)});var QUe=typeof Ip=="object"&&Ip&&Ip.Object===Object&&Ip,zUe=typeof self=="object"&&self&&self.Object===Object&&self;QUe||zUe||Function("return this")();var VUe=typeof window<"u"?p.useLayoutEffect:p.useEffect;function HUe(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var MW={width:void 0,height:void 0};function Eye(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(MW),a=HUe(),l=p.useRef({...MW}),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=LW(d,f,"inlineSize"),m=LW(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):a()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:i,height:r}}function LW(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 o7(e,t){const n=p.useRef(e);VUe(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const qUe={DEV:!1,MODE:"production"},Yy=typeof import.meta<"u"?qUe:void 0,WUe=!!(Yy!=null&&Yy.DEV),GUe=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Cye=(Yy==null?void 0:Yy.MODE)==="test"||GUe,KUe=typeof window<"u",Tye=typeof document<"u",XUe=KUe&&Tye,l7=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},F_=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!XUe||typeof window.requestAnimationFrame!="function"||Tye&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function a(){r-=1,r===0?e():s=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Wb=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",a=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=a}return n},{}),MD=e=>typeof e=="number"?`${e}deg`:e,LD=e=>String(e),tT=e=>`${e}ms`,$D=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const a=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${MD(i)})`,r==null?null:`skewX(${MD(r)})`,s==null?null:`skewY(${MD(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},FD=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},ih=e=>{e.preventDefault()},Aye=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),YUe="_LoadingIndicator_7yl6f_1",ZUe={LoadingIndicator:YUe},Hk=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:pi(ZUe.LoadingIndicator,e),style:i||Wb({"indicator-size":t,"indicator-stroke":n})});var JUe=Object.defineProperty,c7=(e,t)=>JUe(e,"name",{value:t,configurable:!0});function D4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}c7(D4,"setRef");function _ye(...e){return t=>{let n=!1;const i=e.map(r=>{const s=D4(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;reQe(e,"name",{value:t,configurable:!0});function Oh(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];M4(r)&&typeof nT=="function"&&(r=nT(r._payload)),p.Children.forEach(r,h=>{var m;if(Dye(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;M4(b)&&typeof nT=="function"&&(b=nT(b._payload)),a=tQe(g,b),c.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else c.push(h)}),a?a=p.cloneElement(a,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);const u=a?Pye(a):void 0,d=ir(i,u);if(!a){if(r||r===0)throw new Error(l?rQe(e):iQe(e));return r}const f=Iye(s,a.props??{});return a.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}qu(Oh,"createSlot");var Nye=Oh("Slot"),jye=Symbol.for("radix.slottable");function Rye(e){const t=qu(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=jye,t}qu(Rye,"createSlottable");var tQe=qu((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 Iye(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}qu(Iye,"mergeProps");function Pye(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qu(Pye,"getElementRef");function Dye(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jye}qu(Dye,"isSlottable");var nQe=Symbol.for("react.lazy");function M4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nQe&&"_payload"in e&&Mye(e._payload)}qu(M4,"isLazyComponent");function Mye(e){return typeof e=="object"&&e!==null&&"then"in e}qu(Mye,"isPromiseLike");var iQe=qu(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rQe=qu(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),nT=Fb[" use ".trim().toString()],sQe=Object.defineProperty,aQe=(e,t)=>sQe(e,"name",{value:t,configurable:!0}),oQe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=oQe.reduce((e,t)=>{const n=Oh(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:a,...l}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function u7(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}aQe(u7,"dispatchDiscreteCustomEvent");var lQe=Object.defineProperty,cQe=(e,t)=>lQe(e,"name",{value:t,configurable:!0}),uQe=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"}),dQe=p.forwardRef(cQe(function(t,n){return o.jsx(wr.span,{...t,ref:n,style:{...uQe,...t.style}})},"VisuallyHidden")),fQe=dQe,hQe=Object.defineProperty,Qc=(e,t)=>hQe(e,"name",{value:t,configurable:!0});function pQe(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=Qc(s=>{const{children:a,...l}=s,c=p.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");i.displayName=e+"Provider";function r(s,a={}){const{optional:l=!1}=a,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Qc(r,"useContext"),[i,r]}Qc(pQe,"createContext");function kl(e,t=[]){let n=[];function i(s,a){const l=p.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Qc(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Qc(d,"useContext"),[u,d]}Qc(i,"createContext");const r=Qc(()=>{const s=n.map(a=>p.createContext(a));return Qc(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,Lye(r,...t)]}Qc(kl,"createContextScope");function Lye(...e){const t=e[0];if(e.length===1)return t;const n=Qc(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Qc(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Qc(Lye,"composeContextScopes");var mQe=Object.defineProperty,Pa=(e,t)=>mQe(e,"name",{value:t,configurable:!0});function d7(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=Pa(b=>{const{scope:v,children:y}=b,x=p.useRef(null),O=p.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:O,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Oh(l),u=p.forwardRef((b,v)=>{const{scope:y,children:x}=b,O=s(l,y),w=ir(v,O.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Oh(d),m=p.forwardRef((b,v)=>{const{scope:y,children:x,...O}=b,w=p.useRef(null),k=ir(v,w),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(w,{ref:w,...O}),()=>void S.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:k,children:x})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const O=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,E)=>O.indexOf(S.ref.current)-O.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return Pa(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},g,i]}Pa(d7,"createCollection");var $W=new WeakMap,Ws,Wl,BD=(Wl=class extends Map{constructor(n){super(n);uV(this,Ws);jP(this,Ws,[...super.keys()]),$W.set(this,!0)}set(n,i){return $W.get(this)&&(this.has(n)?uo(this,Ws)[uo(this,Ws).indexOf(n)]=n:uo(this,Ws).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=uo(this,Ws).length,l=f7(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...uo(this,Ws)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const a of this)Reflect.apply(n,i,[a,s,this])&&r.push(a),s++;return new Wl(r)}map(n,i){const r=[];let s=0;for(const a of this)r.push([a[0],Reflect.apply(n,i,[a,s,this])]),s++;return new Wl(r)}reduce(...n){const[i,r]=n;let s=0,a=r??this.at(0);for(const l of this)s===0&&n.length===1?a=l:a=Reflect.apply(i,this,[a,l,s,this]),s++;return a}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,a,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new Wl(i)}toReversed(){const n=new Wl;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new Wl(i)}slice(n,i){const r=new Wl;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let a=n;a<=s;a++){const l=this.keyAt(a),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ws=new WeakMap,Pa(Wl,"OrderedDict"),Wl);function sA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=$ye(e,t);return n===-1?void 0:e[n]}Pa(sA,"at");function $ye(e,t){const n=e.length,i=f7(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Pa($ye,"toSafeIndex");function f7(e){return e!==e||e===0?0:Math.trunc(e)}Pa(f7,"toSafeInteger");function gQe(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new BD,setItemMap:Pa(()=>{},"setItemMap")}),a=Pa(({state:O,...w})=>O?o.jsx(c,{...w,state:O}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=Pa(O=>{const w=v();return o.jsx(c,{...O,state:w})},"CollectionInit");l.displayName=t+"Init";const c=Pa(O=>{const{scope:w,children:k,state:S}=O,E=p.useRef(null),[C,N]=p.useState(null),_=ir(E,N),[j,A]=S;return p.useEffect(()=>{if(!C)return;const F=Uye(()=>{});return F.observe(C,{childList:!0,subtree:!0}),()=>{F.disconnect()}},[C]),o.jsx(r,{scope:w,itemMap:j,setItemMap:A,collectionRef:_,collectionRefObject:E,collectionElement:C,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Oh(u),f=p.forwardRef((O,w)=>{const{scope:k,children:S}=O,E=s(u,k),C=ir(w,E.collectionRef);return o.jsx(d,{ref:C,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Oh(h),b=p.forwardRef((O,w)=>{const{scope:k,children:S,...E}=O,C=p.useRef(null),[N,_]=p.useState(null),j=ir(w,C,_),A=s(h,k),{setItemMap:F}=A,T=p.useRef(E);Fye(T.current,E)||(T.current=E);const P=T.current;return p.useEffect(()=>{const R=P;return F(L=>N?L.has(N)?L.set(N,{...R,element:N}).toSorted(L4):(L.set(N,{...R,element:N}),L.toSorted(L4)):L),()=>{F(L=>!N||!L.has(N)?L:(L.delete(N),new BD(L)))}},[N,P,F]),o.jsx(g,{[m]:"",ref:j,children:S})});b.displayName=h;function v(){return p.useState(new BD)}Pa(v,"useInitCollection");function y(O){const{itemMap:w}=s(e+"CollectionConsumer",O);return w}return Pa(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Pa(gQe,"createCollection");function Fye(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Pa(Fye,"shallowEqual");function Bye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Pa(Bye,"isElementPreceding");function L4(e,t){return!e[1].element||!t[1].element?0:Bye(e[1].element,t[1].element)?-1:1}Pa(L4,"sortByDocumentPosition");function Uye(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Pa(Uye,"getChildListObserver");var bQe=Object.defineProperty,Nx=(e,t)=>bQe(e,"name",{value:t,configurable:!0}),Qye=!!(typeof window<"u"&&window.document&&window.document.createElement);function yn(e,t,{checkForDefaultPrevented:n=!0}={}){return Nx(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}Nx(yn,"composeEventHandlers");function yQe(e){var t;if(!Qye)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Nx(yQe,"getOwnerWindow");function $4(e){if(!Qye)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Nx($4,"getOwnerDocument");function zye(e,t=!1){const{activeElement:n}=$4(e);if(!(n!=null&&n.nodeName))return null;if(Vye(n)&&n.contentDocument)return zye(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=$4(n).getElementById(i);if(r)return r}}return n}Nx(zye,"getActiveElement");function Vye(e){return e.tagName==="IFRAME"}Nx(Vye,"isFrame");var Jc=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},vQe=Object.defineProperty,xQe=(e,t)=>vQe(e,"name",{value:t,configurable:!0}),FW=Fb[" useEffectEvent ".trim().toString()],BW=Fb[" useInsertionEffect ".trim().toString()];function Hye(e){if(typeof FW=="function")return FW(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof BW=="function"?BW(()=>{t.current=e}):Jc(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}xQe(Hye,"useEffectEvent");var wQe=Object.defineProperty,qk=(e,t)=>wQe(e,"name",{value:t,configurable:!0}),OQe=Fb[" useInsertionEffect ".trim().toString()]||Jc;function su({prop:e,defaultProp:t,onChange:n=qk(()=>{},"onChange"),caller:i}){const[r,s,a]=qye({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=Wye(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}qk(su,"useControllableState");function qye({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return OQe(()=>{s.current=t},[t]),p.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}qk(qye,"useUncontrolledState");function Wye(e){return typeof e=="function"}qk(Wye,"isFunction");var UW=Symbol("RADIX:SYNC_STATE");function SQe(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=Hye(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===UW)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...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:UW,state:r})},[r,f.state,c]),[b,h]}qk(SQe,"useControllableStateReducer");var kQe=Object.defineProperty,Sh=(e,t)=>kQe(e,"name",{value:t,configurable:!0});function Gye(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Sh(Gye,"useStateMachine");var Gd=Sh(e=>{const{present:t,children:n}=e,i=Kye(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=Xye(i.ref,Yye(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function Kye(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),a=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=Gye(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=a.current??ty(i.current),a.current=void 0):s.current="none"},[c]),Jc(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ty(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Jc(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Sh(g=>{const v=ty(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Sh(g=>{g.target===t&&(s.current=ty(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=ty(f)}else i.current=null;n(d)},[])}}Sh(Kye,"usePresence");function F4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Sh(F4,"setRef");function Xye(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=F4(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;aEQe(e,"name",{value:t,configurable:!0}),TQe=Fb[" useId ".trim().toString()]||(()=>{}),AQe=0;function mm(e){const[t,n]=p.useState(TQe());return Jc(()=>{e||n(i=>i??String(AQe++))},[e]),e||(t?`radix-${t}`:"")}CQe(mm,"useId");var _Qe=Object.defineProperty,NQe=(e,t)=>_Qe(e,"name",{value:t,configurable:!0}),jQe=p.createContext(void 0);function Wk(e){const t=p.useContext(jQe);return e||t||"ltr"}NQe(Wk,"useDirection");var RQe=Object.defineProperty,IQe=(e,t)=>RQe(e,"name",{value:t,configurable:!0});function $u(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)},[])}IQe($u,"useCallbackRef");var PQe=Object.defineProperty,Ra=(e,t)=>PQe(e,"name",{value:t,configurable:!0}),B4="dismissableLayer.update",DQe="dismissableLayer.pointerDownOutside",MQe="dismissableLayer.focusOutside",QW,Zye=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),h7=p.forwardRef(Ra(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(Zye),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=ir(n,m),y=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),O=x?y.indexOf(x):-1,w=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=w>=O,E=p.useRef(!1),C=Jye(A=>{a==null||a(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 F=[...f.branches].some(T=>T.contains(A));return S&&!F},[f.branches,S])}),N=eve(A=>{if(r&&E.current)return;const F=A.target;[...f.branches].some(P=>P.contains(F))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),_=h?w===y.length-1:!1,j=$u(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(_)return g.addEventListener("keydown",j,{capture:!0}),()=>g.removeEventListener("keydown",j,{capture:!0})},[g,_,j]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(QW=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),U4(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=QW))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),U4())},[h,f]),p.useEffect(()=>{const A=Ra(()=>b({}),"handleUpdate");return document.addEventListener(B4,A),()=>document.removeEventListener(B4,A)},[]),o.jsx(wr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:yn(t.onFocusCapture,N.onFocusCapture),onBlurCapture:yn(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:yn(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function LQe(){const e=p.useContext(Zye),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ra(LQe,"useDismissableLayerSurface");var $Qe=Ra(()=>!0,"IS_TRUE");function Jye(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=$Qe}=t,l=$u(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()}Ra(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ra(m,"isOutsideInteractionIntercepted");function g(O){if(!u.current)return;const w=O.target;w instanceof Node&&[...s].some(S=>S.contains(w))||d.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ra(g,"handleInteractionCapture");function b(O){u.current&&d.current.set(O.type,!1)}Ra(b,"handleInteractionBubble");const v=Ra(O=>{if(O.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const S=m();h(),S||p7(DQe,l,k,{discrete:!0})};if(Ra(w,"handleAndDispatchPointerDownOutsideEvent"),!a(O.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:O};u.current=!0,r.current=i&&O.button===0,d.current.clear(),!i||O.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of y)n.addEventListener(O,g,!0),n.addEventListener(O,b);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const O of y)n.removeEventListener(O,g,!0),n.removeEventListener(O,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:Ra(()=>c.current=!0,"onPointerDownCapture")}}Ra(Jye,"usePointerDownOutside");function eve(e,t=globalThis==null?void 0:globalThis.document){const n=$u(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Ra(s=>{s.target&&!i.current&&p7(MQe,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Ra(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ra(()=>i.current=!1,"onBlurCapture")}}Ra(eve,"useFocusOutside");function U4(){const e=new CustomEvent(B4);document.dispatchEvent(e)}Ra(U4,"dispatchUpdate");function p7(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?u7(r,s):r.dispatchEvent(s)}Ra(p7,"handleAndDispatchCustomEvent");var FQe=Object.defineProperty,Bo=(e,t)=>FQe(e,"name",{value:t,configurable:!0}),UD="focusScope.autoFocusOnMount",QD="focusScope.autoFocusOnUnmount",zW={bubbles:!1,cancelable:!0},tve=p.forwardRef(Bo(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=p.useState(null),d=$u(s),f=$u(a),h=p.useRef(null),m=ir(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(w){if(g.paused||!c)return;const k=w.target;c.contains(k)?h.current=k:jf(h.current,{select:!0})},y=function(w){if(g.paused||!c)return;const k=w.relatedTarget;k!==null&&(c.contains(k)||jf(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&jf(c)};Bo(v,"handleFocusIn"),Bo(y,"handleFocusOut"),Bo(x,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const O=new MutationObserver(x);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),O.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){VW.add(g);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(UD,zW);c.addEventListener(UD,d),c.dispatchEvent(x),x.defaultPrevented||(nve(ove(m7(c)),{select:!0}),document.activeElement===v&&jf(c))}return()=>{c.removeEventListener(UD,d),setTimeout(()=>{const x=new CustomEvent(QD,zW);c.addEventListener(QD,f),c.dispatchEvent(x),x.defaultPrevented||jf(v??document.body,{select:!0}),c.removeEventListener(QD,f),VW.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,x=document.activeElement;if(y&&x){const O=v.currentTarget,[w,k]=ive(O);w&&k?!v.shiftKey&&x===k?(v.preventDefault(),i&&jf(w,{select:!0})):v.shiftKey&&x===w&&(v.preventDefault(),i&&jf(k,{select:!0})):x===O&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(wr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function nve(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(jf(i,{select:t}),document.activeElement!==n)return}Bo(nve,"focusFirst");function ive(e){const t=m7(e),n=Q4(t,e),i=Q4(t.reverse(),e);return[n,i]}Bo(ive,"getTabbableEdges");function m7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Bo(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}Bo(m7,"getTabbableCandidates");function Q4(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):rve(i,{upTo:t})))return i}Bo(Q4,"findVisible");function rve(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}Bo(rve,"isHidden");function sve(e){return e instanceof HTMLInputElement&&"select"in e}Bo(sve,"isSelectableInput");function jf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sve(e)&&t&&e.select()}}Bo(jf,"focus");var VW=ave();function ave(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=z4(e,t),e.unshift(t)},remove(t){var n;e=z4(e,t),(n=e[0])==null||n.resume()}}}Bo(ave,"createFocusScopesStack");function z4(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Bo(z4,"arrayRemove");function ove(e){return e.filter(t=>t.tagName!=="A")}Bo(ove,"removeLinks");var BQe=Object.defineProperty,UQe=(e,t)=>BQe(e,"name",{value:t,configurable:!0}),g7=p.forwardRef(UQe(function(t,n){var c;const{container:i,...r}=t,[s,a]=p.useState(!1);Jc(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?Li.createPortal(o.jsx(wr.div,{...r,ref:n}),l):null},"Portal")),QQe=Object.defineProperty,b7=(e,t)=>QQe(e,"name",{value:t,configurable:!0}),iT=0,ad=null;function zQe(e){return uR(),e.children}b7(zQe,"FocusGuards");function uR(){p.useEffect(()=>{ad||(ad={start:V4(),end:V4()});const{start:e,end:t}=ad;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),iT++,()=>{iT===1&&(ad==null||ad.start.remove(),ad==null||ad.end.remove(),ad=null),iT=Math.max(0,iT-1)}},[])}b7(uR,"useFocusGuards");function V4(){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}b7(V4,"createFocusGuard");var bd=function(){return bd=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return aze;var t=oze(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])}},cze=dve(),Zy="data-scroll-locked",uze=function(e,t,n,i){var r=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(HQe,` { +${n}`}}async function*pBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const a=new URLSearchParams({region:t,follow:String(r)});n&&a.set("instance_name",n),i&&a.set("session_id",i);const l=await fetch(Uo(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Hu(Dh({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await hBe(l)}));for await(const c of eR(l)){if(!fBe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const mBe=255,gBe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function bBe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!gBe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>mBe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const yBe=/RunPipeline result could not be reconciled|Polling build status failed/i;class jw extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");ki(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function Pbe(e){if(e instanceof jw)return!0;const t=e instanceof Error?e.message:String(e??"");return yBe.test(t)}function EW(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}const g4="ap-southeast-1",BF="cn-beijing",vBe="https://ark.ap-southeast.bytepluses.com/api/v3",xBe="https://ark.cn-beijing.volces.com/api/v3/",wBe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",OBe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",SBe="dola-seed-2-1-turbo-260628",kBe="doubao-seed-2-1-pro-260628",EBe="skylark-embedding-vision-250615",CBe="doubao-embedding-vision-250615",TBe="seed-2-0-lite-260228",ABe="doubao-seed-2-0-lite-260428",_Be="dola-seedream-5-0-pro-260628",NBe="doubao-seedream-5-0-260128",jBe="seededit-3-0-i2i-250628",RBe="doubao-seededit-3-0-i2i-250628",IBe="dreamina-seedance-2-0-260128",PBe="doubao-seedance-2-0-260128";function Iu(e){return e==="byteplus"?[{value:g4,label:g4}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function Ji(e){var t;return((t=Iu(e)[0])==null?void 0:t.value)||BF}const DBe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function tR(e){return typeof e=="string"&&DBe.has(e)}function xh(e,t){var i;return((i=(t?Iu(t):[...Iu("volcengine"),...Iu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function wh(e){return e==="byteplus"?SBe:kBe}function xl(e){return e==="byteplus"?vBe:xBe}function MBe(e){return e==="byteplus"?wBe:OBe}function LBe(e){return e==="byteplus"?EBe:CBe}function $Be(e){return e==="byteplus"?TBe:ABe}function FBe(e){return e==="byteplus"?_Be:NBe}function BBe(e){return e==="byteplus"?jBe:RBe}function UBe(e){return e==="byteplus"?IBe:PBe}const UF="veadk.messageFeedback.v1";function QF(e,t,n,i){return[e,t,n,i].join(":")}function zF(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(UF)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function QBe(e,t,n){if(typeof window>"u")return;const i=zF();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(UF,JSON.stringify(i))}function Dbe(e){if(typeof window>"u")return;const t=QF(e.runtimeId,e.appName,e.userId,e.sessionId),n=zF(),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(UF,JSON.stringify(n))}}const Z2="",VF=new Map;function Mbe(e,t){VF.set(e,t)}function Lbe(){VF.clear()}function Sl(e){const t=VF.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function kt(e,t={},n={},i=Wo){const r=Ol(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Hu(Dh(t.headers))},l=()=>{const d={...a,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Uo(`${Z2}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Uo(`${Z2}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Uo(`${Z2}${e}`),d)},c=async d=>{if(Z7e(d))return!0;if(d.status!==401)return!1;try{return await W7e()}catch{return!1}};let u=await l();for(;await c(u);)await J7e(r),u=await l();return u}function An(e,t={},n=Wo){return kt(e,t,{},n)}function zBe(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 on(e,t){const n=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),i=await e.text().catch(()=>"");if(!i)return n;try{const r=JSON.parse(i),s=zBe(r.detail??r.error);return s?V("client.errorWithDetailAndRawResponse",{context:n,detail:s,response:i}):V("client.errorWithRawResponse",{context:n,response:i})}catch{return V("client.errorWithRawResponse",{context:n,response:i})}}async function HF(e,t=!1){const n=await kt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await on(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function $be(e,t){const n=await kt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await on(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Ex(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true");const n=t.toString(),i=await kt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.loadModelsFailed")));return await i.json()}async function Fbe(){const e=await kt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Cx extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ds extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const Bbe=()=>V("client.privateRuntimeUnavailable"),Ube=()=>V("client.runtimeTemporarilyUnavailable"),CW=["cn-beijing","cn-shanghai"],VBe=3e4,Tx=5*60*1e3,Qbe=60*1e3;let gS="volcengine";const Xy=new Map,vg=new Map,xg=new Map,Su=new Map,kr=new Map;function qF(e,t,n){return`${t}:${e}:${n??""}`}function zbe(e){e!==gS&&kr.clear(),gS=e}function Qk(e){const t=(e||"").trim();if(gS==="byteplus")return[t&&!t.startsWith("cn-")?t:g4];const n=t&&!t.startsWith("ap-")?t:BF;return CW.includes(n)?[n,...CW.filter(i=>i!==n)]:[n]}function nR(e){const t=(e||"").trim();return t?[t]:Qk()}function qb(...e){return e.map(t=>String(t??"")).join("")}function Lm(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function WF(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function ZC(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function Vbe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function zk(e,t,n,i,r=Wo){const s=await kt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await Vbe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Cx;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new Ds(Bbe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new Ds(Ube(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ds(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ds(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await on(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ds(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ds(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&Xy.set(qF(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+VBe}),c}async function Hbe(e,t){const{app:n,ep:i}=Sl(e),r=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const a=V("client.createSessionFailedWithStatus",{status:r.status}),l=await on(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function GF(e,t){const{app:n,ep:i}=Sl(e),r=await kt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function iR(e,t,n){const{app:i,ep:r}=Sl(e),s=await kt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await on(s,V("client.getSessionFailed"));throw new Error(V("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const a=await s.json();if(r.runtimeId){const l=QF(r.runtimeId,i,t,n);a.state={...zF()[l]??{},...a.state??{}}}return a}async function qbe(e){const{app:t,ep:n}=Sl(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await kt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},is);if(!i.ok)throw new Error(await on(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=QF(n.runtimeId,t,e.userId,e.sessionId);return QBe(s,e.eventId,r),r}async function rR(e,t={}){const n=qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Lm(Su,n,Qbe);if(!t.force&&i)return i;const r=Su.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of nR(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await kt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return WF(Su,n,await u.json());s=new Error(await on(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();Su.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Su.get(n);(l==null?void 0:l.promise)===a&&Su.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function b4(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await kt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await on(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function Wbe(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await kt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await on(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function Gbe(e){return Lm(Su,qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),Qbe)}function HBe(e){rR(e).catch(()=>{})}function Kbe(e){rR(e,{force:!0}).catch(()=>{})}function Xbe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function J2(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of Su.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const a=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...a]:a;Su.set(i,{value:{...s,sets:Xbe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function Ybe(e){let t=null;for(const n of nR(e.region)){const i=await kt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},is);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of Su.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));Su.set(a,{value:{...c,sets:Xbe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await on(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function y4(e,t,n){const{app:i,ep:r}=Sl(e),s=await kt(`/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 qBe(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 Zbe(e,t,n,i,r){const{app:s,ep:a}=Sl(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await kt(c,{},a,is);if(!u.ok)throw new Error(await on(u,V("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(V("client.fileUnavailable"));const h=qBe(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 XF(e,t,n,i,r){const{blob:s}=await Zbe(e,t,n,i,r);return URL.createObjectURL(s)}async function WBe(e){const t=await kt("/web/media/capabilities");if(!t.ok)throw new Error(await on(t,"media capabilities failed"));return t.json()}async function Jbe(e,t,n,i){const{app:r}=Sl(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const a=await kt("/web/media",{method:"POST",body:s},{},is);if(!a.ok)throw new Error(await on(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function v4(e,t,n){const{app:i}=Sl(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await kt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await on(s,"media cleanup failed"))}function e0e(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function eA(e,t){const n=e0e(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await kt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await on(i,"media cleanup failed"))}function t0e(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=e0e(t);if(!n)return t;const i=`${n}/content`;return Uo(`${Z2}${i}`)}async function L_(e,t,n){const{app:i,ep:r}=Sl(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await kt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await kt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await on(s,V("client.loadTraceFailed")));const a=s.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||V("client.contentTypeMissing");throw new Error(V("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(V("client.invalidTraceFormat"));return l}async function x4(e){const t=await kt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await on(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function n0e(e,t,n=!0){const i=await kt(`/web/agent-info/${e}`,{},t);if(!i.ok)throw new Error(`agent-info failed: ${i.status}`);const r=await i.json();if(n&&!r.draft)try{const s=await kt(`/web/agent-draft/${e}`,{},t);if(s.ok){const a=await s.json();r.draft=a.draft}}catch{}return{appName:e,name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function w4(e){const{app:t,ep:n}=Sl(e);return n0e(t,n,!1)}async function GBe(e,t,n){let i=null;for(const r of Qk(t)){const s={runtimeId:e,region:r};try{const a=qF(e,r),l=Xy.get(a);l&&l.expiresAt<=Date.now()&&Xy.delete(a);const c=Xy.get(a),u=n||(c==null?void 0:c.apps[0])||(await zk("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return n0e(u,s)}catch(a){if(a instanceof Cx||a instanceof Ds&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function YF(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=qb(e,t||"cn-beijing",r??""),l=Lm(vg,a,Tx);if(!s.force&&l)return l;const c=vg.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=GBe(e,t,r).then(d=>WF(vg,a,d));vg.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=vg.get(a);(d==null?void 0:d.promise)===u&&vg.set(a,{value:d.value,updatedAt:d.updatedAt})}}function i0e(e,t,n=""){return Lm(vg,qb(e,t||"cn-beijing",n),Tx)}function r0e(e,t,n=""){YF(e,t,n).catch(()=>{})}async function s0e(e,t,n,i){const{app:r,ep:s}=Sl(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await kt(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await on(l,V("client.agentSearchFailed")));return l.json()}async function a0e(e,t){const{app:n}=Sl(e),i=await kt(`/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 o0e(){return Df(V("client.emptySseBody"))}function tA(){return Df(V("client.noDisplayableSseReply"))}const KBe=3e4;function $v(){return Df(V("client.firstSseEventTimeout"))}function l0e(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(a))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},a=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error($v())))},KBe);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*O4({appName:e,userId:t,sessionId:n,text:i,attachments:r=[],invocation:s,platformTools:a,environmentMounts:l,environmentMount:c,functionResponses:u=[],signal:d,onRuntimeContext:f}){const{app:h,ep:m}=Sl(e),g=r.flatMap(k=>k.status&&k.status!=="ready"?[]:k.uri?[{fileData:{mimeType:k.mimeType,fileUri:k.uri,displayName:k.name},partMetadata:{veadkMedia:{id:k.id,uri:k.uri,name:k.name,mimeType:k.mimeType,sizeBytes:k.sizeBytes}}}]:k.data?[{inlineData:{mimeType:k.mimeType,data:k.data,displayName:k.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(k=>({functionResponse:{id:k.id,name:k.name,response:k.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const k=v[0],S=k.partMetadata;v[0]={...k,partMetadata:{...S,veadkInvocation:b}}}let y;const x=l0e(d);try{y=await kt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:h,user_id:t,session_id:n,new_message:{role:"user",parts:v},streaming:!0,...a!==void 0?{platform_tools:[...a]}:{},...l!==void 0?{environment_mounts:[...l]}:c?{environment_mount:c}:{},custom_metadata:b?{veadkInvocation:b}:void 0}),signal:x.signal},m,0)}catch(k){throw x.cleanup(),x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}const O=uBe(y,m.runtimeId??"",m.region??"");if(O&&(f==null||f(O)),!y.ok){x.cleanup();const k=await on(y,V("client.runSessionFailed"));throw new Error(Df(V("client.runSseFailedWithDetail",{status:y.status,detail:k})))}let w=!1;try{for await(const k of eR(y)){w=!0,x.clearDeadline();const S=k;typeof S.error=="string"&&(S.error=Df(S.error)),typeof S.errorMessage=="string"&&(S.errorMessage=Df(S.errorMessage)),typeof S.error_message=="string"&&(S.error_message=Df(S.error_message)),yield S}}catch(k){throw x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}finally{x.cleanup()}if(!w)throw new Error(o0e())}async function sR(e,t){const n=new URLSearchParams({name:e,region:t}),i=await kt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(V("client.invalidRuntimeNameCheck"));return{available:r.available}}async function c0e(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 kt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await on(i,V("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(V("client.invalidCloudResources"));const s=r.items.map(a=>{if(!a||typeof a!="object"||typeof a.id!="string"||typeof a.name!="string"||typeof a.region!="string"||typeof a.status!="string")throw new Error(V("client.invalidCloudResources"));return a});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function u0e(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(V("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(V("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(V("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(V("client.environmentMountMismatch"));return i})}async function d0e({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Sl(t);let a;try{a=await kt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(V("client.environmentMountNetworkFailed")):l}if(!a.ok)throw new Error(await on(a,V("client.environmentMountFailed")));return u0e(await a.json(),r)}function ZF(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 f0e(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(V("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(V("client.clipboardWriteFailed"))}}const TW={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 h0e(e){var r;const t=await kt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(V("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(V("client.invalidSystemInfo"));return s}).sort((s,a)=>(TW[s.kind]??Number.MAX_SAFE_INTEGER)-(TW[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const p0e=new Set(["preparing","queued","building","scanning","available","failed"]);function JF(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!p0e.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(V("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(V("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function m0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!p0e.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function g0e(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(V("client.invalidImageRepository"));return t}function XBe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(V("client.invalidCodeRepository"));return t}function YBe(e){const t=g0e(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function e7(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:XBe(t.gitSource),containerRepository:g0e(t.containerRepository),imageSource:YBe(t.imageSource),latestVersion:JF(t.latestVersion)}}function b0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidWorkspace"));return t}async function t7(e){const t=await kt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(b0e)}async function y0e(e,t,n,i){const r=await kt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await on(r,V("client.saveWorkspaceFailed")));return b0e(await r.json())}function v0e(e,t){return y0e("/web/workspaces","POST",e,t)}function x0e(e,t,n){return y0e(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function w0e(e,t){const n=await kt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await on(n,V("client.deleteWorkspaceFailed")))}async function Vk(e){const t=await kt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(e7)}async function O0e(e,t){const n=await kt("/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 on(n,V("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(V("client.invalidRepositoryProbe"));return i}async function S0e(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(V("client.invalidEnvironmentCode"));return i}async function k0e(e,t){const n=await kt("/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 on(n,V("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeInspection"));const s=r,a=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||a===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:a,name:s.name??"",error:s.error??""}})}async function E0e(e,t){const n=await kt("/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 on(n,V("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:e7(s.environment),error:s.error??""}})}async function C0e(e,t,n,i){let r;try{r=await kt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(V("client.studioUnavailable")):s}if(!r.ok)throw new Error(await on(r,V("client.saveEnvironmentFailed")));return e7(await r.json())}function T0e(e,t){return C0e("/web/v3/environments","POST",e,t)}function A0e(e,t,n){return C0e(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function _0e(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await on(n,V("client.deleteEnvironmentFailed")))}async function S4(e,t){const n=await kt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.startEnvironmentBuildFailed")));const i=JF(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function N0e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await kt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await on(r,V("client.loadEnvironmentBuildFailed")));const s=JF(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function j0e(e,t,n){const i=await kt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await on(i,V("client.loadEnvironmentManifestFailed")));return m0e(await i.json())}function AW(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(V("client.invalidEnvironmentResource"));return t}async function R0e(e){const t=await kt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(V("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:AW(n.codePipeline),containerRegistry:AW(n.containerRegistry)}}async function ZBe(e,t){const n=await kt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await on(n,V("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(V("client.invalidCodexSandboxUpdate"));return i}async function aR(e){const t=await kt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(V("client.invalidUserPoolList"));return i})}const vO=new Map;function JBe(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class xO extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function Mh(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=JBe(n.detail??n.error);if(i)return new xO(i)}catch{return new xO({message:t})}return new xO({message:V("client.syncGithubFailed",{status:e.status})})}async function I0e(e){const t=await kt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function P0e(e){const t=await kt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function D0e(e){const t=await kt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function eUe(e){const t=await kt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function M0e(e){const t=await kt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);const n=await t.json();return n.pipelineId?n:null}async function nA(e){const t=await kt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);return t.json()}async function L0e(e){const t=await kt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function n7(e){const t=await kt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function $0e(e){const t=await kt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function Ax(e,t,n,i){var f,h,m,g,b;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&vO.set(r,s);const a=()=>{r&&vO.get(r)===s&&vO.delete(r)};let l;try{const v=!!(i!=null&&i.migrationTaskId);(f=i==null?void 0:i.onStage)==null||f.call(i,{level:"info",phase:"upload",message:V(v?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),l=await kt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:v?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:bBe((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"success",phase:"upload",message:V(v?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(v){throw a(),EW(v)?v:new jw({taskId:r,cause:v})}if(!l.ok){const v=await on(l,V("client.deploymentFailed"));throw a(),new Error(v)}let c=null;try{for await(const v of eR(l)){const y=v;if(y&&y.done){c=y;break}y&&y.message&&((m=i==null?void 0:i.onStage)==null||m.call(i,y))}}catch(v){throw a(),EW(v)?v:new jw({taskId:r,cause:v})}if(a(),!c)throw new jw({taskId:r});if(!c.success){const v=new Error(c.error||V("client.deploymentFailed"));throw Pbe(v)?new jw({taskId:r,cause:v}):v}if(!c.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!c.runtimeId&&!c.url)throw new Error(V("client.deploymentMissingConnection"));const u=(g=c.runtimeName)!=null&&g.trim()?c.agentName:e,d=((b=c.runtimeName)==null?void 0:b.trim())||c.agentName;return{apikey:c.apikey??"",url:c.url??"",agentName:u,runtimeName:d,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function F0e(e){var n;const t=await kt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||V("client.cancelDeploymentFailed",{status:t.status}))}(n=vO.get(e))==null||n.abort(),vO.delete(e)}async function tUe(e=BF){const t=await kt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const bS={title:"AgentKit Studio",logoUrl:""},k4={enabled:!1},PD={studio:!1,version:"",provider:"volcengine",branding:bS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:k4};function nUe(e){if(!e||typeof e!="object")return k4;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return k4;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 B0e(){var e,t;try{const n=await kt("/web/ui-config");if(!n.ok)return PD;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:bS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return zbe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:bS.title,logoUrl:r?Uo(r):""},features:{...PD.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:nUe(i.telemetry)}}catch{return PD}}const U0e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function Q0e(){var n,i,r,s,a;const e=await kt("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||!["all","mine"].includes((a=t.capabilities)==null?void 0:a.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function z0e(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 kt(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function V0e(){const e=await kt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||V("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function H0e(e){const t=await kt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},is);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||V("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function q0e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const a=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await kt(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await on(l,V("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||V("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(V("client.agentUsageNonJson",{status:l.status,contentType:c})+V("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(V("client.agentUsageInvalidJson",{status:l.status,contentType:c})+V("client.retryCheckGateway"))}}function Lh(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function E4(e){const t=await kt(Lh(),{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function iUe(e,t){const n=await kt(Lh(e),{signal:t});if(!n.ok)throw new Error(await on(n,V("client.loadCronJobFailed")));return await n.json()}async function W0e(e){const t=await kt(Lh(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await on(t,V("client.createCronJobFailed")));return await t.json()}async function G0e(e,t){const n=await kt(`${Lh(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await on(n,V("client.updateCronJobFailed")));return await n.json()}async function K0e(e,t){const n=t?"enable":"disable",i=await kt(`${Lh(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await on(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function X0e(e){const t=await kt(`${Lh(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await on(t,V("client.runCronJobFailed")));return await t.json()}async function C4(e,t){const n=await kt(`${Lh(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await on(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function Y0e(e,t){const n=await kt(`${Lh(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await on(n,V("client.stopCronRunFailed")));return await n.json()}async function Z0e(e){const t=await kt(Lh(e),{method:"DELETE"});if(!t.ok)throw new Error(await on(t,V("client.deleteCronJobFailed")))}class i7 extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function _x(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await kt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await on(n,V("client.loadRuntimeFailed"));throw new i7(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Fv(e,t,n={}){if(n.preferCached){const i=qF(e,t,n.currentVersion),r=Xy.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&Xy.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await zk("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Cx||i instanceof Ds||i instanceof Error)throw i;return null}}async function J0e(e,t){const n=new URLSearchParams({region:t}),i=await kt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ds(await on(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function eye(e,t){const n=new URLSearchParams({region:t}),i=await kt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ds(await on(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function tye(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await kt("/.well-known/agent-card.json",{},i),s=await Vbe(r);if(s==="runtime_access_denied")throw new Cx;if(s==="runtime_private_endpoint_unreachable")throw new Ds(Bbe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ds(Ube());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ds(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await on(r,V("client.loadA2aCardFailed")));const a=await r.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function nye(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await kt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await on(i,V("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(V("client.runtimeApiKeyMissing"));return r.apiKey}async function iye(e,t){const n=await kt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const i=await n.text().catch(()=>"");throw new Error(i||V("client.deleteFailed",{status:n.status}))}}function iA({runtimeId:e,region:t,appName:n,currentVersion:i}){return qb(gS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function rUe({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const a=await kt(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await sUe(a));return await a.json()}function oR({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const a={runtimeId:e,region:t,appName:n,currentVersion:i},l=iA(a);if(s&&kr.delete(l),!s){const f=Lm(kr,l,Tx);if(f)return ZC(Promise.resolve(f),r);const h=(u=kr.get(l))==null?void 0:u.promise;if(h)return ZC(h,r);if(n){const m=iA({...a,appName:""}),g=(d=kr.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var x,O,w,k,S;if(v.recoveryStatus==="preparing")return((x=kr.get(l))==null?void 0:x.promise)===b&&kr.delete(l),v;const y=((w=(O=v.agent)==null?void 0:O.appName)==null?void 0:w.trim())??"";return y&&y!==n.trim()?(((k=kr.get(l))==null?void 0:k.promise)===b&&kr.delete(l),oR(a)):(((S=kr.get(l))==null?void 0:S.promise)===b&&kr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=kr.get(l))==null?void 0:y.promise)===b&&kr.delete(l),v}),kr.set(l,{promise:b,updatedAt:0}),ZC(b,r)}}}let c;return c=rUe({...a,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f;if(((m=kr.get(l))==null?void 0:m.promise)===c){kr.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const x of y){const O=iA({...a,appName:x});O!==l&&!((v=kr.get(O))!=null&&v.promise)&&kr.set(O,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f}),kr.set(l,{promise:c,updatedAt:0}),ZC(c,r)}function T4({runtimeId:e,region:t,appName:n,currentVersion:i}){return Lm(kr,iA({runtimeId:e,region:t,appName:n,currentVersion:i}),Tx)}function A4(e){return oR(e).then(()=>{},()=>{})}function _4(e,t){if(!e){kr.clear();return}for(const n of kr.keys()){const[i,r,s]=n.split("");i===gS&&s===e&&(!t||r===t)&&kr.delete(n)}}async function sUe(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?V("client.runtimeManageForbidden"):e.status===404?V(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):V("client.checkRuntimeUpdateFailed",{status:e.status})}async function aUe(e,t){let n=null;for(const i of Qk(t)){const r=await kt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await on(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function r7(e,t="cn-beijing",n={}){const i=qb(e,t||"cn-beijing"),r=Lm(xg,i,Tx);if(!n.force&&r)return r;const s=xg.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=aUe(e,t).then(l=>WF(xg,i,l));xg.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=xg.get(i);(l==null?void 0:l.promise)===a&&xg.set(i,{value:l.value,updatedAt:l.updatedAt})}}function rye(e,t="cn-beijing"){return Lm(xg,qb(e,t||"cn-beijing"),Tx)}function sye(e,t="cn-beijing"){r7(e,t).catch(()=>{})}async function wO(e){const t=await kt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await on(t,V("client.generateProjectFailed")));return t.json()}const oUe=19e4;async function aye(e){const t=await kt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},oUe);if(!t.ok)throw new Error(await on(t,V("client.generateAgentConfigFailed")));return Jj(t,V("client.generateAgentConfigFailed"))}async function oye(e,t){const n=await kt("/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})});if(!n.ok)throw new Error(await on(n,V("client.createDebugRunFailed")));return Jj(n,V("client.createDebugRunFailed"))}async function lye(e,t){const n=await kt(`/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 on(n,V("client.createDebugSessionFailed")));return(await Jj(n,V("client.createDebugSessionFailed"))).id}async function cye(e,t){const n=await kt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await on(n,V("client.loadDebugTraceFailed")));const i=await Jj(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*uye({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=l0e(r);let l;try{l=await kt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:a.signal},{},0)}catch(c){throw a.cleanup(),a.timedOut()?new Error($v()):c}if(!l.ok)throw a.cleanup(),new Error(await on(l,V("client.debugRunFailed")));try{for await(const c of eR(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error($v()):c}finally{a.cleanup()}}async function ey(e){const t=await kt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await on(t,V("client.cleanupDebugRunFailed")))}function dye(e){if(!e||typeof e!="object")throw new Error(V("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(V("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(V("client.invalidSandboxVersion"));return t}async function fye(e){const t=await kt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await on(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(dye)}async function hye(e){const t=await kt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await on(t,V("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(V("client.invalidSandboxUpdate"));return{updated:n.updated,state:dye(n.state)}}const lUe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:bS,DEFAULT_STUDIO_ACCESS:U0e,GithubCicdPipelineError:xO,RuntimeAccessDeniedError:Cx,RuntimeListError:i7,RuntimeProbeError:Ds,attachGithubDeliveryCicdToSourceSync:eUe,bindGithubCicdRuntime:n7,buildEnvironment:S4,cancelAgentkitDeployment:F0e,cancelCronJobRun:Y0e,checkRuntimeNameAvailability:sR,clearMessageFeedbackCache:Dbe,clearRemoteApps:Lbe,componentSearch:s0e,createCronJob:W0e,createEnvironment:T0e,createGeneratedAgentTestRun:oye,createGeneratedAgentTestSession:lye,createGithubCicdPipeline:I0e,createGithubDeliveryCicdPipeline:P0e,createGithubDeliveryRollbackPr:L0e,createSession:Hbe,createWorkspace:v0e,deleteAgentFeedbackCases:Ybe,deleteCronJob:Z0e,deleteEnvironment:_0e,deleteGeneratedAgentTestRun:ey,deleteMedia:eA,deleteRuntime:iye,deleteSession:y4,deleteSessionMedia:v4,deleteWorkspace:w0e,deployAgentkitProject:Ax,downloadArtifact:KF,ensureRuntimeRouteChannel:eye,exportEnvironmentShareCode:S0e,fetchRemoteApps:zk,generateAgentDraftFromRequirement:aye,generateAgentProject:wO,getAgentFeedbackCases:rR,getAgentInfo:w4,getAgentOptimizations:Wbe,getAgentUsage:q0e,getAutomaticEvaluationStatuses:b4,getCachedAgentFeedbackCases:Gbe,getCachedRuntimeAgentInfo:i0e,getCachedRuntimeDetail:rye,getCachedRuntimeUpdateCapability:T4,getCronJob:iUe,getEnvironmentBuild:N0e,getEnvironmentManifest:j0e,getEnvironmentResources:R0e,getGeneratedAgentTestTrace:cye,getGithubCicdRuntimeBinding:M0e,getGithubDeliveryVersions:nA,getMediaCapabilities:WBe,getMyRuntimes:tUe,getRuntimeAgentInfo:YF,getRuntimeDetail:r7,getRuntimeStudioToolCapabilities:J0e,getRuntimeUpdateCapability:oR,getRuntimes:_x,getSandboxImageUpdates:fye,getSession:iR,getSessionTrace:L_,getStudioAccess:Q0e,getStudioUpdatePermissions:V0e,getStudioUpdateStatus:z0e,getSystemInfo:h0e,getUiConfig:B0e,httpErrorMessage:on,importEnvironmentShareCodes:E0e,initializeGithubDeliveryMain:D0e,inspectEnvironmentRepository:O0e,inspectEnvironmentShareCodes:k0e,invalidateRuntimeUpdateCapabilityCache:_4,listApps:Fbe,listCronJobRuns:C4,listCronJobs:E4,listDeploymentResources:c0e,listEnvironments:Vk,listIdentityUserPools:aR,listModelApiKeys:HF,listModelOptions:Ex,listSessions:GF,listWorkspaces:t7,mediaContentUrl:t0e,parseEnvironmentManifest:m0e,parseEnvironmentShareCodes:ZF,parsePreparedSessionEnvironmentMounts:u0e,prefetchAgentFeedbackCases:HBe,prefetchRuntimeAgentInfo:r0e,prefetchRuntimeDetail:sye,prefetchRuntimeUpdateCapability:A4,prepareSessionEnvironmentMounts:d0e,previewArtifact:XF,probeRuntimeA2a:tye,probeRuntimeApps:Fv,refreshAgentFeedbackCases:Kbe,registerRemoteApp:Mbe,revealModelApiKey:$be,revealRuntimeApiKey:nye,runCronJobNow:X0e,runGeneratedAgentTestSSE:uye,runSSE:O4,runSseEmptyResponseError:o0e,runSseFirstEventTimeoutError:$v,runSseIncompleteResponseError:tA,runtimeRegionCandidates:Qk,setClientCloudProvider:zbe,setCronJobEnabled:K0e,startStudioUpdate:H0e,studioFetch:An,submitIssueFeedback:x4,submitMessageFeedback:qbe,syncGithubCicdRuntime:$0e,updateCodexSandboxToolModelEnv:ZBe,updateCronJob:G0e,updateEnvironment:A0e,updateSandboxTool:hye,updateWorkspace:x0e,uploadMedia:Jbe,upsertCachedAgentFeedbackCase:J2,webSearch:a0e,writeEnvironmentShareCode:f0e},Symbol.toStringTag,{value:"Module"})),_W=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rA=Object.freeze({modelName:"",current:_W,cumulative:_W}),cUe={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},uUe=24,dUe=64,fUe=16;function JC(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),a=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+a}function hUe(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=JC(t),s=n.reduce((d,f)=>d+dUe+JC(f),0),a=i.reduce((d,f)=>d+fUe+JC(f.name)+JC(f.description??""),0);return uUe+r+s+a}function pUe({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),a=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-a),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:a+c;return{systemTokens:a,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function mUe(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const a=i;return i+=s.tokens,{...s,start:a,end:i}});return Array.from({length:100},(s,a)=>{const l=a*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:a,slices:u}})}function L1(e,t){const n=e,i=n[t]??n[cUe[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function gUe(e){const t=L1(e,"promptTokenCount"),n=L1(e,"candidatesTokenCount"),i=L1(e,"thoughtsTokenCount");return{totalTokenCount:L1(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:L1(e,"cachedContentTokenCount")}}function bUe(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 pye(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const a=gUe(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:bUe(e.cumulative,a)}}function NW(e){return e.reduce((t,n)=>pye(t,n),rA)}function jW(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function yUe(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function vUe(e,t){if(!t)return e;const n=new Set(e.filter(r=>yUe(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function bb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Fp(e){return typeof e=="string"?e:""}function mye(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function xUe(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=bb(t)??{};return bb(n.result)??n}function wUe(e){var n;const t=(n=bb(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Fp((r=bb(i))==null?void 0:r.label)}):[]}function gye(e,t,n){const i=wUe(e),r=xUe(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=bb(s[c])??{};return{label:Fp(u.label)||i[c]||`方向 ${c+1}`,content:Fp(u.content),status:mye(u.status,a),error:Fp(u.error)}})}}function OUe(e){const t=bb(e),n=bb(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:Fp(n.requestId),branchIndex:n.branchIndex,label:Fp(n.label),delta:Fp(n.delta),status:mye(n.status,"running"),error:Fp(n.error)||void 0}}function SUe(e,t,n){return{branches:gye(e,t,"running").branches.map((s,a)=>a===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ha(e,t){return an.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const bye=28e4;function RW(e){try{return JSON.stringify(e).length}catch{return bye}}function kUe(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+RW(r),0);for(;t.length>1&&n>bye;)n-=RW(t.shift());return t}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ci(e){return typeof e=="string"?e:""}function s7(e,t=""){const n=Ci(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function yye(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 vye(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ci(e.command),n=Ci(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function wg(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function xye(e){const t=Ci(e.id||e.itemId||e.item_id),n=Ci(e.kind);if(!t||!n)return null;const i=s7(e.status),r=Ci(e.text||e.detail||e.delta),s=!Ci(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const a=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ci(e.title)||Ha("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Jl(l),u=Ci(c==null?void 0:c.text);if(!u)return[];const d=Ci(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const a=Ha(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=vye(e),c=yye(e)??(n==="status"&&r||void 0);return{id:t,block:wg(Ci(e.name||e.title)||a,t,i,l,c)}}return null}function wye(e){const t=Ci(e.type),n=Jl(e.item),i=Ci(n==null?void 0:n.type),r=Ci((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=s7(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Ci(n==null?void 0:n.text);return a?{id:r,block:i==="reasoning"?{kind:"thinking",text:a,done:s!=="running"}:{kind:"text",text:a},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Jl(c),d=Ci(u==null?void 0:u.text);if(!d)return[];const f=Ci(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ha("planTitle"),summary:Ha("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Ha(`command.${s}`);return{id:r,block:wg(a,r,s,vye(n??{}),yye(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Ha("projectFiles",{count:a.length}):Ha("projectFile"),c=Ha(`fileChange.${s}`,{subject:l});return{id:r,block:wg(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Ci(n==null?void 0:n.server),Ci(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ha("externalTool"),l=Ha(`mcp.${s}`,{tool:a}),c=Jl(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ci(c==null?void 0:c.message)||void 0;return{id:r,block:wg(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Ci(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Ha(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:wg(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Ha(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:wg(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Jl(e.error),l=Ci((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Ha("errorDetail");return{id:r,block:wg(Ha("errorTitle"),r,"failed",void 0,l)}}return null}function EUe(e){const t=Jl(e),n=Jl(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ci(n.toolName),r=Ci(n.requestId);if(!i||!r)return null;const s=Jl(n.event??n.activity);if(!s)return null;const a=Jl(s.item)||Ci(s.type)?wye(s):xye(s);if(!a)return null;const l=Ci(n.title||n.label),c=Ci(s.agentSessionId??s.agent_session_id),u=Ci(s.sandboxSessionId??s.sandbox_session_id),d=Ci(s.threadId??s.thread_id),f=s7(s.status,Ci(s.type)),m=Ci(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:a}}function CUe(e,t){const n=Jl(t),i=Jl((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ci(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ci(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Ci(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ci(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Jl(d);if(!f)continue;const h=Jl(f.item)||Ci(f.type)?wye(f):xye(f);h&&(h.finalAnswer||(c=N4(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function N4(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:kUe(n)}}const Oye="send_a2ui_json_to_client",j4="validated_a2ui_json",R4="adk_request_credential",IW="transfer_to_agent";function TUe(e){var i,r,s,a;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function I4(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function PW(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=N4(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=N4(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function AUe(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 DW(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 P4=e=>e.functionCall??e.function_call,yS=e=>e.functionResponse??e.function_response;function _Ue(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function NUe(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function lR(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const a=r==null?void 0:r.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:NUe(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function vS(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const jUe=new Set(["llm","sequential","parallel","loop","a2a"]);function RUe(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&jUe.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||a)return{skills:s,targetAgent:a}}}function IUe(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 PUe(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 DD(e,t,n){const i=e[e.length-1];i&&i.kind===t?i.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function eT(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Sye(e,t){var d,f,h,m,g,b;const n=e.blocks.map(v=>({...v}));let i=e.liveStart,r=e.pendingCodexProgress.slice();const s=((d=t.content)==null?void 0:d.parts)??[],a=s.flatMap(v=>{const y=OUe(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=EUe(v.partMetadata??v.part_metadata);return y?[y]:[]});if(a.length>0||l.length>0){for(const v of a)for(let y=n.length-1;y>=0;y-=1){const x=n[y];if(!(x.kind!=="tool"||x.done||x.name!==v.toolName||v.requestId&&x.callId&&x.callId!==v.requestId)){x.response=SUe(x.args,x.response,v),x.status="running";break}}for(const v of l)PW(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>P4(v)||yS(v));if(t.partial&&!c){for(const v of s){const y=vS(v);typeof y=="string"&&y&&DD(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=P4(v),x=yS(v),O=lR([v]),w=vS(v);if(typeof w=="string"&&w)DD(n,v.thought?"thinking":"text",w);else if(O.length)eT(n),IUe(n,O);else if(y)if(eT(n),y.name===IW){const k=_Ue(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||an.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:k,done:!1})}else if(y.name===R4){const k=y.args??{},S=k.authConfig??k.auth_config??k,C=String(k.functionCallId??k.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:C,authUri:TUe(S),authConfig:S,done:!1})}else{const k={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(k),k.callId){const S=[];for(const E of r)E.toolName===k.name&&E.requestId===k.callId?PW(n,E):S.push(E);r=S}}else if(x){if(eT(n),x.name===IW)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="agent-transfer"&&!S.done){S.done=!0;break}}if(x.name===R4)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="auth"&&!S.done){S.done=!0;break}}for(let k=n.length-1;k>=0;k--){const S=n[k],E=S.kind==="tool"&&S.name==="delegate_to_codex_sandbox";if(S.kind==="tool"&&(!S.done||E)&&S.name===x.name&&(!x.id||!S.callId||S.callId===x.id)){const C=E?DW(S.response):"";if(S.done=!0,S.response=x.response,E){S.codexActivity=CUe(S.codexActivity,x.response),S.status=AUe(x.response);const N=DW(x.response);N&&N!==C&&DD(n,"text",N)}break}}if(x.name===Oye){const k=((m=x.response)==null?void 0:m[j4])??[];if(k.length){const S=n[n.length-1];S&&S.kind==="a2ui"?S.messages.push(...k):n.push({kind:"a2ui",messages:k})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&PUe(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),eT(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function DUe(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=vS(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||lR([b]).length>0}),r=n.some(b=>{var y;const v=yS(b);return(v==null?void 0:v.name)===Oye&&Array.isArray((y=v.response)==null?void 0:y[j4])&&v.response[j4].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),a=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||a||l&&c}function MUe(e){var n,i,r;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(vS(s)||lR([s]).length>0||P4(s)||yS(s)))}function $_(e="adk-stream",t){var a,l,c;let n=0;const i=new Map;let r;const s=(u,d)=>`${d}\0${u}`;if((t==null?void 0:t.role)==="assistant"){const u=((a=t.meta)==null?void 0:a.author)??"",d=((l=t.meta)==null?void 0:l.invocationId)??"",f=((c=t.meta)==null?void 0:c.localId)??`${e}-${n++}`,h=I4();h.blocks=t.blocks,h.liveStart=t.blocks.length,r=s(u,d),i.set(r,{acc:h,localId:f,meta:{...t.meta,localId:f,streaming:!0,eventId:void 0}})}return{project(u){const d=u.author&&u.author!=="user"?u.author:"",f=u.invocationId??u.invocation_id??"",h=s(d,f);let m=i.get(h);if(!m&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,m=y)}if(!m&&!MUe(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!m){const y=`${e}-${n++}`;m={acc:I4(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}m.acc=Sye(m.acc,u);const g=u.usageMetadata??u.usage_metadata,b=DUe(u,m.acc.blocks);m.meta={...m.meta,author:d||m.meta.author,localId:m.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||m.meta.tokens,ts:u.timestamp||m.meta.ts,invocationId:f||m.meta.invocationId,eventId:b&&u.id?u.id:m.meta.eventId};const v={role:"assistant",blocks:m.acc.blocks,meta:m.meta};return b?(i.delete(h),r=void 0):i.set(h,m),{turn:v,completed:b}},finish(){const u=[...i.values()].map(d=>({role:"assistant",blocks:d.acc.blocks,meta:{...d.meta,streaming:!1}}));return i.clear(),u}}}function Dg(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(a=>{var l;return((l=a.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function LUe(e,t={}){var r;let n=[],i=$_("adk-history");for(const s of e)if(s.author==="user"){const l=((r=s.content)==null?void 0:r.parts)??[];if(l.some(h=>{var m;return((m=yS(h))==null?void 0:m.name)===R4})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let m=n[h].blocks.length-1;m>=0;m--){const g=n[h].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(vS).filter(h=>!!h).join(""),u=lR(l),d=RUe(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Dg(n,h);const f=[];d&&f.push({kind:"invocation",value:d}),u.length&&f.push({kind:"attachment",files:u}),c&&f.push({kind:"text",text:c}),n.push({role:"user",blocks:f,meta:{ts:s.timestamp}}),i=$_("adk-history")}else{const l=i.project(s);l.ignored||(n=Dg(n,l.turn))}for(const s of i.finish())n=Dg(n,s);for(const s of n){const a=s.meta,l=a==null?void 0:a.eventId;if(!l)continue;const c=t[`veadk_feedback:${l}`];if(!c||typeof c!="object")continue;const u=c;u.rating!=="good"&&u.rating!=="bad"||(a.feedback=c)}return n}function cR(e,t=an.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(a=>a.text).find(Boolean);if(s)return s}return t}function kye(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=kye(i,t,e);if(r)return r}}function $Ue(e,t){var a,l;if(e.role!=="assistant"||!t)return;const n=(a=e.meta)==null?void 0:a.author;if(!n)return;const i=kye(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 FUe(e,t){const n=[];return e.forEach((i,r)=>{const s=$Ue(i,t),a=n[n.length-1];if(s&&(a==null?void 0:a.groupKey)===s.key){a.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Eye(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},a7=e=>{const t=BUe(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?p.cloneElement(r,a,a7(s)):r}return i})},UUe="_Badge_1viyg_1",QUe={Badge:UUe},ba=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:pi(QUe.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:a7(e)});var zUe=typeof Ip=="object"&&Ip&&Ip.Object===Object&&Ip,VUe=typeof self=="object"&&self&&self.Object===Object&&self;zUe||VUe||Function("return this")();var HUe=typeof window<"u"?p.useLayoutEffect:p.useEffect;function qUe(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var MW={width:void 0,height:void 0};function Cye(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(MW),a=qUe(),l=p.useRef({...MW}),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=LW(d,f,"inlineSize"),m=LW(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):a()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:i,height:r}}function LW(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 o7(e,t){const n=p.useRef(e);HUe(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const WUe={DEV:!1,MODE:"production"},Yy=typeof import.meta<"u"?WUe:void 0,GUe=!!(Yy!=null&&Yy.DEV),KUe=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Tye=(Yy==null?void 0:Yy.MODE)==="test"||KUe,XUe=typeof window<"u",Aye=typeof document<"u",YUe=XUe&&Aye,l7=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},F_=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!YUe||typeof window.requestAnimationFrame!="function"||Aye&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function a(){r-=1,r===0?e():s=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Wb=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",a=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=a}return n},{}),MD=e=>typeof e=="number"?`${e}deg`:e,LD=e=>String(e),tT=e=>`${e}ms`,$D=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const a=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${MD(i)})`,r==null?null:`skewX(${MD(r)})`,s==null?null:`skewY(${MD(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},FD=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},ih=e=>{e.preventDefault()},_ye=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),ZUe="_LoadingIndicator_7yl6f_1",JUe={LoadingIndicator:ZUe},Hk=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:pi(JUe.LoadingIndicator,e),style:i||Wb({"indicator-size":t,"indicator-stroke":n})});var eQe=Object.defineProperty,c7=(e,t)=>eQe(e,"name",{value:t,configurable:!0});function D4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}c7(D4,"setRef");function Nye(...e){return t=>{let n=!1;const i=e.map(r=>{const s=D4(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rtQe(e,"name",{value:t,configurable:!0});function Oh(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];M4(r)&&typeof nT=="function"&&(r=nT(r._payload)),p.Children.forEach(r,h=>{var m;if(Mye(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;M4(b)&&typeof nT=="function"&&(b=nT(b._payload)),a=nQe(g,b),c.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else c.push(h)}),a?a=p.cloneElement(a,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);const u=a?Dye(a):void 0,d=ir(i,u);if(!a){if(r||r===0)throw new Error(l?sQe(e):rQe(e));return r}const f=Pye(s,a.props??{});return a.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}qu(Oh,"createSlot");var jye=Oh("Slot"),Rye=Symbol.for("radix.slottable");function Iye(e){const t=qu(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Rye,t}qu(Iye,"createSlottable");var nQe=qu((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 Pye(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}qu(Pye,"mergeProps");function Dye(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qu(Dye,"getElementRef");function Mye(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rye}qu(Mye,"isSlottable");var iQe=Symbol.for("react.lazy");function M4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===iQe&&"_payload"in e&&Lye(e._payload)}qu(M4,"isLazyComponent");function Lye(e){return typeof e=="object"&&e!==null&&"then"in e}qu(Lye,"isPromiseLike");var rQe=qu(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),sQe=qu(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),nT=Fb[" use ".trim().toString()],aQe=Object.defineProperty,oQe=(e,t)=>aQe(e,"name",{value:t,configurable:!0}),lQe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=lQe.reduce((e,t)=>{const n=Oh(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:a,...l}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function u7(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}oQe(u7,"dispatchDiscreteCustomEvent");var cQe=Object.defineProperty,uQe=(e,t)=>cQe(e,"name",{value:t,configurable:!0}),dQe=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"}),fQe=p.forwardRef(uQe(function(t,n){return o.jsx(wr.span,{...t,ref:n,style:{...dQe,...t.style}})},"VisuallyHidden")),hQe=fQe,pQe=Object.defineProperty,Qc=(e,t)=>pQe(e,"name",{value:t,configurable:!0});function mQe(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=Qc(s=>{const{children:a,...l}=s,c=p.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");i.displayName=e+"Provider";function r(s,a={}){const{optional:l=!1}=a,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Qc(r,"useContext"),[i,r]}Qc(mQe,"createContext");function kl(e,t=[]){let n=[];function i(s,a){const l=p.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Qc(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Qc(d,"useContext"),[u,d]}Qc(i,"createContext");const r=Qc(()=>{const s=n.map(a=>p.createContext(a));return Qc(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,$ye(r,...t)]}Qc(kl,"createContextScope");function $ye(...e){const t=e[0];if(e.length===1)return t;const n=Qc(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Qc(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Qc($ye,"composeContextScopes");var gQe=Object.defineProperty,Pa=(e,t)=>gQe(e,"name",{value:t,configurable:!0});function d7(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=Pa(b=>{const{scope:v,children:y}=b,x=p.useRef(null),O=p.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:O,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Oh(l),u=p.forwardRef((b,v)=>{const{scope:y,children:x}=b,O=s(l,y),w=ir(v,O.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Oh(d),m=p.forwardRef((b,v)=>{const{scope:y,children:x,...O}=b,w=p.useRef(null),k=ir(v,w),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(w,{ref:w,...O}),()=>void S.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:k,children:x})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const O=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,E)=>O.indexOf(S.ref.current)-O.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return Pa(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},g,i]}Pa(d7,"createCollection");var $W=new WeakMap,Ws,Wl,BD=(Wl=class extends Map{constructor(n){super(n);uV(this,Ws);jP(this,Ws,[...super.keys()]),$W.set(this,!0)}set(n,i){return $W.get(this)&&(this.has(n)?uo(this,Ws)[uo(this,Ws).indexOf(n)]=n:uo(this,Ws).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=uo(this,Ws).length,l=f7(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...uo(this,Ws)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const a of this)Reflect.apply(n,i,[a,s,this])&&r.push(a),s++;return new Wl(r)}map(n,i){const r=[];let s=0;for(const a of this)r.push([a[0],Reflect.apply(n,i,[a,s,this])]),s++;return new Wl(r)}reduce(...n){const[i,r]=n;let s=0,a=r??this.at(0);for(const l of this)s===0&&n.length===1?a=l:a=Reflect.apply(i,this,[a,l,s,this]),s++;return a}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,a,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new Wl(i)}toReversed(){const n=new Wl;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new Wl(i)}slice(n,i){const r=new Wl;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let a=n;a<=s;a++){const l=this.keyAt(a),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ws=new WeakMap,Pa(Wl,"OrderedDict"),Wl);function sA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Fye(e,t);return n===-1?void 0:e[n]}Pa(sA,"at");function Fye(e,t){const n=e.length,i=f7(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Pa(Fye,"toSafeIndex");function f7(e){return e!==e||e===0?0:Math.trunc(e)}Pa(f7,"toSafeInteger");function bQe(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new BD,setItemMap:Pa(()=>{},"setItemMap")}),a=Pa(({state:O,...w})=>O?o.jsx(c,{...w,state:O}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=Pa(O=>{const w=v();return o.jsx(c,{...O,state:w})},"CollectionInit");l.displayName=t+"Init";const c=Pa(O=>{const{scope:w,children:k,state:S}=O,E=p.useRef(null),[C,N]=p.useState(null),_=ir(E,N),[j,A]=S;return p.useEffect(()=>{if(!C)return;const F=Qye(()=>{});return F.observe(C,{childList:!0,subtree:!0}),()=>{F.disconnect()}},[C]),o.jsx(r,{scope:w,itemMap:j,setItemMap:A,collectionRef:_,collectionRefObject:E,collectionElement:C,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Oh(u),f=p.forwardRef((O,w)=>{const{scope:k,children:S}=O,E=s(u,k),C=ir(w,E.collectionRef);return o.jsx(d,{ref:C,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Oh(h),b=p.forwardRef((O,w)=>{const{scope:k,children:S,...E}=O,C=p.useRef(null),[N,_]=p.useState(null),j=ir(w,C,_),A=s(h,k),{setItemMap:F}=A,T=p.useRef(E);Bye(T.current,E)||(T.current=E);const P=T.current;return p.useEffect(()=>{const R=P;return F(L=>N?L.has(N)?L.set(N,{...R,element:N}).toSorted(L4):(L.set(N,{...R,element:N}),L.toSorted(L4)):L),()=>{F(L=>!N||!L.has(N)?L:(L.delete(N),new BD(L)))}},[N,P,F]),o.jsx(g,{[m]:"",ref:j,children:S})});b.displayName=h;function v(){return p.useState(new BD)}Pa(v,"useInitCollection");function y(O){const{itemMap:w}=s(e+"CollectionConsumer",O);return w}return Pa(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Pa(bQe,"createCollection");function Bye(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Pa(Bye,"shallowEqual");function Uye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Pa(Uye,"isElementPreceding");function L4(e,t){return!e[1].element||!t[1].element?0:Uye(e[1].element,t[1].element)?-1:1}Pa(L4,"sortByDocumentPosition");function Qye(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Pa(Qye,"getChildListObserver");var yQe=Object.defineProperty,Nx=(e,t)=>yQe(e,"name",{value:t,configurable:!0}),zye=!!(typeof window<"u"&&window.document&&window.document.createElement);function yn(e,t,{checkForDefaultPrevented:n=!0}={}){return Nx(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}Nx(yn,"composeEventHandlers");function vQe(e){var t;if(!zye)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Nx(vQe,"getOwnerWindow");function $4(e){if(!zye)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Nx($4,"getOwnerDocument");function Vye(e,t=!1){const{activeElement:n}=$4(e);if(!(n!=null&&n.nodeName))return null;if(Hye(n)&&n.contentDocument)return Vye(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=$4(n).getElementById(i);if(r)return r}}return n}Nx(Vye,"getActiveElement");function Hye(e){return e.tagName==="IFRAME"}Nx(Hye,"isFrame");var Jc=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},xQe=Object.defineProperty,wQe=(e,t)=>xQe(e,"name",{value:t,configurable:!0}),FW=Fb[" useEffectEvent ".trim().toString()],BW=Fb[" useInsertionEffect ".trim().toString()];function qye(e){if(typeof FW=="function")return FW(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof BW=="function"?BW(()=>{t.current=e}):Jc(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}wQe(qye,"useEffectEvent");var OQe=Object.defineProperty,qk=(e,t)=>OQe(e,"name",{value:t,configurable:!0}),SQe=Fb[" useInsertionEffect ".trim().toString()]||Jc;function su({prop:e,defaultProp:t,onChange:n=qk(()=>{},"onChange"),caller:i}){const[r,s,a]=Wye({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=Gye(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}qk(su,"useControllableState");function Wye({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return SQe(()=>{s.current=t},[t]),p.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}qk(Wye,"useUncontrolledState");function Gye(e){return typeof e=="function"}qk(Gye,"isFunction");var UW=Symbol("RADIX:SYNC_STATE");function kQe(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=qye(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===UW)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...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:UW,state:r})},[r,f.state,c]),[b,h]}qk(kQe,"useControllableStateReducer");var EQe=Object.defineProperty,Sh=(e,t)=>EQe(e,"name",{value:t,configurable:!0});function Kye(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Sh(Kye,"useStateMachine");var Gd=Sh(e=>{const{present:t,children:n}=e,i=Xye(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=Yye(i.ref,Zye(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function Xye(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),a=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=Kye(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=a.current??ty(i.current),a.current=void 0):s.current="none"},[c]),Jc(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ty(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Jc(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Sh(g=>{const v=ty(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Sh(g=>{g.target===t&&(s.current=ty(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=ty(f)}else i.current=null;n(d)},[])}}Sh(Xye,"usePresence");function F4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Sh(F4,"setRef");function Yye(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=F4(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;aCQe(e,"name",{value:t,configurable:!0}),AQe=Fb[" useId ".trim().toString()]||(()=>{}),_Qe=0;function mm(e){const[t,n]=p.useState(AQe());return Jc(()=>{e||n(i=>i??String(_Qe++))},[e]),e||(t?`radix-${t}`:"")}TQe(mm,"useId");var NQe=Object.defineProperty,jQe=(e,t)=>NQe(e,"name",{value:t,configurable:!0}),RQe=p.createContext(void 0);function Wk(e){const t=p.useContext(RQe);return e||t||"ltr"}jQe(Wk,"useDirection");var IQe=Object.defineProperty,PQe=(e,t)=>IQe(e,"name",{value:t,configurable:!0});function $u(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)},[])}PQe($u,"useCallbackRef");var DQe=Object.defineProperty,Ra=(e,t)=>DQe(e,"name",{value:t,configurable:!0}),B4="dismissableLayer.update",MQe="dismissableLayer.pointerDownOutside",LQe="dismissableLayer.focusOutside",QW,Jye=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),h7=p.forwardRef(Ra(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(Jye),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=ir(n,m),y=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),O=x?y.indexOf(x):-1,w=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=w>=O,E=p.useRef(!1),C=eve(A=>{a==null||a(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 F=[...f.branches].some(T=>T.contains(A));return S&&!F},[f.branches,S])}),N=tve(A=>{if(r&&E.current)return;const F=A.target;[...f.branches].some(P=>P.contains(F))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),_=h?w===y.length-1:!1,j=$u(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(_)return g.addEventListener("keydown",j,{capture:!0}),()=>g.removeEventListener("keydown",j,{capture:!0})},[g,_,j]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(QW=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),U4(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=QW))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),U4())},[h,f]),p.useEffect(()=>{const A=Ra(()=>b({}),"handleUpdate");return document.addEventListener(B4,A),()=>document.removeEventListener(B4,A)},[]),o.jsx(wr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:yn(t.onFocusCapture,N.onFocusCapture),onBlurCapture:yn(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:yn(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function $Qe(){const e=p.useContext(Jye),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ra($Qe,"useDismissableLayerSurface");var FQe=Ra(()=>!0,"IS_TRUE");function eve(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=FQe}=t,l=$u(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()}Ra(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ra(m,"isOutsideInteractionIntercepted");function g(O){if(!u.current)return;const w=O.target;w instanceof Node&&[...s].some(S=>S.contains(w))||d.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ra(g,"handleInteractionCapture");function b(O){u.current&&d.current.set(O.type,!1)}Ra(b,"handleInteractionBubble");const v=Ra(O=>{if(O.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const S=m();h(),S||p7(MQe,l,k,{discrete:!0})};if(Ra(w,"handleAndDispatchPointerDownOutsideEvent"),!a(O.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:O};u.current=!0,r.current=i&&O.button===0,d.current.clear(),!i||O.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of y)n.addEventListener(O,g,!0),n.addEventListener(O,b);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const O of y)n.removeEventListener(O,g,!0),n.removeEventListener(O,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:Ra(()=>c.current=!0,"onPointerDownCapture")}}Ra(eve,"usePointerDownOutside");function tve(e,t=globalThis==null?void 0:globalThis.document){const n=$u(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Ra(s=>{s.target&&!i.current&&p7(LQe,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Ra(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ra(()=>i.current=!1,"onBlurCapture")}}Ra(tve,"useFocusOutside");function U4(){const e=new CustomEvent(B4);document.dispatchEvent(e)}Ra(U4,"dispatchUpdate");function p7(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?u7(r,s):r.dispatchEvent(s)}Ra(p7,"handleAndDispatchCustomEvent");var BQe=Object.defineProperty,Bo=(e,t)=>BQe(e,"name",{value:t,configurable:!0}),UD="focusScope.autoFocusOnMount",QD="focusScope.autoFocusOnUnmount",zW={bubbles:!1,cancelable:!0},nve=p.forwardRef(Bo(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=p.useState(null),d=$u(s),f=$u(a),h=p.useRef(null),m=ir(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(w){if(g.paused||!c)return;const k=w.target;c.contains(k)?h.current=k:jf(h.current,{select:!0})},y=function(w){if(g.paused||!c)return;const k=w.relatedTarget;k!==null&&(c.contains(k)||jf(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&jf(c)};Bo(v,"handleFocusIn"),Bo(y,"handleFocusOut"),Bo(x,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const O=new MutationObserver(x);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),O.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){VW.add(g);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(UD,zW);c.addEventListener(UD,d),c.dispatchEvent(x),x.defaultPrevented||(ive(lve(m7(c)),{select:!0}),document.activeElement===v&&jf(c))}return()=>{c.removeEventListener(UD,d),setTimeout(()=>{const x=new CustomEvent(QD,zW);c.addEventListener(QD,f),c.dispatchEvent(x),x.defaultPrevented||jf(v??document.body,{select:!0}),c.removeEventListener(QD,f),VW.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,x=document.activeElement;if(y&&x){const O=v.currentTarget,[w,k]=rve(O);w&&k?!v.shiftKey&&x===k?(v.preventDefault(),i&&jf(w,{select:!0})):v.shiftKey&&x===w&&(v.preventDefault(),i&&jf(k,{select:!0})):x===O&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(wr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function ive(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(jf(i,{select:t}),document.activeElement!==n)return}Bo(ive,"focusFirst");function rve(e){const t=m7(e),n=Q4(t,e),i=Q4(t.reverse(),e);return[n,i]}Bo(rve,"getTabbableEdges");function m7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Bo(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}Bo(m7,"getTabbableCandidates");function Q4(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):sve(i,{upTo:t})))return i}Bo(Q4,"findVisible");function sve(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}Bo(sve,"isHidden");function ave(e){return e instanceof HTMLInputElement&&"select"in e}Bo(ave,"isSelectableInput");function jf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ave(e)&&t&&e.select()}}Bo(jf,"focus");var VW=ove();function ove(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=z4(e,t),e.unshift(t)},remove(t){var n;e=z4(e,t),(n=e[0])==null||n.resume()}}}Bo(ove,"createFocusScopesStack");function z4(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Bo(z4,"arrayRemove");function lve(e){return e.filter(t=>t.tagName!=="A")}Bo(lve,"removeLinks");var UQe=Object.defineProperty,QQe=(e,t)=>UQe(e,"name",{value:t,configurable:!0}),g7=p.forwardRef(QQe(function(t,n){var c;const{container:i,...r}=t,[s,a]=p.useState(!1);Jc(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?Li.createPortal(o.jsx(wr.div,{...r,ref:n}),l):null},"Portal")),zQe=Object.defineProperty,b7=(e,t)=>zQe(e,"name",{value:t,configurable:!0}),iT=0,ad=null;function VQe(e){return uR(),e.children}b7(VQe,"FocusGuards");function uR(){p.useEffect(()=>{ad||(ad={start:V4(),end:V4()});const{start:e,end:t}=ad;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),iT++,()=>{iT===1&&(ad==null||ad.start.remove(),ad==null||ad.end.remove(),ad=null),iT=Math.max(0,iT-1)}},[])}b7(uR,"useFocusGuards");function V4(){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}b7(V4,"createFocusGuard");var bd=function(){return bd=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return oze;var t=lze(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])}},uze=fve(),Zy="data-scroll-locked",dze=function(e,t,n,i){var r=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(qQe,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } @@ -483,12 +483,12 @@ ${n}`}}async function*hBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follo } body[`).concat(Zy,`] { - `).concat(qQe,": ").concat(l,`px; + `).concat(WQe,": ").concat(l,`px; } -`)},qW=function(){var e=parseInt(document.body.getAttribute(Zy)||"0",10);return isFinite(e)?e:0},dze=function(){p.useEffect(function(){return document.body.setAttribute(Zy,(qW()+1).toString()),function(){var e=qW()-1;e<=0?document.body.removeAttribute(Zy):document.body.setAttribute(Zy,e.toString())}},[])},fze=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;dze();var s=p.useMemo(function(){return lze(r)},[r]);return p.createElement(cze,{styles:uze(s,!t,r,n?"":"!important")})},H4=!1;if(typeof window<"u")try{var rT=Object.defineProperty({},"passive",{get:function(){return H4=!0,!0}});window.addEventListener("test",rT,rT),window.removeEventListener("test",rT,rT)}catch{H4=!1}var j0=H4?{passive:!1}:!1,hze=function(e){return e.tagName==="TEXTAREA"},fve=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hze(e)&&n[t]==="visible")},pze=function(e){return fve(e,"overflowY")},mze=function(e){return fve(e,"overflowX")},WW=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=hve(e,i);if(r){var s=pve(e,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},gze=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},bze=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},hve=function(e,t){return e==="v"?pze(t):mze(t)},pve=function(e,t){return e==="v"?gze(t):bze(t)},yze=function(e,t){return e==="h"&&t==="rtl"?-1:1},vze=function(e,t,n,i,r){var s=yze(e,window.getComputedStyle(t).direction),a=s*i,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{if(!l)break;var m=pve(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&hve(e,l)&&(f+=y,h+=g);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},sT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GW=function(e){return[e.deltaX,e.deltaY]},KW=function(e){return e&&"current"in e?e.current:e},xze=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wze=function(e){return` +`)},qW=function(){var e=parseInt(document.body.getAttribute(Zy)||"0",10);return isFinite(e)?e:0},fze=function(){p.useEffect(function(){return document.body.setAttribute(Zy,(qW()+1).toString()),function(){var e=qW()-1;e<=0?document.body.removeAttribute(Zy):document.body.setAttribute(Zy,e.toString())}},[])},hze=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;fze();var s=p.useMemo(function(){return cze(r)},[r]);return p.createElement(uze,{styles:dze(s,!t,r,n?"":"!important")})},H4=!1;if(typeof window<"u")try{var rT=Object.defineProperty({},"passive",{get:function(){return H4=!0,!0}});window.addEventListener("test",rT,rT),window.removeEventListener("test",rT,rT)}catch{H4=!1}var j0=H4?{passive:!1}:!1,pze=function(e){return e.tagName==="TEXTAREA"},hve=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pze(e)&&n[t]==="visible")},mze=function(e){return hve(e,"overflowY")},gze=function(e){return hve(e,"overflowX")},WW=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=pve(e,i);if(r){var s=mve(e,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},bze=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},yze=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},pve=function(e,t){return e==="v"?mze(t):gze(t)},mve=function(e,t){return e==="v"?bze(t):yze(t)},vze=function(e,t){return e==="h"&&t==="rtl"?-1:1},xze=function(e,t,n,i,r){var s=vze(e,window.getComputedStyle(t).direction),a=s*i,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{if(!l)break;var m=mve(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&pve(e,l)&&(f+=y,h+=g);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},sT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GW=function(e){return[e.deltaX,e.deltaY]},KW=function(e){return e&&"current"in e?e.current:e},wze=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Oze=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Oze=0,R0=[];function Sze(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Oze++)[0],s=p.useState(dve)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=VQe([e.lockRef.current],(e.shards||[]).map(KW),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=sT(b),x=n.current,O="deltaX"in b?b.deltaX:x[0]-y[0],w="deltaY"in b?b.deltaY:x[1]-y[1],k,S=b.target,E=Math.abs(O)>Math.abs(w)?"h":"v";if("touches"in b&&E==="h"&&S.type==="range")return!1;var C=window.getSelection(),N=C&&C.anchorNode,_=N?N===S||N.contains(S):!1;if(_)return!1;var j=WW(E,S);if(!j)return!0;if(j?k=E:(k=E==="v"?"h":"v",j=WW(E,S)),!j)return!1;if(!i.current&&"changedTouches"in b&&(O||w)&&(i.current=k),!k)return!0;var A=i.current||k;return vze(A,v,b,A==="h"?O:w)},[]),c=p.useCallback(function(b){var v=b;if(!(!R0.length||R0[R0.length-1]!==s)){var y="deltaY"in v?GW(v):sT(v),x=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&xze(k.delta,y)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var O=(a.current.shards||[]).map(KW).filter(Boolean).filter(function(k){return k.contains(v.target)}),w=O.length>0?l(v,O[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,x){var O={name:b,delta:v,target:y,should:x,shadowParent:kze(y)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(w){return w!==O})},1)},[]),d=p.useCallback(function(b){n.current=sT(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,GW(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,sT(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return R0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,j0),document.addEventListener("touchmove",c,j0),document.addEventListener("touchstart",d,j0),function(){R0=R0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,j0),document.removeEventListener("touchmove",c,j0),document.removeEventListener("touchstart",d,j0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:wze(r)}):null,m?p.createElement(fze,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kze(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Eze=JQe(uve,Sze);var y7=p.forwardRef(function(e,t){return p.createElement(dR,bd({},e,{ref:t,sideCar:Eze}))});y7.classNames=dR.classNames;var Cze=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},I0=new WeakMap,aT=new WeakMap,oT={},qD=0,mve=function(e){return e&&(e.host||mve(e.parentNode))},Tze=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=mve(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})},Aze=function(e,t,n,i){var r=Tze(t,Array.isArray(e)?e:[e]);oT[n]||(oT[n]=new WeakMap);var s=oT[n],a=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(I0.get(h)||0)+1,v=(s.get(h)||0)+1;I0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&aT.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),qD++,function(){a.forEach(function(f){var h=I0.get(f)-1,m=s.get(f)-1;I0.set(f,h),s.set(f,m),h||(aT.has(f)||f.removeAttribute(i),aT.delete(f)),m||f.removeAttribute(n)}),qD--,qD||(I0=new WeakMap,I0=new WeakMap,aT=new WeakMap,oT={})}},gve=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Cze(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Aze(i,r,n,"aria-hidden")):function(){return null}},_ze=Object.defineProperty,Nze=(e,t)=>_ze(e,"name",{value:t,configurable:!0});function Gk(e){const[t,n]=p.useState(void 0);return Jc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Nze(Gk,"useSize");var jze=Object.defineProperty,kh=(e,t)=>jze(e,"name",{value:t,configurable:!0}),v7="Checkbox",[Rze,YVt]=kl(v7),[Ize,x7]=Rze(v7);function bve(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=su({prop:n,defaultProp:r??!1,onChange:c,caller:v7}),[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useRef(!1),[O,w]=p.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:rh(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(Ize,{scope:t,...S,children:yve(f)?f(S):i})}kh(bve,"CheckboxProvider");var Pze="CheckboxTrigger",Dze=p.forwardRef(kh(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=x7(Pze,t),y=ir(s,f),x=p.useRef(u);return p.useEffect(()=>{const O=a==null?void 0:a.form;if(O){const w=kh(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[a,h]),o.jsx(wr.button,{type:"button",role:"checkbox","aria-checked":rh(u)?"mixed":u,"aria-required":d,"data-state":w7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:yn(n,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:yn(i,O=>{g(),h(w=>rh(w)?!0:!w),v&&b&&(m.current=O.isPropagationStopped(),m.current||O.stopPropagation())})})},"CheckboxTrigger")),Mze=p.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(bve,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(Dze,{...h,ref:n,__scopeCheckbox:i}),m&&o.jsx(Bze,{__scopeCheckbox:i})]})})},"Checkbox")),Lze="CheckboxIndicator",$ze=p.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=x7(Lze,i);return o.jsx(Gd,{present:r||rh(a.checked)||a.checked===!0,children:o.jsx(wr.span,{"data-state":w7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Fze="CheckboxBubbleInput",Bze=p.forwardRef(kh(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=x7(Fze,t),y=ir(r,v),x=Gk(s),O=p.useRef(!1),w=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});E.indeterminate=rh(c),_.call(E,rh(c)?!1:c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=p.useRef(rh(c)?!1:c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function yve(e){return typeof e=="function"}kh(yve,"isFunction");function rh(e){return e==="indeterminate"}kh(rh,"isIndeterminate");function w7(e){return rh(e)?"indeterminate":e?"checked":"unchecked"}kh(w7,"getState");const Uze=["top","right","bottom","left"],gm=Math.min,sh=Math.max,B_=Math.round,lT=Math.floor,ah=e=>({x:e,y:e}),Qze={left:"right",right:"left",bottom:"top",top:"bottom"};function vve(e,t,n){return sh(e,gm(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function bm(e){return e.split("-")[0]}function jx(e){return e.split("-")[1]}function O7(e){return e==="x"?"y":"x"}function S7(e){return e==="y"?"height":"width"}function Ed(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function k7(e){return O7(Ed(e))}function zze(e,t,n){n===void 0&&(n=!1);const i=jx(e),r=k7(e),s=S7(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=U_(a)),[a,U_(a)]}function Vze(e){const t=U_(e);return[q4(e),t,q4(t)]}function q4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const XW=["left","right"],YW=["right","left"],Hze=["top","bottom"],qze=["bottom","top"];function Wze(e,t,n){switch(e){case"top":case"bottom":return n?t?YW:XW:t?XW:YW;case"left":case"right":return t?Hze:qze;default:return[]}}function Gze(e,t,n,i){const r=jx(e);let s=Wze(bm(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(q4)))),s}function U_(e){const t=bm(e);return Qze[t]+e.slice(t.length)}function Kze(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 xve(e){return typeof e!="number"?Kze(e):{top:e,right:e,bottom:e,left:e}}function Q_(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function ZW(e,t,n){let{reference:i,floating:r}=e;const s=Ed(t),a=k7(t),l=S7(a),c=bm(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let 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=jx(t);return g&&(m[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function Xze(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Eh(t,e),g=xve(m),v=l[h?f==="floating"?"reference":"floating":f],y=Q_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(O))&&await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1},k=Q_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:O,strategy:c}):x);return{top:(y.top-k.top+g.top)/w.y,bottom:(k.bottom-y.bottom+g.bottom)/w.y,left:(y.left-k.left+g.left)/w.x,right:(k.right-y.right+g.right)/w.x}}const Yze=50,Zze=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Xze},c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=ZW(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=xve(d),h={x:n,y:i},m=k7(r),g=S7(m),b=await a.getDimensions(u),v=m==="y",y=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=S?S[O]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=l.floating[O]||s.floating[g]);const C=w/2-k/2,N=E/2-b[g]/2-1,_=gm(f[y],N),j=gm(f[x],N),A=E-b[g]-j,F=E/2-b[g]/2+C,T=vve(_,F,A),P=!c.arrow&&jx(r)!=null&&F!==T&&s.reference[g]/2-(F<_?_:j)-b[g]/2<0,R=P?F<_?F-_:F-A:0;return{[m]:h[m]+R,data:{[m]:T,centerOffset:F-T-R,...P&&{alignmentOffset:R}},reset:P}}}),eVe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=Eh(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=bm(r),x=Ed(l),O=bm(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=h||(O||!b?[U_(l)]:Vze(l)),S=g!=="none";!h&&S&&k.push(...Gze(l,b,g,w));const E=[l,...k],C=await c.detectOverflow(t,v),N=[];let _=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&N.push(C[y]),f){const T=zze(r,a,w);N.push(C[T[0]],C[T[1]])}if(_=[..._,{placement:r,overflows:N}],!N.every(T=>T<=0)){var j,A;const T=(((j=s.flip)==null?void 0:j.index)||0)+1,P=E[T];if(P&&(!(f==="alignment"?x!==Ed(P):!1)||_.every(M=>Ed(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:T,overflows:_},reset:{placement:P}};let R=(A=_.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(m){case"bestFit":{var F;const L=(F=_.filter(M=>{if(S){const U=Ed(M.placement);return U===x||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,I)=>U+I,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:F[0];L&&(R=L);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function JW(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eG(e){return Uze.some(t=>e[t]>=0)}const tVe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=JW(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:eG(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=JW(a,n.floating);return{data:{escapedOffsets:l,escaped:eG(l)}}}default:return{}}}}},wve=new Set(["left","top"]);async function nVe(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=bm(n),l=jx(n),c=Ed(n)==="y",u=wve.has(a)?-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 iVe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:a,middlewareData:l}=t,c=await nVe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},rVe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:O,y:w}=x;return{x:O,y:w}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Ed(r),m=O7(h);let g=d[m],b=d[h];const v=(x,O)=>vve(O+f[x==="y"?"top":"left"],O,O-f[x==="y"?"bottom":"right"]);a&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:a,[h]:l}}}}}},sVe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},m=Ed(a),g=O7(m);let b=h[g],v=h[m];const y=Eh(u,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+x.mainAxis,E=l.reference[g]+l.reference[k]-x.mainAxis;bE&&(b=E)}if(f){var O,w;const k=g==="y"?"width":"height",S=wve.has(bm(a)),E=l.reference[m]-l.floating[k]+(S&&((O=c.offset)==null?void 0:O[m])||0)+(S?0:x.crossAxis),C=l.reference[m]+l.reference[k]+(S?0:((w=c.offset)==null?void 0:w[m])||0)-(S?x.crossAxis:0);vC&&(v=C)}return{[g]:b,[m]:v}}}},aVe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:a=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=bm(n),d=jx(n),f=Ed(n)==="y",{width:h,height: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,x=gm(m-c[g],v),O=gm(h-c[b],y),w=t.middlewareData.shift,k=!w;let S=x,E=O;w!=null&&w.enabled.x&&(E=y),w!=null&&w.enabled.y&&(S=v),k&&!d&&(f?E=h-2*sh(c.left,c.right):S=m-2*sh(c.top,c.bottom)),await a({...t,availableWidth:E,availableHeight:S});const C=await r.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function fR(){return typeof window<"u"}function Rx(e){return Ove(e)?(e.nodeName||"").toLowerCase():"#document"}function yo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $h(e){var t;return(t=(Ove(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ove(e){return fR()?e instanceof Node||e instanceof yo(e).Node:!1}function Fd(e){return fR()?e instanceof Element||e instanceof yo(e).Element:!1}function Kd(e){return fR()?e instanceof HTMLElement||e instanceof yo(e).HTMLElement:!1}function tG(e){return!fR()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yo(e).ShadowRoot}function hR(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Bd(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function oVe(e){return/^(table|td|th)$/.test(Rx(e))}function pR(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const lVe=/transform|translate|scale|rotate|perspective|filter/,cVe=/paint|layout|strict|content/,tg=e=>!!e&&e!=="none";let WD;function E7(e){const t=Fd(e)?Bd(e):e;return tg(t.transform)||tg(t.translate)||tg(t.scale)||tg(t.rotate)||tg(t.perspective)||!C7()&&(tg(t.backdropFilter)||tg(t.filter))||lVe.test(t.willChange||"")||cVe.test(t.contain||"")}function uVe(e){let t=yb(e);for(;Kd(t)&&!xS(t);){if(E7(t))return t;if(pR(t))return null;t=yb(t)}return null}function C7(){return WD==null&&(WD=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),WD}function xS(e){return/^(html|body|#document)$/.test(Rx(e))}function Bd(e){return yo(e).getComputedStyle(e)}function mR(e){return Fd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yb(e){if(Rx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tG(e)&&e.host||$h(e);return tG(t)?t.host:t}function Sve(e){const t=yb(e);return xS(t)?(e.ownerDocument||e).body:Kd(t)&&hR(t)?t:Sve(t)}function wS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Sve(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=yo(r);if(s){const l=W4(a);return t.concat(a,a.visualViewport||[],hR(r)?r:[],l&&n?wS(l):[])}else return t.concat(r,wS(r,[],n))}function W4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kve(e){const t=Bd(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Kd(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=B_(n)!==s||B_(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function T7(e){return Fd(e)?e:e.contextElement}function Jy(e){const t=T7(e);if(!Kd(t))return ah(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=kve(t);let a=(s?B_(n.width):n.width)/i,l=(s?B_(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const dVe=ah(0);function Eve(e){const t=yo(e);return!C7()||!t.visualViewport?dVe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fVe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===yo(e)}function vb(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=T7(e);let a=ah(1);t&&(i?Fd(i)&&(a=Jy(i)):a=Jy(e));const l=fVe(s,n,i)?Eve(s):ah(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(s&&i){const h=yo(s),m=Fd(i)?yo(i):i;let g=h,b=W4(g);for(;b&&m!==g;){const v=Jy(b),y=b.getBoundingClientRect(),x=Bd(b),O=y.left+(b.clientLeft+parseFloat(x.paddingLeft))*v.x,w=y.top+(b.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=O,u+=w,g=yo(b),b=W4(g)}}return Q_({width:d,height:f,x:c,y:u})}function gR(e,t){const n=mR(e).scrollLeft;return t?t.left+n:vb($h(e)).left+n}function Cve(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-gR(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function hVe(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=$h(i),l=t?pR(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ah(1);const d=ah(0),f=Kd(i);if((f||!s)&&((Rx(i)!=="body"||hR(a))&&(c=mR(i)),f)){const m=vb(i);u=Jy(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=a&&!f&&!s?Cve(a,c):ah(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function pVe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function mVe(e){const t=mR(e),n=e.ownerDocument.body,i=sh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=sh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+gR(e);const a=-t.scrollTop;return Bd(n).direction==="rtl"&&(s+=sh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const gVe=25;function bVe(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=yo(e),s=$h(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!C7()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(gR(s)<=0){const h=s.ownerDocument,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<=gVe&&(l-=y)}return{width:l,height:c,x:u,y:d}}function yVe(e,t){const n=vb(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=Jy(e),a=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:a,height:l,x:c,y:u}}function nG(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=bVe(e,n,t);else if(t==="document")i=mVe($h(e));else if(Fd(t))i=yVe(t,n);else{const r=Eve(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Q_(i)}function vVe(e,t){const n=t.get(e);if(n)return n;let i=wS(e,[],!1).filter(l=>Fd(l)&&Rx(l)!=="body"),r=null;const s=Bd(e).position==="fixed";let a=s?yb(e):e;for(;Fd(a)&&!xS(a);){const l=Bd(a),c=E7(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=yb(a)}return t.set(e,i),i}function xVe(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?pR(t)?[]:vVe(t,this._c):[].concat(n),i],l=nG(t,a[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}E=!1}try{i=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(C,S)}i.observe(e)}const c=yo(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function TVe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=T7(e),d=r||s?[...u?wS(u):[],...t?wS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?CVe(u,n,s):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var O;(O=m)==null||O.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?vb(e):null;c&&v();function v(){const y=vb(e);b&&!Ave(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const AVe=iVe,_Ve=rVe,NVe=eVe,jVe=aVe,RVe=tVe,rG=Jze,IVe=sVe,PVe=(e,t,n)=>{const i=new Map,r=n??{},s={...EVe,...r.platform,_c:i};return Zze(e,t,{...r,platform:s})};var DVe=typeof document<"u",MVe=function(){},lA=DVe?p.useLayoutEffect:MVe;function z_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!z_(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!z_(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _ve(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sG(e,t){const n=_ve(e);return Math.round(t*n)/n}function KD(e){const t=p.useRef(e);return lA(()=>{t.current=e}),t}function LVe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);z_(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useCallback(M=>{M!==S.current&&(S.current=M,b(M))},[]),O=p.useCallback(M=>{M!==E.current&&(E.current=M,y(M))},[]),w=s||g,k=a||v,S=p.useRef(null),E=p.useRef(null),C=p.useRef(d),N=c!=null,_=KD(c),j=KD(r),A=KD(u),F=p.useCallback(()=>{if(!S.current||!E.current)return;const M={placement:t,strategy:n,middleware:h};j.current&&(M.platform=j.current),PVe(S.current,E.current,M).then(U=>{const I={...U,isPositioned:A.current!==!1};T.current&&!z_(C.current,I)&&(C.current=I,Li.flushSync(()=>{f(I)}))})},[h,t,n,j,A]);lA(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const T=p.useRef(!1);lA(()=>(T.current=!0,()=>{T.current=!1}),[]),lA(()=>{if(w&&(S.current=w),k&&(E.current=k),w&&k){if(_.current)return _.current(w,k,F);F()}},[w,k,F,_,N]);const P=p.useMemo(()=>({reference:S,floating:E,setReference:x,setFloating:O}),[x,O]),R=p.useMemo(()=>({reference:w,floating:k}),[w,k]),L=p.useMemo(()=>{const M={position:n,left:0,top:0};if(!R.floating)return M;const U=sG(R.floating,d.x),I=sG(R.floating,d.y);return l?{...M,transform:"translate("+U+"px, "+I+"px)",..._ve(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:I}},[n,l,R.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:P,elements:R,floatingStyles:L}),[d,F,P,R,L])}const $Ve=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?rG({element:i.current,padding:r}).fn(n):{}:i?rG({element:i,padding:r}).fn(n):{}}}},FVe=(e,t)=>{const n=AVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},BVe=(e,t)=>{const n=_Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}},UVe=(e,t)=>({fn:IVe(e).fn,options:[e,t]}),QVe=(e,t)=>{const n=NVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},zVe=(e,t)=>{const n=jVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},VVe=(e,t)=>{const n=RVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},HVe=(e,t)=>{const n=$Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}};var qVe=Object.defineProperty,em=(e,t)=>qVe(e,"name",{value:t,configurable:!0}),Nve="Popper",[jve,Ix]=kl(Nve),[WVe,Rve]=jve(Nve),GVe=em(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,a]=p.useState(void 0);return o.jsx(WVe,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),KVe="PopperAnchor",XVe=p.forwardRef(em(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=Rve(KVe,i),l=p.useRef(null),c=a.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=ir(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&bR(a.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(wr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Ive="PopperContent",[YVe,ZVt]=jve(Ive),ZVe=p.forwardRef(em(function(t,n){var re,ge,W,X,ae,ue,Oe;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=Rve(Ive,i),[x,O]=p.useState(null),w=ir(n,O),[k,S]=p.useState(null),E=Gk(k),C=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,_=r+(a!=="center"?"-"+a:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],F=A.length>0,T={padding:j,boundary:A.filter(Pve),altBoundary:F},{refs:P,floatingStyles:R,placement:L,isPositioned:M,middlewareData:U}=LVe({strategy:"fixed",placement:_,whileElementsMounted:em((...ke)=>TVe(...ke,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[FVe({mainAxis:s+N,alignmentAxis:l}),u&&BVe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?UVe():void 0,...T}),u&&QVe({...T}),zVe({...T,apply:em(({elements:ke,rects:st,availableWidth:Le,availableHeight:Me})=>{const{width:Ie,height:qe}=st.reference,Ae=ke.floating.style;Ae.setProperty("--radix-popper-available-width",`${Le}px`),Ae.setProperty("--radix-popper-available-height",`${Me}px`),Ae.setProperty("--radix-popper-anchor-width",`${Ie}px`),Ae.setProperty("--radix-popper-anchor-height",`${qe}px`)},"apply")}),k&&HVe({element:k,padding:c}),JVe({arrowWidth:C,arrowHeight:N}),m&&VVe({strategy:"referenceHidden",...T,boundary:F?T.boundary:void 0})]}),I=y.setPlacementState;Jc(()=>(I(L),()=>{I(void 0)}),[L,I]);const[H,K]=bR(L),Q=$u(b);Jc(()=>{M&&(Q==null||Q())},[M,Q]);const q=(re=U.arrow)==null?void 0:re.x,B=(ge=U.arrow)==null?void 0:ge.y,ee=((W=U.arrow)==null?void 0:W.centerOffset)!==0,[le,se]=p.useState();return Jc(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:M?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(X=U.transformOrigin)==null?void 0:X.x,(ae=U.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=U.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(YVe,{scope:i,placedSide:H,placedAlign:K,onArrowChange:S,arrowX:q,arrowY:B,shouldHideArrow:ee,children:o.jsx(wr.div,{"data-side":H,"data-align":K,...v,ref:w,style:{...v.style,animation:M?(Oe=v.style)==null?void 0:Oe.animation:"none"}})})})},"PopperContent"));function Pve(e){return e!==null}em(Pve,"isNotNull");var JVe=em(e=>({name:"transformOrigin",options:e,fn(t){var v,y,x;const{placement:n,rects:i,middlewareData:r}=t,a=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=bR(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((x=r.arrow)==null?void 0:x.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=a?f:`${h}px`,b=`${-c}px`):u==="top"?(g=a?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=a?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function bR(e){const[t,n="center"]=e.split("-");return[t,n]}em(bR,"getSideAndAlignFromPlacement");var yR=GVe,A7=XVe,_7=ZVe,eHe=Object.defineProperty,N7=(e,t)=>eHe(e,"name",{value:t,configurable:!0}),XD=!1;function Dve(){const[e,t]=p.useState(XD);return p.useEffect(()=>{XD||(XD=!0,t(!0))},[]),e}N7(Dve,"useIsHydrated");var Mve=Fb[" useSyncExternalStore ".trim().toString()];function Lve(){return()=>{}}N7(Lve,"subscribe");function $ve(){return Mve(Lve,()=>!0,()=>!1)}N7($ve,"useIsHydratedModern");var tHe=typeof Mve=="function"?$ve:Dve,nHe=Object.defineProperty,Gb=(e,t)=>nHe(e,"name",{value:t,configurable:!0}),YD="rovingFocusGroup.onEntryFocus",iHe={bubbles:!1,cancelable:!0},vR="RovingFocusGroup",[G4,Fve,rHe]=d7(vR),[sHe,Px]=kl(vR,[rHe]),[aHe,oHe]=sHe(vR),lHe=p.forwardRef(Gb(function(t,n){return o.jsx(G4.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(G4.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(cHe,{...t,ref:n})})})},"RovingFocusGroup")),cHe=p.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=ir(n,m),b=Wk(a),[v,y]=su({prop:l,defaultProp:c??null,onChange:u,caller:vR}),[x,O]=p.useState(!1),w=$u(d),k=Fve(i),S=p.useRef(!1),[E,C]=p.useState(0);return p.useEffect(()=>{const N=m.current;if(N)return N.addEventListener(YD,w),()=>N.removeEventListener(YD,w)},[w]),o.jsx(aHe,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(N=>y(N),[y]),onItemShiftTab:p.useCallback(()=>O(!0),[]),onFocusableItemAdd:p.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:p.useCallback(()=>C(N=>N-1),[]),children:o.jsx(wr.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:yn(t.onMouseDown,()=>{S.current=!0}),onFocus:yn(t.onFocus,N=>{const _=!S.current;if(N.target===N.currentTarget&&_&&!x){const j=new CustomEvent(YD,iHe);if(N.currentTarget.dispatchEvent(j),!j.defaultPrevented){const A=k().filter(L=>L.focusable),F=A.find(L=>L.active),T=A.find(L=>L.id===v),R=[F,T,...A].filter(Boolean).map(L=>L.ref.current);j7(R,f)}}S.current=!1}),onBlur:yn(t.onBlur,()=>O(!1))})})},"RovingFocusGroupImpl")),uHe="RovingFocusGroupItem",dHe=p.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=mm(),d=a||u,f=oHe(uHe,i),h=f.currentTabStopId===d,m=Fve(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=tHe();return Jc(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(G4.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(wr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:yn(t.onMouseDown,x=>{r?f.onItemFocus(d):x.preventDefault()}),onFocus:yn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:yn(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const O=Uve(x,f.orientation,f.dir);if(O!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=f.loop?Qve(k,S+1):k.slice(S+1)}setTimeout(()=>j7(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),fHe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Gb(Bve,"getDirectionAwareKey");function Uve(e,t,n){const i=Bve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return fHe[i]}Gb(Uve,"getFocusIntent");function j7(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Gb(j7,"focusFirst");function Qve(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Gb(Qve,"wrapArray");var R7=lHe,I7=dHe,hHe=Object.defineProperty,Qi=(e,t)=>hHe(e,"name",{value:t,configurable:!0}),K4=["Enter"," "],pHe=["ArrowDown","PageUp","Home"],zve=["ArrowUp","PageDown","End"],mHe=[...pHe,...zve],gHe={ltr:[...K4,"ArrowRight"],rtl:[...K4,"ArrowLeft"]},bHe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xR="Menu",[OS,yHe,vHe]=d7(xR),[Kb,Vve]=kl(xR,[vHe,Ix,Px]),wR=Ix(),Hve=Px(),[qve,$m]=Kb(xR),[xHe,Kk]=Kb(xR),wHe=Qi(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=wR(t),[c,u]=p.useState(null),d=p.useRef(!1),f=$u(s),h=Wk(r);return p.useEffect(()=>{const m=Qi(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Qi(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",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=Qi(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),o.jsx(yR,{...l,children:o.jsx(qve,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(xHe,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),Wve=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t,s=wR(i);return o.jsx(A7,{...s,...r,ref:n})},"MenuAnchor")),Gve="MenuPortal",[OHe,Kve]=Kb(Gve,{forceMount:void 0}),SHe=Qi(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=$m(Gve,t);return o.jsx(OHe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"MenuPortal"),Pu="MenuContent",[kHe,P7]=Kb(Pu),EHe=p.forwardRef(Qi(function(t,n){const i=Kve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=$m(Pu,t.__scopeMenu),l=Kk(Pu,t.__scopeMenu);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||a.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(CHe,{...s,ref:n}):o.jsx(THe,{...s,ref:n})})})})},"MenuContent")),CHe=p.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu),r=p.useRef(null),s=ir(n,r);return p.useEffect(()=>{const a=r.current;if(a)return gve(a)},[]),o.jsx(D7,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:yn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),THe=p.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu);return o.jsx(D7,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),AHe=Oh("MenuContent.ScrollLock"),D7=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=$m(Pu,i),x=Kk(Pu,i),O=wR(i),w=Hve(i),k=yHe(i),[S,E]=p.useState(null),C=p.useRef(null),N=ir(n,C,y.onContentChange),_=p.useRef(0),j=p.useRef(""),A=p.useRef(0),F=p.useRef(null),T=p.useRef("right"),P=p.useRef(0),R=b?y7:p.Fragment,L=b?{as:AHe,allowPinchZoom:!0}:void 0,M=Qi(I=>{var se,re;const H=j.current+I,K=k().filter(ge=>!ge.disabled),Q=document.activeElement,q=(se=K.find(ge=>ge.ref.current===Q))==null?void 0:se.textValue,B=K.map(ge=>ge.textValue),ee=ixe(B,H,q),le=(re=K.find(ge=>ge.textValue===ee))==null?void 0:re.ref.current;Qi(function ge(W){j.current=W,window.clearTimeout(_.current),W!==""&&(_.current=window.setTimeout(()=>ge(""),1e3))},"updateSearch")(H),le&&setTimeout(()=>le.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(_.current),[]),uR();const U=p.useCallback(I=>{var K,Q;return T.current===((K=F.current)==null?void 0:K.side)&&sxe(I,(Q=F.current)==null?void 0:Q.area)},[]);return o.jsx(kHe,{scope:i,searchRef:j,onItemEnter:p.useCallback(I=>{U(I)&&I.preventDefault()},[U]),onItemLeave:p.useCallback(I=>{var H;U(I)||((H=C.current)==null||H.focus(),E(null))},[U]),onTriggerLeave:p.useCallback(I=>{U(I)&&I.preventDefault()},[U]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(I=>{F.current=I},[]),children:o.jsx(R,{...L,children:o.jsx(tve,{asChild:!0,trapped:s,onMountAutoFocus:yn(a,I=>{var H;I.preventDefault(),(H=C.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:o.jsx(R7,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:yn(u,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(_7,{role:"menu","aria-orientation":"vertical","data-state":L7(y.open),"data-radix-menu-content":"",dir:x.dir,...O,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:yn(v.onKeyDown,I=>{const K=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Q=I.ctrlKey||I.altKey||I.metaKey,q=I.key.length===1;K&&(I.key==="Tab"&&I.preventDefault(),!Q&&q&&M(I.key));const B=C.current;if(I.target!==B||!mHe.includes(I.key))return;I.preventDefault();const le=k().filter(se=>!se.disabled).map(se=>se.ref.current);zve.includes(I.key)&&le.reverse(),txe(le)}),onBlur:yn(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),j.current="")}),onPointerMove:yn(t.onPointerMove,Bv(I=>{const H=I.target,K=P.current!==I.clientX;if(I.currentTarget.contains(H)&&K){const Q=I.clientX>P.current?"right":"left";T.current=Q,P.current=I.clientX}}))})})})})})})},"MenuContentImpl")),_He=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"group",...r,ref:n})},"MenuGroup")),X4="MenuItem",aG="menu.itemSelect",M7=p.forwardRef(Qi(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=p.useRef(null),l=Kk(X4,t.__scopeMenu),c=P7(X4,t.__scopeMenu),u=ir(n,a),d=p.useRef(!1),f=Qi(()=>{const h=a.current;if(!i&&h){const m=new CustomEvent(aG,{bubbles:!0,cancelable:!0});h.addEventListener(aG,g=>r==null?void 0:r(g),{once:!0}),u7(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(Xve,{...s,ref:u,disabled:i,onClick:yn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:yn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:yn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||K4.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Xve=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=P7(X4,i),c=Hve(i),u=p.useRef(null),d=ir(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(OS.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:o.jsx(I7,{asChild:!0,...c,focusable:!r,children:o.jsx(wr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:yn(t.onPointerMove,Bv(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yn(t.onPointerLeave,Bv(b=>l.onItemLeave(b))),onFocus:yn(t.onFocus,()=>h(!0)),onBlur:yn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),NHe=p.forwardRef(Qi(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(Zve,{scope:t.__scopeMenu,checked:i,children:o.jsx(M7,{role:"menuitemcheckbox","aria-checked":SS(i)?"mixed":i,...s,ref:n,"data-state":OR(i),onSelect:yn(s.onSelect,()=>r==null?void 0:r(SS(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),jHe="MenuRadioGroup",[RHe,IHe]=Kb(jHe,{value:void 0,onValueChange:Qi(()=>{},"onValueChange")}),PHe=p.forwardRef(Qi(function(t,n){const{value:i,onValueChange:r,...s}=t,a=$u(r);return o.jsx(RHe,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(_He,{...s,ref:n})})},"MenuRadioGroup")),DHe="MenuRadioItem",MHe=p.forwardRef(Qi(function(t,n){const{value:i,...r}=t,s=IHe(DHe,t.__scopeMenu),a=i===s.value;return o.jsx(Zve,{scope:t.__scopeMenu,checked:a,children:o.jsx(M7,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":OR(a),onSelect:yn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Yve="MenuItemIndicator",[Zve,LHe]=Kb(Yve,{checked:!1}),$He=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=LHe(Yve,i);return o.jsx(Gd,{present:r||SS(a.checked)||a.checked===!0,children:o.jsx(wr.span,{...s,ref:n,"data-state":OR(a.checked)})})},"MenuItemIndicator")),FHe=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Jve="MenuSub",[BHe,exe]=Kb(Jve),UHe=Qi(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=$m(Jve,t),a=wR(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=$u(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(yR,{...a,children:o.jsx(qve,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(BHe,{scope:t,contentId:mm(),triggerId:mm(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),cT="MenuSubTrigger",QHe=p.forwardRef(Qi(function(t,n){const i=$m(cT,t.__scopeMenu),r=Kk(cT,t.__scopeMenu),s=exe(cT,t.__scopeMenu),a=P7(cT,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ir(n,s.onTriggerChange);return o.jsx(Wve,{asChild:!0,...d,children:o.jsx(Xve,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":L7(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:yn(t.onPointerMove,Bv(m=>{a.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:yn(t.onPointerLeave,Bv(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,x=y==="right",O=x?-5:5,w=g[x?"left":"right"],k=g[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+O,y:m.clientY},{x:w,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:yn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||a.searchRef.current!==""&&m.key===" "||gHe[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),zHe="MenuSubContent",VHe=p.forwardRef(Qi(function(t,n){const i=Kve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=$m(Pu,t.__scopeMenu),c=Kk(Pu,t.__scopeMenu),u=exe(zHe,t.__scopeMenu),d=p.useRef(null),f=ir(n,d);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||l.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:o.jsx(D7,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:yn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:yn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:yn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=bHe[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function L7(e){return e?"open":"closed"}Qi(L7,"getOpenState");function SS(e){return e==="indeterminate"}Qi(SS,"isIndeterminate");function OR(e){return SS(e)?"indeterminate":e?"checked":"unchecked"}Qi(OR,"getCheckedState");function txe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Qi(txe,"focusFirst");function nxe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Qi(nxe,"wrapArray");function ixe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=nxe(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Qi(ixe,"getNextMatch");function rxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Qi(rxe,"isPointInPolygon");function sxe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rxe(n,t)}Qi(sxe,"isPointerInGraceArea");function Bv(e){return t=>t.pointerType==="mouse"?e(t):void 0}Qi(Bv,"whenMouse");var HHe=wHe,qHe=Wve,WHe=SHe,GHe=EHe,KHe=M7,XHe=NHe,YHe=PHe,ZHe=MHe,JHe=$He,eqe=FHe,tqe=UHe,nqe=QHe,iqe=VHe,rqe=Object.defineProperty,mc=(e,t)=>rqe(e,"name",{value:t,configurable:!0}),$7="DropdownMenu",[sqe,JVt]=kl($7,[Vve]),gc=Vve(),[aqe,axe]=sqe($7),oqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=gc(t),u=p.useRef(null),[d,f]=su({prop:r,defaultProp:s??!1,onChange:a,caller:$7});return o.jsx(aqe,{scope:t,triggerId:mm(),triggerRef:u,contentId:mm(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(HHe,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),lqe="DropdownMenuTrigger",cqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=axe(lqe,i),l=gc(i),c=ir(n,a.triggerRef);return o.jsx(qHe,{asChild:!0,...l,children:o.jsx(wr.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:yn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:yn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),uqe=mc(e=>{const{__scopeDropdownMenu:t,...n}=e,i=gc(t);return o.jsx(WHe,{...i,...n})},"DropdownMenuPortal"),dqe="DropdownMenuContent",fqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=axe(dqe,i),a=gc(i),l=p.useRef(!1);return o.jsx(GHe,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:yn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:yn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),hqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(KHe,{...s,...r,ref:n})},"DropdownMenuItem")),pqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(XHe,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),mqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(YHe,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),gqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(ZHe,{...s,...r,ref:n})},"DropdownMenuRadioItem")),bqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(JHe,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),yqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(eqe,{...s,...r,ref:n})},"DropdownMenuSeparator")),vqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=gc(t),[l,c]=su({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(tqe,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),xqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(nqe,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),wqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(iqe,{...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")),Oqe=oqe,Sqe=cqe,oxe=uqe,kqe=fqe,lxe=hqe,Eqe=pqe,Cqe=mqe,Tqe=gqe,cxe=bqe,Aqe=yqe,_qe=vqe,Nqe=xqe,jqe=wqe,Rqe=Object.defineProperty,Fm=(e,t)=>Rqe(e,"name",{value:t,configurable:!0}),F7="Popover",[uxe,eHt]=kl(F7,[Ix]),B7=Ix(),[Iqe,Dx]=uxe(F7),Pqe=Fm(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=B7(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=su({prop:i,defaultProp:r??!1,onChange:s,caller:F7});return o.jsx(yR,{...l,children:o.jsx(Iqe,{scope:t,contentId:mm(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),Dqe="PopoverTrigger",Mqe=p.forwardRef(Fm(function(t,n){const{__scopePopover:i,...r}=t,s=Dx(Dqe,i),a=B7(i),l=ir(n,s.triggerRef),c=o.jsx(wr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":U7(s.open),...r,ref:l,onClick:yn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(A7,{asChild:!0,...a,children:c})},"PopoverTrigger")),dxe="PopoverPortal",[Lqe,$qe]=uxe(dxe,{forceMount:void 0}),Fqe=Fm(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Dx(dxe,t);return o.jsx(Lqe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),kS="PopoverContent",Bqe=p.forwardRef(Fm(function(t,n){const i=$qe(kS,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Dx(kS,t.__scopePopover);return o.jsx(Gd,{present:r||a.open,children:a.modal?o.jsx(Qqe,{...s,ref:n}):o.jsx(zqe,{...s,ref:n})})},"PopoverContent")),Uqe=Oh("PopoverContent.RemoveScroll"),Qqe=p.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=p.useRef(null),s=ir(n,r),a=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return gve(l)},[]),o.jsx(y7,{as:Uqe,allowPinchZoom:!0,children:o.jsx(fxe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:yn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:yn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),zqe=p.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(fxe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,a),a.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),fxe=p.forwardRef(Fm(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Dx(kS,i),g=B7(i);return uR(),o.jsx(tve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(_7,{"data-state":U7(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 U7(e){return e?"open":"closed"}Fm(U7,"getState");var hxe=Pqe,pxe=Mqe,mxe=Fqe,gxe=Bqe,Vqe=Object.defineProperty,vo=(e,t)=>Vqe(e,"name",{value:t,configurable:!0}),bxe="Radio",[Hqe,yxe]=kl(bxe),[qqe,SR]=Hqe(bxe);function vxe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(w=>w+1,0),x=f?!!s||!!f.closest("form"):!0,O={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:m,setBubbleInput:g,onCheck:vo(()=>l==null?void 0:l(),"onCheck")};return o.jsx(qqe,{scope:t,...O,children:xxe(d)?d(O):i})}vo(vxe,"RadioProvider");var Wqe="RadioTrigger",Gqe=p.forwardRef(vo(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=SR(Wqe,t),g=ir(r,c);return o.jsx(wr.button,{type:"button",role:"radio","aria-checked":s,"data-state":Q7(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:yn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Kqe="RadioIndicator",Xqe=p.forwardRef(vo(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=SR(Kqe,i);return o.jsx(Gd,{present:r||a.checked,children:o.jsx(wr.span,{"data-state":Q7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Yqe="RadioBubbleInput",Zqe=p.forwardRef(vo(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=SR(Yqe,t),v=ir(r,m),y=Gk(s),x=p.useRef(!1),O=p.useRef(a),w=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const E=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(E,"checked").set,_=b!==w.current;w.current=b;const j=O.current!==a;O.current=a;const A=!(_&&g.current);if(j&&N){x.current=!_;const F=new Event("click",{bubbles:A});N.call(S,a),S.dispatchEvent(F),x.current=!1}},[h,a,g,b]);const k=p.useRef(a);return o.jsx(wr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:yn(n,S=>{x.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function xxe(e){return typeof e=="function"}vo(xxe,"isFunction");function Q7(e){return e?"checked":"unchecked"}vo(Q7,"getState");var Jqe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],z7="RadioGroup",[eWe,tHt]=kl(z7,[Px,yxe]),wxe=Px(),kR=yxe(),[tWe,nWe]=eWe(z7),iWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=wxe(i),v=Wk(f),[y,x]=su({prop:l,defaultProp:a??null,onChange:m,caller:z7}),[O,w]=p.useState(null),k=ir(n,w),S=p.useRef(y);return p.useEffect(()=>{const E=s?O==null?void 0:O.ownerDocument.getElementById(s):O==null?void 0:O.closest("form");if(E instanceof HTMLFormElement){const C=vo(()=>x(S.current),"reset");return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[O,s,x]),o.jsx(tWe,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(R7,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(wr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),rWe="RadioGroupItemProvider",sWe="RadioGroupItemTrigger";function Oxe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=nWe(rWe,t),l=kR(t),c=a.disabled||i;return o.jsx(vxe,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:s,children:r})}vo(Oxe,"RadioGroupItemProvider");var aWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=wxe(i),a=kR(i),{checked:l,disabled:c}=SR(sWe,a.__scopeRadio),u=p.useRef(null),d=ir(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=vo(g=>{Jqe.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=vo(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),o.jsx(I7,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(Gqe,{...a,...r,ref:d,onKeyDown:yn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:yn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),oWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(Oxe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(aWe,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(lWe,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),lWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Zqe,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),cWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Xqe,{...s,...r,ref:n})},"RadioGroupIndicator")),uWe=Object.defineProperty,ym=(e,t)=>uWe(e,"name",{value:t,configurable:!0}),V7="Switch",[dWe,nHt]=kl(V7),[fWe,H7]=dWe(V7);function Sxe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=su({prop:n,defaultProp:r??!1,onChange:c,caller:V7}),[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useRef(!1),[O,w]=p.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(fWe,{scope:t,...S,children:kxe(f)?f(S):i})}ym(Sxe,"SwitchProvider");var hWe="SwitchTrigger",pWe=p.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=H7(hWe,t),y=ir(r,f),x=p.useRef(u);return p.useEffect(()=>{const O=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(O instanceof HTMLFormElement){const w=ym(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[s,a,h]),o.jsx(wr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":q7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:yn(n,O=>{g(),h(w=>!w),v&&b&&(m.current=O.isPropagationStopped(),m.current||O.stopPropagation())})})},"SwitchTrigger")),mWe=p.forwardRef(ym(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(Sxe,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(pWe,{...h,ref:n,__scopeSwitch:i}),m&&o.jsx(vWe,{__scopeSwitch:i})]})})},"Switch")),gWe="SwitchThumb",bWe=p.forwardRef(ym(function(t,n){const{__scopeSwitch:i,...r}=t,s=H7(gWe,i);return o.jsx(wr.span,{"data-state":q7(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),yWe="SwitchBubbleInput",vWe=p.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=H7(yWe,t),y=ir(r,v),x=Gk(s),O=p.useRef(!1),w=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});_.call(E,c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=p.useRef(c);return o.jsx(wr.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:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function kxe(e){return typeof e=="function"}ym(kxe,"isFunction");function q7(e){return e?"checked":"unchecked"}ym(q7,"getState");var xWe=Object.defineProperty,wWe=(e,t)=>xWe(e,"name",{value:t,configurable:!0}),OWe="Toggle",SWe=p.forwardRef(wWe(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=su({prop:i,onChange:s,defaultProp:r??!1,caller:OWe});return o.jsx(wr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:yn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),kWe=Object.defineProperty,vm=(e,t)=>kWe(e,"name",{value:t,configurable:!0}),Mx="ToggleGroup",[Exe,iHt]=kl(Mx,[Px]),Cxe=Px(),EWe=p.forwardRef(vm(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(CWe,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(TWe,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Mx}\``)},"ToggleGroup")),[Txe,Axe]=Exe(Mx),CWe=p.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??"",onChange:s,caller:Mx});return o.jsx(Txe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:o.jsx(_xe,{...a,ref:n})})},"ToggleGroupImplSingle")),TWe=p.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??[],onChange:s,caller:Mx}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return o.jsx(Txe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(_xe,{...a,ref:n})})},"ToggleGroupImplMultiple")),[AWe,_We]=Exe(Mx),_xe=p.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=Cxe(i),f=Wk(l),h={dir:f,...u};return o.jsx(AWe,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(R7,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(wr.div,{...h,ref:n})}):o.jsx(wr.div,{...h,ref:n})})},"ToggleGroupImpl")),Y4="ToggleGroupItem",NWe=p.forwardRef(vm(function(t,n){const i=Axe(Y4,t.__scopeToggleGroup),r=_We(Y4,t.__scopeToggleGroup),s=Cxe(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=p.useRef(null);return r.rovingFocus?o.jsx(I7,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(oG,{...c,ref:n})}):o.jsx(oG,{...c,ref:n})},"ToggleGroupItem")),oG=p.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=Axe(Y4,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(SWe,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),jWe=Object.defineProperty,La=(e,t)=>jWe(e,"name",{value:t,configurable:!0}),[W7,rHt]=kl("Tooltip",[Ix]),G7=Ix(),RWe="TooltipProvider",IWe=700,Z4="tooltip.open",[PWe,K7]=W7(RWe),DWe=La(e=>{const{__scopeTooltip:t,delayDuration:n=IWe,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(PWe,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),J4="Tooltip",[MWe,Xk]=W7(J4),LWe=La(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=K7(J4,e.__scopeTooltip),u=G7(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=mm(),b=p.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,x=p.useRef(!1),[O,w]=su({prop:i,defaultProp:r??!1,onChange:La(_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Z4))):c.onClose(),s==null||s(_)},"onChange"),caller:J4}),k=p.useMemo(()=>O?x.current?"delayed-open":"instant-open":"closed",[O]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,w(!0)},[w]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w(!1)},[w]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,w(!0),b.current=0},y)},[y,w]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const N=h??g;return o.jsx(yR,{...u,children:o.jsx(MWe,{scope:t,contentId:N,setContentId:m,open:O,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"),lG="TooltipTrigger",$We=p.forwardRef(La(function(t,n){const{__scopeTooltip:i,...r}=t,s=Xk(lG,i),a=K7(lG,i),l=G7(i),c=p.useRef(null),u=ir(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(A7,{asChild:!0,...l,children:o.jsx(wr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:yn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:yn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:yn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:yn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:yn(t.onBlur,s.onClose),onClick:yn(t.onClick,s.onClose)})})},"TooltipTrigger")),Nxe="TooltipPortal",[FWe,BWe]=W7(Nxe,{forceMount:void 0}),UWe=La(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=Xk(Nxe,t);return o.jsx(FWe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),ES="TooltipContent",QWe=p.forwardRef(La(function(t,n){const i=BWe(ES,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=Xk(ES,t.__scopeTooltip);return o.jsx(Gd,{present:r||l.open,children:l.disableHoverableContent?o.jsx(jxe,{side:s,...a,ref:n}):o.jsx(zWe,{side:s,...a,ref:n})})},"TooltipContent")),zWe=p.forwardRef(La(function(t,n){const i=Xk(ES,t.__scopeTooltip),r=K7(ES,t.__scopeTooltip),s=p.useRef(null),a=ir(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,x={x:b.clientX,y:b.clientY},O=Rxe(x,y.getBoundingClientRect()),w=Ixe(x,O),k=Pxe(v.getBoundingClientRect()),S=Mxe([...w,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=La(y=>g(y,f),"handleTriggerLeave"),v=La(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=La(v=>{const y=v.target,x={x:v.clientX,y:v.clientY},O=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),w=!Dxe(x,l);O?m():w&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),o.jsx(jxe,{...t,ref:a})},"TooltipContentHoverable")),VWe=Rye("TooltipContent"),jxe=p.forwardRef(La(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=Xk(ES,i),f=G7(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Z4,h),()=>document.removeEventListener(Z4,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=La(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Jc(()=>(m(a),()=>{m(void 0)}),[a,m]),o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(_7,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(VWe,{children:r}),s?o.jsx(fQe,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function Rxe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}La(Rxe,"getExitSideFromRect");function Ixe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}La(Ixe,"getPaddedExitPoints");function Pxe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}La(Pxe,"getPointsFromRect");function Dxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}La(Dxe,"isPointInPolygon");function Mxe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Lxe(t)}La(Mxe,"getHull");function Lxe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}La(Lxe,"getHullPresorted");var HWe=DWe,qWe=LWe,$xe=$We,WWe=UWe,GWe=QWe;function xm(e){const t=p.useRef(e);return t.current=e,t}let Uv=[],uT=!1;const cG=e=>{var t,n;if(e.key==="Escape"){const[i]=Uv;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},Fxe=()=>{Uv.length>0&&!uT?(document.body.addEventListener("keydown",cG),uT=!0):Uv.length===0&&uT&&(document.body.removeEventListener("keydown",cG),uT=!1)},KWe=e=>{Uv.unshift(e),Fxe()},XWe=({id:e})=>{Uv=Uv.filter(t=>t.id!==e),Fxe()},Yk=(e,t)=>{const n=p.useId(),i=xm(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return KWe(r),()=>XWe(r)},[n,e,i])},YWe=p.createContext(null);function Bxe(){const e=p.useContext(YWe);return(e==null?void 0:e.linkComponent)??"a"}function Zk(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const ZWe=()=>Cye,uG=(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},P0=()=>{},D0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function JWe(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(a):a.concat(l)}function eGe(e,t,n){if((Cye||WUe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const tGe="_TransitionGroupChild_1hv1z_1",nGe={TransitionGroupChild:tGe},Uxe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},iGe=e=>({...Uxe,enter:!e}),rGe=(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 Uxe}},sGe=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,x]=p.useReducer(rGe,iGe(a||!1)),O=p.useRef(!1),w=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(N=>{const _=w.current;if(!(!_||N===E.current))switch(E.current=N,N){case"enter":f(_);break;case"enter-active":h(_);break;case"enter-complete":m(_);break;case"exit":g(_);break;case"exit-active":b(_);break;case"exit-complete":v(_);break}},[f,h,m,g,b,v]);return ii.useLayoutEffect(()=>{if(!l){let j;x({type:"exit-before"}),C("exit");const A=F_(()=>{x({type:"exit-active"}),C("exit-active"),j=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{A(),j!==void 0&&clearTimeout(j)}}if(a&&!O.current){O.current=!0;return}let N;x({type:"enter-before"}),C("enter");const _=F_(()=>{x({type:"enter-active"}),C("enter-active"),N=window.setTimeout(()=>{x({type:"done"}),C("enter-complete")},k.current)});return()=>{_(),N!==void 0&&clearTimeout(N)}},[l,a,d,C]),p.useEffect(()=>()=>{O.current=!1},[]),o.jsx(t,{ref:Zk([w,e]),className:pi(i,nGe.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})},aGe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return o7(()=>s(!0),r?null:i),r?o.jsx(sGe,{...e}):null},Lx=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=ZWe()}=e,m=D0(e.onEnter??P0),g=D0(e.onEnterActive??P0),b=D0(e.onEnterComplete??P0),v=D0(e.onExit??P0),y=D0(e.onExitActive??P0),x=D0(e.onExitComplete??P0);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const O=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:x}),[m,g,b,v,y,x]),[w,k]=p.useState(()=>uG(i).map(S=>({...O(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const E=uG(i);return JWe(E,S,O,f)})},[i,f,O]),eGe("TransitionGroup",t,p.Children.count(i)),h?o.jsx(o.Fragment,{children:p.Children.map(i,S=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:S}))}):o.jsx(o.Fragment,{children:w.map(({component:S,...E})=>o.jsx(aGe,{...E,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:S},S.key))})},oGe="_Button_1864l_1",lGe="_ButtonInner_1864l_4",cGe="_ButtonLoader_1864l_749",ZD={Button:oGe,ButtonInner:lGe,ButtonLoader:cGe},Ht=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:x=u,...O}=e,w=v||x,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return o.jsxs("button",{type:t,className:pi(ZD.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:l7,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...O,children:[o.jsx(Lx,{className:ZD.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(Hk,{},"loader")}),o.jsx("span",{className:ZD.ButtonInner,children:a7(m)})]})},uGe=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function dGe(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function fGe(e,t=document.body){if(typeof e=="string")return dG(e,t);try{return uGe()?(await navigator.clipboard.write([dGe(e)]),!0):e["text/plain"]?dG(e["text/plain"],t):!1}catch{return!1}}async function dG(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 hGe="_TransitionItem_1o7b1_1",pGe={TransitionItem:hGe},mGe=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:a,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=xGe(e);return o.jsx(t,{className:pi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Lx,{as:t,className:pi(pGe.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},gGe=400,bGe=500,yGe=200,vGe=300;function xGe({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=$D(e),s=$D(t),a=$D(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?bGe:gGe),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?vGe:yGe),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Wb({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":LD((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":FD(t),"tg-enter-duration":tT(c),"tg-enter-delay":tT((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":LD((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":FD(n),"tg-exit-duration":tT(d),"tg-exit-delay":tT((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":LD((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":FD(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 X7=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),fGe(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(Ht,{...i,onClick:l,children:[o.jsx(mGe,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?o.jsx(Lv,{},"copied-icon"):o.jsx(PF,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},wGe="_Menu_1t4b0_1",OGe="_MenuList_1t4b0_3",SGe="_MenuItemContent_1t4b0_53",kGe="_MenuItem_1t4b0_53",EGe="_ItemActions_1t4b0_98",CGe="_PressableInner_1t4b0_117",TGe="_Separator_1t4b0_135",AGe="_SubMenuItem_1t4b0_139",_Ge="_SubTriggerIcon_1t4b0_141",NGe="_RadioItem_1t4b0_151",jGe="_RadioIndicatorActive_1t4b0_158",RGe="_RadioIndicator_1t4b0_158",IGe="_CheckboxItem_1t4b0_249",PGe="_CheckboxIndicator_1t4b0_256",DGe="_CheckboxCircle_1t4b0_269",Wr={Menu:wGe,MenuList:OGe,MenuItemContent:SGe,MenuItem:kGe,ItemActions:EGe,PressableInner:CGe,Separator:TGe,SubMenuItem:AGe,SubTriggerIcon:_Ge,RadioItem:NGe,RadioIndicatorActive:jGe,RadioIndicator:RGe,CheckboxItem:IGe,CheckboxIndicator:PGe,CheckboxCircle:DGe},Qxe=p.createContext(null),Jk=()=>{const e=p.useContext(Qxe);if(!e)throw new Error("Menu components must be wrapped in ");return e},vr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=p.useState(!1),l=t??s,c=xm(n),u=xm(i),d=p.useCallback(h=>{var m,g;a(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx(Qxe.Provider,{value:f,children:o.jsx(Oqe,{open:l,onOpenChange:d,modal:r,children:e})})},MGe=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=Jk(),a=l=>{s||l.preventDefault()};return i?o.jsx(lxe,{className:pi(Wr.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:Wr.PressableInner,children:t})}):o.jsx("div",{className:pi(Wr.MenuItemContent,e),children:t})},LGe=({className:e,children:t})=>o.jsx("div",{className:pi(Wr.ItemActions,e),children:t}),$Ge=({children:e,onClick:t})=>{const{setOpen:n}=Jk();return o.jsx(Ht,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},FGe=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=Jk(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=Bxe(),h=a||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(lxe,{asChild:!0,className:pi(Wr.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:Wr.PressableInner,children:n})})})},BGe=({className:e})=>o.jsx(Aqe,{className:pi(Wr.Separator,e),role:"separator"}),UGe=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=Jk();return o.jsx(oxe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(kqe,{forceMount:!0,className:Wr.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},QGe=({children:e,disabled:t})=>o.jsx(Sqe,{asChild:!0,disabled:t,children:e}),zxe=p.createContext(null),Vxe=()=>{const e=p.useContext(zxe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},zGe=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=t??r,c=xm(n),u=xm(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]);Yk(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(zxe.Provider,{value:f,children:o.jsx(_qe,{open:l,onOpenChange:d,children:e})})},VGe=({className:e,children:t,disabled:n})=>{const{open:i}=Jk(),{triggerRef:r}=Vxe(),s=a=>{i||a.preventDefault()};return o.jsx(Nqe,{ref:r,className:pi(Wr.MenuItem,Wr.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:Wr.PressableInner,children:[t,o.jsx(DFe,{width:"16",height:"16",className:Wr.SubTriggerIcon})]})})},HGe=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=Vxe();return o.jsx(oxe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(jqe,{className:Wr.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},qGe=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(Cqe,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),WGe=({className:e,children:t,...n})=>o.jsx(Tqe,{className:pi(Wr.MenuItem,Wr.RadioItem,e),...n,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.RadioIndicator,children:o.jsx(cxe,{className:Wr.RadioIndicatorActive})}),t]})}),GGe=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(Eqe,{className:pi(Wr.MenuItem,Wr.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.CheckboxIndicator,children:o.jsx(cxe,{children:i==="ghost"?o.jsx(Lv,{className:"size-4"}):o.jsx("div",{className:Wr.CheckboxCircle,children:o.jsx(Lv,{className:"size-4"})})})}),t]})});vr.Content=UGe;vr.Item=MGe;vr.ItemActions=LGe;vr.ItemAction=$Ge;vr.Link=FGe;vr.Separator=BGe;vr.Trigger=QGe;vr.Sub=zGe;vr.SubTrigger=VGe;vr.SubContent=HGe;vr.CheckboxItem=GGe;vr.RadioGroup=qGe;vr.RadioItem=WGe;const KGe="_Tooltip_16g2y_1",XGe="_TriggerDecorator_16g2y_73",Hxe={Tooltip:KGe,TriggerDecorator:XGe},go=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:a=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...x}=e,[O,w]=p.useState(!1),[k,S]=p.useState(!1);o7(()=>S(!1),k?400:null);const E=r??O,C=_=>{typeof r!="boolean"&&(w(_),u&&S(_))},N=_=>{u&&k&&(_.preventDefault(),_.stopPropagation())};return o.jsxs(qxe,{open:E,delayDuration:a,onOpenChange:C,disableHoverableContent:!l,children:[o.jsx($xe,{asChild:!0,children:o.jsx(Nye,{...x,ref:t,onPointerDown:_=>{N(_),v==null||v(_)},onClick:_=>{N(_),y==null||y(_)},children:n})}),o.jsx(Wxe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},qxe=({children:e,open:t,onOpenChange:n,...i})=>(Yk(t,()=>{n(!1)}),o.jsx(HWe,{children:o.jsx(qWe,{open:t,onOpenChange:n,...i,children:e})})),Wxe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:a="md",className:l,style:c,...u})=>o.jsx(WWe,{children:o.jsx(GWe,{...u,className:pi(Hxe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":a,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:ih,children:e})}),YGe=({children:e,asChild:t=!0,...n})=>o.jsx($xe,{asChild:t,...n,children:e}),ZGe=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(Nye,{ref:r,...s,className:pi(Hxe.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};go.Root=qxe;go.Content=Wxe;go.Trigger=YGe;go.TriggerDecorator=ZGe;const JGe=50,fG=48;function eKe(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function tKe(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return V("search.untitledSession")}function nKe(e,t,n){const i=Math.max(0,t-fG),r=Math.min(e.length,t+n+fG);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await iR(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of eKe(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:tKe(l),snippet:nKe(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,JGe)}async function rKe(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await s0e(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?V("search.webUnavailable"):V("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:V("search.webNotMounted")}}async function sKe(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await r0e(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:V(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??V(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:a.content,sourceName:s,sourceType:r.sourceType,author:a.author,ts:a.timestamp})}}async function aKe(e,t,n){return e==="session"?{results:await iKe(n.userId,n.appId,t)}:e==="web"?rKe(n.appId,t):sKe(e,n.appId,n.userId,t)}function Gxe({mirrored:e=!1}){return o.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[o.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),o.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function oKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Gxe,{})})}function lKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Gxe,{mirrored:!0})})}function cKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function uKe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),o.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function dKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function Kxe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),o.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),o.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function fKe({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function hKe({open:e}){return o.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function pKe({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[o.jsx(uKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function mKe(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),a=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:a(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:a(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:a(i("search.sources.memory"))}]}function V_(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function hG(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 gKe({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var M,U;const{t:a,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,x]=p.useState(!1),[O,w]=p.useState(!1),[k,S]=p.useState(!1),E=p.useRef(0),C=p.useRef(null),N=mKe(t,n,i,a),_=N.find(I=>I.id===u),j=u==="knowledge"?(M=n==null?void 0:n.components)==null?void 0:M.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):u==="memory"?(U=n==null?void 0:n.components)==null?void 0:U.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;p.useEffect(()=>{E.current+=1,d("session"),g([]),v(void 0),w(!1),x(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function I(H){var K;(K=C.current)!=null&&K.contains(H.target)||S(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[k]);async function A(I,H){var B;const K=I.trim();if(!K||!((B=N.find(ee=>ee.id===H))!=null&&B.ready))return;const Q=++E.current;x(!0),w(!0);let q;try{q=await aKe(H,K,{userId:e,appId:t})}catch(ee){const le=ee instanceof Error?ee.message:String(ee);q={results:[],note:a("search.failed",{message:le})}}Q===E.current&&(g(q.results),v(q.note),x(!1))}function F(I){E.current+=1,h(I),g([]),v(void 0),w(!1),x(!1)}function T(I){E.current+=1,d(I),S(!1),g([]),v(void 0),w(!1),x(!1)}const P=!!(_!=null&&_.ready),R=t?u==="web"?a("search.placeholder.web"):u==="knowledge"?a("search.placeholder.knowledge",{name:(j==null?void 0:j.name)??a("search.placeholder.knowledgeFallback")}):u==="memory"?a("search.placeholder.memory",{name:(j==null?void 0:j.name)??a("search.placeholder.memoryFallback")}):a("search.placeholder.session"):a("search.placeholder.selectAgent"),L=j!=null&&j.backend?V_(j.backend,a):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:C,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(_==null?void 0:_.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(I=>!I),children:[o.jsx("span",{children:(_==null?void 0:_.label)??a("search.sourceType")}),L&&o.jsx("small",{children:L}),o.jsx(hKe,{open:k})]}),k&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:N.map(I=>{var Q,q;const H=I.id==="knowledge"?(Q=n==null?void 0:n.components)==null?void 0:Q.find(B=>B.source==="knowledgebase"||B.kind==="knowledgebase"):I.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(B=>B.source==="long_term_memory"||B.kind==="memory"):void 0,K=H?[H.name,H.backend?V_(H.backend,a):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":u===I.id,disabled:!I.ready,onClick:()=>T(I.id),children:[o.jsx("span",{children:I.label}),K&&o.jsx("small",{children:K})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:f,onChange:I=>F(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(f,u))},placeholder:R,disabled:!P,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(fi,{className:"icon spin"}):o.jsx(fKe,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:P?O?y?null:b?o.jsx("div",{className:"search-empty",children:b}):m.length===0&&O?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):m.map((I,H)=>o.jsx(bKe,{result:I,agentLabel:r,onOpen:s,locale:c},H)):o.jsx("div",{className:"search-empty",children:a(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):o.jsx("div",{className:"search-empty",children:t?i?a("search.loadingCapabilities"):(_==null?void 0:_.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function bKe({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(Abe,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${hG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(Zj,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(gb,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(pG,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(pG,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:"",e.ts?` · ${hG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function pG({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function yKe({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function vKe({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function Xxe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const ER="/assets/media/logo-DCsNZy-k.svg",Y7="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",mG="(max-width: 860px)";function gG({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),a={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return o.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:a,children:o.jsx("span",{ref:n,className:"history-title-text",children:e})})}function xKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function wKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),o.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function OKe(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 SKe={admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function kKe({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=K7e(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=OKe(h),b=X7e(n),v=b===d?"":b,y=wj(u.resolvedLanguage??u.language)??xj;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(vr,{modal:!0,children:[o.jsx(vr.Trigger,{children:o.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[o.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsx("span",{className:"sidebar-user-identity",children:o.jsx("span",{className:"sidebar-user-name",children:h})})]})}),o.jsxs(vr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[o.jsxs("div",{className:"account-menu-head",children:[o.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:h}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${SKe[t.role]}`)})]}),m&&m!==h&&o.jsx("div",{className:"account-sub",children:m})]})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Wd,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(vr.Sub,{children:[o.jsx(vr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(wKe,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(vr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(vr.RadioGroup,{value:y,onChange:x=>{aLe(x)},indicatorPosition:"end",children:K8.map(x=>o.jsx(vr.RadioItem,{value:x,children:c(`common:languageNames.${x}`)},x))})})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Xxe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(C7e,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),o.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[o.jsx(go,{compact:!0,content:c("sidebar:account.tryCli"),children:o.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:o.jsx(VFe,{className:"icon"})})}),o.jsx(go,{compact:!0,content:c("sidebar:account.developerResources"),children:o.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:o.jsx(RFe,{className:"icon"})})})]})]})})}function EKe({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:a,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onAddAgent:g,onMyAgents:b,onWorkspace:v,onApplications:y,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onPickSession:E,onDeleteSession:C,userInfo:N,onLogout:_}){const{t:j}=Te("sidebar"),A=H=>(s==null?void 0:s[H])!==!1,[F,T]=p.useState(null),P=p.useRef(typeof window<"u"&&window.matchMedia(mG).matches),[R,L]=p.useState(P.current),M=n.map(H=>({id:H.id,title:cR(H.events,j("history.newConversation")),createdAt:(H.lastUpdateTime??0)*1e3})).sort((H,K)=>K.createdAt-H.createdAt),U=()=>{P.current=!1,L(H=>!H),T(null)};p.useEffect(()=>{const H=window.matchMedia(mG),K=Q=>{Q.matches?L(q=>q||(P.current=!0,!0)):P.current&&(P.current=!1,L(!1))};return H.addEventListener("change",K),()=>H.removeEventListener("change",K)},[]);const I=t==="byteplus"?Y7:ER;return o.jsxs("aside",{className:`sidebar ${R?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":j("navigation.home"),title:j("navigation.home"),children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||I,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":j(R?"navigation.expand":"navigation.collapse"),title:j(R?"navigation.expand":"navigation.collapse"),children:R?o.jsx(lKe,{className:"icon"}):o.jsx(oKe,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":j("navigation.label"),children:[A("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":j("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:j("navigation.newChat"),children:[o.jsx(cKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.newChat")})]}),A("search")&&o.jsx(pKe,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:b,"aria-label":j("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:j("navigation.agents"),children:[o.jsx(dKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.agents")})]}),o.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:v,"aria-label":j("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:j("navigation.workspaces"),children:[o.jsx(a7e,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.workspaces")})]}),o.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":j("navigation.library"),"aria-current":r==="library"?"page":void 0,title:j("navigation.library"),children:[o.jsx(Kxe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.library")})]}),o.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":j("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:j("navigation.cronjobs"),children:[o.jsx(IF,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.cronjobs")})]}),o.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:y,"aria-label":j("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:j("navigation.automations"),children:[o.jsx(xKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.automations")})]})]})]}),A("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:j("history.title")}),A("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":j("history.create"),title:j("history.create"),children:o.jsx(Fo,{className:"icon"})})]}),o.jsx("div",{className:"history-list",children:u?o.jsxs(o.Fragment,{children:[u.loading&&u.threads.length===0?o.jsx("div",{className:"history-empty",role:"status",children:j("history.loading")}):null,u.error?o.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,u.threads.map(H=>{const K=H.id===u.currentThreadId,Q=H.name||H.preview||`Thread ${H.id.slice(0,8)}`,q=H.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(H.id),"aria-current":K?"page":void 0,title:Q,disabled:q,children:[o.jsx(gG,{title:Q}),K?o.jsx("span",{className:"history-current-badge",children:j("history.current")}):null]}),o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:Q}),title:j("history.more"),disabled:q,onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(xW,{className:"icon"})}),F===H.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),u.onDelete(H)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]}):null]},H.id)}),u.hasMore?o.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?j("history.loadingMore"):j("history.loadMore")}):null]}):o.jsxs(o.Fragment,{children:[M.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,M.map(H=>{const K=H.id===i,Q=(l==null?void 0:l.has(H.id))===!0,q=!Q&&(c==null?void 0:c.has(H.id))===!0;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>E(H.id),"aria-current":K?"page":void 0,title:H.title,children:[o.jsx(gG,{title:H.title}),q&&o.jsxs("span",{className:"history-evaluating-status",title:j("history.evaluatingTitle"),children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),j("history.evaluating")]})]}),o.jsxs("div",{className:"history-action-slot",children:[Q?o.jsx(Hk,{className:"history-streaming-indicator",size:12,role:"status","aria-label":j("history.generating")}):null,o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:H.title}),title:j("history.more"),onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(xW,{className:"icon"})})]}),F===H.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),C(H.id)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]})]},H.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(kKe,{activePage:r,access:a,userInfo:N,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onLogout:_})})]})}function ta(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function CR(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cA.prototype=CR.prototype={constructor:cA,on:function(e,t){var n=this._,i=TKe(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yG.hasOwnProperty(t)?{space:yG[t],local:e}:e}function _Ke(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===e6&&t.documentElement.namespaceURI===e6?t.createElement(e):t.createElementNS(n,e)}}function NKe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Yxe(e){var t=TR(e);return(t.local?NKe:_Ke)(t)}function jKe(){}function Z7(e){return e==null?jKe:function(){return this.querySelector(e)}}function RKe(e){typeof e!="function"&&(e=Z7(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=O&&(O=x+1);!(k=v[O])&&++O=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function iXe(e){e||(e=rXe);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 sXe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function aXe(){return Array.from(this)}function oXe(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?yXe:typeof t=="function"?xXe:vXe)(e,t,n??"")):Qv(this.node(),e)}function Qv(e,t){return e.style.getPropertyValue(t)||n1e(e).getComputedStyle(e,null).getPropertyValue(t)}function OXe(e){return function(){delete this[e]}}function SXe(e,t){return function(){this[e]=t}}function kXe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function EXe(e,t){return arguments.length>1?this.each((t==null?OXe:typeof t=="function"?kXe:SXe)(e,t)):this.node()[e]}function i1e(e){return e.trim().split(/^|\s+/)}function J7(e){return e.classList||new r1e(e)}function r1e(e){this._node=e,this._names=i1e(e.getAttribute("class")||"")}r1e.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 s1e(e,t){for(var n=J7(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function JXe(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function t6(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}t6.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cYe(e){return!e.ctrlKey&&!e.button}function uYe(){return this.parentNode}function dYe(e,t){return t??{x:e.x,y:e.y}}function fYe(){return navigator.maxTouchPoints||"ontouchstart"in this}function d1e(){var e=cYe,t=uYe,n=dYe,i=fYe,r={},s=CR("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,lYe).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(w,k){if(!(d||!e.call(this,w,k))){var S=O(this,t.call(this,w,k),w,k,"mouse");S&&(Yl(w.view).on("mousemove.drag",g,CS).on("mouseup.drag",b,CS),c1e(w.view),JD(w),u=!1,l=w.clientX,c=w.clientY,S("start",w))}}function g(w){if(ev(w),!u){var k=w.clientX-l,S=w.clientY-c;u=k*k+S*S>f}r.mouse("drag",w)}function b(w){Yl(w.view).on("mousemove.drag mouseup.drag",null),u1e(w.view,u),ev(w),r.mouse("end",w)}function v(w,k){if(e.call(this,w,k)){var S=w.changedTouches,E=t.call(this,w,k),C=S.length,N,_;for(N=0;N>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fT(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fT(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pYe.exec(e))?new dl(t[1],t[2],t[3],1):(t=mYe.exec(e))?new dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gYe.exec(e))?fT(t[1],t[2],t[3],t[4]):(t=bYe.exec(e))?fT(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yYe.exec(e))?EG(t[1],t[2]/100,t[3]/100,1):(t=vYe.exec(e))?EG(t[1],t[2]/100,t[3]/100,t[4]):vG.hasOwnProperty(e)?OG(vG[e]):e==="transparent"?new dl(NaN,NaN,NaN,0):null}function OG(e){return new dl(e>>16&255,e>>8&255,e&255,1)}function fT(e,t,n,i){return i<=0&&(e=t=n=NaN),new dl(e,t,n,i)}function OYe(e){return e instanceof tE||(e=xb(e)),e?(e=e.rgb(),new dl(e.r,e.g,e.b,e.opacity)):new dl}function n6(e,t,n,i){return arguments.length===1?OYe(e):new dl(e,t,n,i??1)}function dl(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}eB(dl,n6,f1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dl(ib(this.r),ib(this.g),ib(this.b),W_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:SG,formatHex:SG,formatHex8:SYe,formatRgb:kG,toString:kG}));function SG(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}`}function SYe(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}${Mg((isNaN(this.opacity)?1:this.opacity)*255)}`}function kG(){const e=W_(this.opacity);return`${e===1?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${e===1?")":`, ${e})`}`}function W_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mg(e){return e=ib(e),(e<16?"0":"")+e.toString(16)}function EG(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cu(e,t,n,i)}function h1e(e){if(e instanceof Cu)return new Cu(e.h,e.s,e.l,e.opacity);if(e instanceof tE||(e=xb(e)),!e)return new Cu;if(e instanceof Cu)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,l=s-r,c=(s+r)/2;return l?(t===s?a=(n-i)/l+(n0&&c<1?0:a,new Cu(a,l,c,e.opacity)}function kYe(e,t,n,i){return arguments.length===1?h1e(e):new Cu(e,t,n,i??1)}function Cu(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}eB(Cu,kYe,f1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new Cu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new Cu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dl(eM(e>=240?e-240:e+120,r,i),eM(e,r,i),eM(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Cu(CG(this.h),hT(this.s),hT(this.l),W_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=W_(this.opacity);return`${e===1?"hsl(":"hsla("}${CG(this.h)}, ${hT(this.s)*100}%, ${hT(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CG(e){return e=(e||0)%360,e<0?e+360:e}function hT(e){return Math.max(0,Math.min(1,e||0))}function eM(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const AR=e=>()=>e;function p1e(e,t){return function(n){return e+n*t}}function EYe(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 sHt(e,t){var n=t-e;return n?p1e(e,n>180||n<-180?n-360*Math.round(n/360):n):AR(isNaN(e)?t:e)}function CYe(e){return(e=+e)==1?m1e:function(t,n){return n-t?EYe(t,n,e):AR(isNaN(t)?n:t)}}function m1e(e,t){var n=t-e;return n?p1e(e,n):AR(isNaN(e)?t:e)}const G_=function e(t){var n=CYe(t);function i(r,s){var a=n((r=n6(r)).r,(s=n6(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=m1e(r.opacity,s.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function TYe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:pd(i,r)})),n=tM.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:pd(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:pd(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:pd(u,f)},{i:b-2,x:pd(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--zv}function _G(){wb=(X_=_S.now())+_R,zv=Rw=0;try{QYe()}finally{zv=0,VYe(),wb=0}}function zYe(){var e=_S.now(),t=e-X_;t>v1e&&(_R-=t,X_=e)}function VYe(){for(var e,t=K_,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K_=n);Iw=e,s6(i)}function s6(e){if(!zv){Rw&&(Rw=clearTimeout(Rw));var t=e-wb;t>24?(e<1/0&&(Rw=setTimeout(_G,e-_S.now()-_R)),$1&&($1=clearInterval($1))):($1||(X_=_S.now(),$1=setInterval(zYe,v1e)),zv=1,x1e(_G))}}function NG(e,t,n){var i=new Y_;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var HYe=CR("start","end","cancel","interrupt"),qYe=[],O1e=0,jG=1,a6=2,dA=3,RG=4,o6=5,fA=6;function NR(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;WYe(e,n,{name:t,index:i,group:r,on:HYe,tween:qYe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:O1e})}function nB(e,t){var n=Wu(e,t);if(n.state>O1e)throw new Error("too late; already scheduled");return n}function Xd(e,t){var n=Wu(e,t);if(n.state>dA)throw new Error("too late; already running");return n}function Wu(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function WYe(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=w1e(s,0,n.time);function s(u){n.state=jG,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==jG)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===dA)return NG(a);m.state===RG?(m.state=fA,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+da6&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function SZe(e,t,n){var i,r,s=OZe(t)?nB:Xd;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function kZe(e,t){var n=this._id;return arguments.length<2?Wu(this.node(),n).on.on(e):this.each(SZe(n,e,t))}function EZe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function CZe(){return this.on("end.remove",EZe(this._id))}function TZe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Z7(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function ZZe(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Kf(e,t,n){this.k=e,this.x=t,this.y=n}Kf.prototype={constructor:Kf,scale:function(e){return e===1?this:new Kf(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kf(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jR=new Kf(1,0,0);C1e.prototype=Kf.prototype;function C1e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jR;return e.__zoom}function nM(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function JZe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function eJe(){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 IG(){return this.__zoom||jR}function tJe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nJe(){return navigator.maxTouchPoints||"ontouchstart"in this}function iJe(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function T1e(){var e=JZe,t=eJe,n=iJe,i=tJe,r=nJe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=uA,u=CR("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(T){T.property("__zoom",IG).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",_).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,P,R,L){var M=T.selection?T.selection():T;M.property("__zoom",IG),T!==M?k(T,P,R,L):M.interrupt().each(function(){S(this,arguments).event(L).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(T,P,R,L){y.scaleTo(T,function(){var M=this.__zoom.k,U=typeof P=="function"?P.apply(this,arguments):P;return M*U},R,L)},y.scaleTo=function(T,P,R,L){y.transform(T,function(){var M=t.apply(this,arguments),U=this.__zoom,I=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R,H=U.invert(I),K=typeof P=="function"?P.apply(this,arguments):P;return n(O(x(U,K),I,H),M,a)},R,L)},y.translateBy=function(T,P,R,L){y.transform(T,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,L)},y.translateTo=function(T,P,R,L,M){y.transform(T,function(){var U=t.apply(this,arguments),I=this.__zoom,H=L==null?w(U):typeof L=="function"?L.apply(this,arguments):L;return n(jR.translate(H[0],H[1]).scale(I.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof R=="function"?-R.apply(this,arguments):-R),U,a)},L,M)};function x(T,P){return P=Math.max(s[0],Math.min(s[1],P)),P===T.k?T:new Kf(P,T.x,T.y)}function O(T,P,R){var L=P[0]-R[0]*T.k,M=P[1]-R[1]*T.k;return L===T.x&&M===T.y?T:new Kf(T.k,L,M)}function w(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function k(T,P,R,L){T.on("start.zoom",function(){S(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,U=arguments,I=S(M,U).event(L),H=t.apply(M,U),K=R==null?w(H):typeof R=="function"?R.apply(M,U):R,Q=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=M.__zoom,B=typeof P=="function"?P.apply(M,U):P,ee=c(q.invert(K).concat(Q/q.k),B.invert(K).concat(Q/B.k));return function(le){if(le===1)le=B;else{var se=ee(le),re=Q/se[2];le=new Kf(re,K[0]-se[0]*re,K[1]-se[1]*re)}I.zoom(null,le)}})}function S(T,P,R){return!R&&T.__zooming||new E(T,P)}function E(T,P){this.that=T,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,P),this.taps=0}E.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,P){return this.mouse&&T!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var P=Yl(this.that).datum();u.call(T,this.that,new ZZe(T,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),P)}};function C(T,...P){if(!e.apply(this,arguments))return;var R=S(this,P).event(T),L=this.__zoom,M=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,i.apply(this,arguments)))),U=Ou(T);if(R.wheel)(R.mouse[0][0]!==U[0]||R.mouse[0][1]!==U[1])&&(R.mouse[1]=L.invert(R.mouse[0]=U)),clearTimeout(R.wheel);else{if(L.k===M)return;R.mouse=[U,L.invert(U)],hA(this),R.start()}F1(T),R.wheel=setTimeout(I,g),R.zoom("mouse",n(O(x(L,M),R.mouse[0],R.mouse[1]),R.extent,a));function I(){R.wheel=null,R.end()}}function N(T,...P){if(h||!e.apply(this,arguments))return;var R=T.currentTarget,L=S(this,P,!0).event(T),M=Yl(T.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",Q,!0),U=Ou(T,R),I=T.clientX,H=T.clientY;c1e(T.view),nM(T),L.mouse=[U,this.__zoom.invert(U)],hA(this),L.start();function K(q){if(F1(q),!L.moved){var B=q.clientX-I,ee=q.clientY-H;L.moved=B*B+ee*ee>b}L.event(q).zoom("mouse",n(O(L.that.__zoom,L.mouse[0]=Ou(q,R),L.mouse[1]),L.extent,a))}function Q(q){M.on("mousemove.zoom mouseup.zoom",null),u1e(q.view,L.moved),F1(q),L.event(q).end()}}function _(T,...P){if(e.apply(this,arguments)){var R=this.__zoom,L=Ou(T.changedTouches?T.changedTouches[0]:T,this),M=R.invert(L),U=R.k*(T.shiftKey?.5:2),I=n(O(x(R,U),L,M),t.apply(this,P),a);F1(T),l>0?Yl(this).transition().duration(l).call(k,I,L,T):Yl(this).call(y.transform,I,L,T)}}function j(T,...P){if(e.apply(this,arguments)){var R=T.touches,L=R.length,M=S(this,P,T.changedTouches.length===L).event(T),U,I,H,K;for(nM(T),I=0;I`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},NS=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],A1e=["Enter"," ","Escape"],_1e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Vv;(function(e){e.Strict="strict",e.Loose="loose"})(Vv||(Vv={}));var rb;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rb||(rb={}));var jS;(function(e){e.Partial="partial",e.Full="full"})(jS||(jS={}));const N1e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Np;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Np||(Np={}));var RS;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(RS||(RS={}));var sn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(sn||(sn={}));const PG={[sn.Left]:sn.Right,[sn.Right]:sn.Left,[sn.Top]:sn.Bottom,[sn.Bottom]:sn.Top};function j1e(e){return e===null?null:e?"valid":"invalid"}const R1e=e=>"id"in e&&"source"in e&&"target"in e,rJe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rB=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nE=(e,t=[0,0])=>{const{width:n,height:i}=Fh(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},sJe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let a=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(r):rB(r)?r:t.nodeLookup.get(r.id));const l=a?Z_(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return RR(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return IR(n)},iE=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=RR(n,Z_(r)),i=!0)}),i?IR(n):{x:0,y:0,width:0,height:0}},sB=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...$x(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=IS(l,qv(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},aJe=(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 oJe(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 lJe({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=oJe(e,a),c=iE(l),u=oB(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await i.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function I1e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??i;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)s==null||s("005",Fu.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Sb(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=Sb(f)?Ob(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Fu.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function cJe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&a.find(b=>b.id===h.parentId);(m||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=aJe(a,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Hv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ob=(e={x:0,y:0},t,n)=>({x:Hv(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hv(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function P1e(e,t,n){const{width:i,height:r}=Fh(n),{x:s,y:a}=n.internals.positionAbsolute;return Ob(e,[[s,a],[s+i,a+r]],t)}const DG=(e,t,n)=>en?-Hv(Math.abs(e-n),1,t)/t:0,aB=(e,t,n=15,i=40)=>{const r=DG(e.x,i,t.width-i)*n,s=DG(e.y,i,t.height-i)*n;return[r,s]},RR=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),l6=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),IR=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),qv=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=rB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Z_=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=rB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},D1e=(e,t)=>IR(RR(l6(e),l6(t))),IS=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},MG=e=>Au(e.width)&&Au(e.height)&&Au(e.x)&&Au(e.y),Au=e=>!isNaN(e)&&isFinite(e),M1e=(e,t)=>(n,i)=>{},rE=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$x=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?rE(l,a):l},Wv=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function M0(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function uJe(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=M0(e,n),r=M0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=M0(e.top??e.y??0,n),r=M0(e.bottom??e.y??0,n),s=M0(e.left??e.x??0,t),a=M0(e.right??e.x??0,t);return{top:i,right:a,bottom:r,left:s,x:s+a,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dJe(e,t,n,i,r,s){const{x:a,y:l}=Wv(e,[t,n,i]),{x:c,y:u}=Wv({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const oB=(e,t,n,i,r,s)=>{const a=uJe(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Hv(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=dJe(e,m,g,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},PS=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sb(e){return e!=null&&e!=="parent"}function Fh(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lB(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 L1e(e,t={width:0,height:0},n,i,r){const s={...e},a=i.get(n);if(a){const l=a.origin||r;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function LG(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function fJe(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function hJe(e){return{..._1e,...e||{}}}function SO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=_u(e),l=$x({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?rE(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const cB=e=>({width:e.offsetWidth,height:e.offsetHeight}),$1e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pJe=["INPUT","SELECT","TEXTAREA"];function F1e(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:pJe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const B1e=e=>"clientX"in e,_u=(e,t)=>{var s,a;const n=B1e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$G=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...cB(a)}})};function U1e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function FG({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case sn.Left:return[t-gT(t-i,s),n];case sn.Right:return[t+gT(i-t,s),n];case sn.Top:return[t,n-gT(n-r,s)];case sn.Bottom:return[t,n+gT(r-n,s)]}}function Q1e({sourceX:e,sourceY:t,sourcePosition:n=sn.Bottom,targetX:i,targetY:r,targetPosition:s=sn.Top,curvature:a=.25}){const[l,c]=FG({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=FG({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,m,g]=U1e({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 z1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const bJe=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,yJe=(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)),vJe=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Fu.error006()),t;const i=n.getEdgeId||bJe;let r;return R1e(e)?r={...e}:r={...e,id:i(e)},yJe(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function V1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=z1e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const BG={[sn.Left]:{x:-1,y:0},[sn.Right]:{x:1,y:0},[sn.Top]:{x:0,y:-1},[sn.Bottom]:{x:0,y:1}},xJe=({source:e,sourcePosition:t=sn.Bottom,target:n})=>t===sn.Left||t===sn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wJe({source:e,sourcePosition:t=sn.Bottom,target:n,targetPosition:i=sn.Top,center:r,offset:s,stepPosition:a}){const l=BG[t],c=BG[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=xJe({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},x={x:0,y:0},[,,O,w]=z1e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*a,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*a);const C=[{x:b,y:u.y},{x:b,y:d.y}],N=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?C:N:g=h==="x"?N:C}else{const C=[{x:u.x,y:d.y}],N=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?N:C:g=l.y===m?C:N,t===i){const T=Math.abs(e[h]-n[h]);if(T<=s){const P=Math.min(s-1,s-T);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*P:x[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const T=h==="x"?"y":"x",P=l[h]===c[T],R=u[T]>d[T],L=u[T]=F?(b=(_.x+j.x)/2,v=g[0].y):(b=g[0].x,v=(_.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,O,w]}function OJe(e,t,n,i){const r=Math.min(UG(e,t)/2,UG(t,n)/2,i),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function c6(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function kJe(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=c6(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const H1e=1e3,EJe=10,uB={nodeOrigin:[0,0],nodeExtent:NS,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},CJe={...uB,checkEquality:!0};function dB(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function TJe(e,t,n){const i=dB(uB,n);for(const r of e.values())if(r.parentId)hB(r,e,t,i);else{const s=nE(r,i.nodeOrigin),a=Sb(r.extent)?r.extent:i.nodeExtent,l=Ob(s,a,Fh(r));r.internals.positionAbsolute=l}}function AJe(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 fB(e){return e==="manual"}function u6(e,t,n,i={}){var d,f;const r=dB(CJe,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!fB(r.zIndexMode)?H1e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=a.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=nE(h,r.nodeOrigin),b=Sb(h.extent)?h.extent:r.nodeExtent,v=Ob(g,b,Fh(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:AJe(h,m),z:q1e(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&&hB(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function _Je(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 hB(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=dB(uB,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}_Je(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*EJe),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!fB(c)?H1e:0,{x:h,y:m,z:g}=NJe(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function q1e(e,t,n){const i=Au(e.zIndex)?e.zIndex:0;return fB(n)?i:i+(e.selected?t:0)}function NJe(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Fh(e),u=nE(e,n),d=Sb(e.extent)?Ob(u,e.extent,c):u;let f=Ob({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=P1e(f,c,t));const h=q1e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function pB(e,t,n,i=[0,0]){var a;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=s.get(l.parentId))==null?void 0:a.expandedRect)??qv(c),d=D1e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var O;const d=c.internals.positionAbsolute,f=Fh(c),h=c.origin??i,m=l.x0||g>0||y||x)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+x}}),(O=n.get(u))==null||O.forEach(w=>{e.some(k=>k.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+m,y:w.position.y+g}})})),(f.width0){const m=pB(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function RJe({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function HG(e,t,n,i,r,s){let a=r;const l=i.get(a)||new Map;i.set(a,l.set(n,t)),a=`${r}-${e}`;const c=i.get(a)||new Map;if(i.set(a,c.set(n,t)),s){a=`${r}-${e}-${s}`;const u=i.get(a)||new Map;i.set(a,u.set(n,t))}}function W1e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:a=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${s}-${l}`,d=`${s}-${l}--${r}-${a}`;HG("source",c,d,e,r,a),HG("target",c,u,e,s,l),t.set(i.id,i)}}function G1e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:G1e(n,t):!1}function qG(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 IJe(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!G1e(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function iM({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function PJe({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},a=rE(s,t);return{x:a.x-s.x,y:a.y-s.y}}function DJe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:x,handleSelector:O,domNode:w,isSelectable:k,nodeId:S,nodeClickDistance:E=0}){h=Yl(w);function C({x:A,y:F}){const{nodeLookup:T,nodeExtent:P,snapGrid:R,snapToGrid:L,nodeOrigin:M,onNodeDrag:U,onSelectionDrag:I,onError:H,updateNodePositions:K}=t();s={x:A,y:F};let Q=!1;const q=l.size>1,B=q&&P?l6(iE(l)):null,ee=q&&L?PJe({dragItems:l,snapGrid:R,x:A,y:F}):null;for(const[le,se]of l){if(!T.has(le))continue;let re={x:A-se.distance.x,y:F-se.distance.y};L&&(re=ee?{x:Math.round(re.x+ee.x),y:Math.round(re.y+ee.y)}:rE(re,R));let ge=null;if(q&&P&&!se.extent&&B){const{positionAbsolute:ae}=se.internals,ue=ae.x-B.x+P[0][0],Oe=ae.x+se.measured.width-B.x2+P[1][0],ke=ae.y-B.y+P[0][1],st=ae.y+se.measured.height-B.y2+P[1][1];ge=[[ue,ke],[Oe,st]]}const{position:W,positionAbsolute:X}=I1e({nodeId:le,nextPosition:re,nodeLookup:T,nodeExtent:ge||P,nodeOrigin:M,onError:H});Q=Q||se.position.x!==W.x||se.position.y!==W.y,se.position=W,se.internals.positionAbsolute=X}if(g=g||Q,!!Q&&(K(l,!0),b&&(i||U||!S&&I))){const[le,se]=iM({nodeId:S,dragItems:l,nodeLookup:T});i==null||i(b,l,le,se),U==null||U(b,le,se),S||I==null||I(b,se)}}async function N(){if(!d)return;const{transform:A,panBy:F,autoPanSpeed:T,autoPanOnNodeDrag:P}=t();if(!P){c=!1,cancelAnimationFrame(a);return}const[R,L]=aB(u,d,T);(R!==0||L!==0)&&(s.x=(s.x??0)-R/A[2],s.y=(s.y??0)-L/A[2],await F({x:R,y:L})&&C(s)),a=requestAnimationFrame(N)}function _(A){var q;const{nodeLookup:F,multiSelectionActive:T,nodesDraggable:P,transform:R,snapGrid:L,snapToGrid:M,selectNodesOnDrag:U,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:K}=t();f=!0,(!U||!k)&&!T&&S&&((q=F.get(S))!=null&&q.selected||K()),k&&U&&S&&(e==null||e(S));const Q=SO(A.sourceEvent,{transform:R,snapGrid:L,snapToGrid:M,containerBounds:d});if(s=Q,l=IJe(F,P,Q,S),l.size>0&&(n||I||!S&&H)){const[B,ee]=iM({nodeId:S,dragItems:l,nodeLookup:F});n==null||n(A.sourceEvent,l,B,ee),I==null||I(A.sourceEvent,B,ee),S||H==null||H(A.sourceEvent,ee)}}const j=d1e().clickDistance(E).on("start",A=>{const{domNode:F,nodeDragThreshold:T,transform:P,snapGrid:R,snapToGrid:L}=t();d=(F==null?void 0:F.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,T===0&&_(A),s=SO(A.sourceEvent,{transform:P,snapGrid:R,snapToGrid:L,containerBounds:d}),u=_u(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:F,transform:T,snapGrid:P,snapToGrid:R,nodeDragThreshold:L,nodeLookup:M}=t(),U=SO(A.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!M.has(S))&&(m=!0),!m){if(!c&&F&&f&&(c=!0,N()),!f){const I=_u(A.sourceEvent,d),H=I.x-u.x,K=I.y-u.y;Math.sqrt(H*H+K*K)>L&&_(A)}(s.x!==U.xSnapped||s.y!==U.ySnapped)&&l&&f&&(u=_u(A.sourceEvent,d),C(U))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:F,updateNodePositions:T,onNodeDragStop:P,onSelectionDragStop:R}=t();if(g&&(T(l,!1),g=!1),r||P||!S&&R){const[L,M]=iM({nodeId:S,dragItems:l,nodeLookup:F,dragging:!1});r==null||r(A.sourceEvent,l,L,M),P==null||P(A.sourceEvent,L,M),S||R==null||R(A.sourceEvent,M)}}}).filter(A=>{const F=A.target;return!A.button&&(!x||!qG(F,`.${x}`,w))&&(!O||qG(F,O,w))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function MJe(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())IS(r,qv(s))>0&&i.push(s);return i}const LJe=250;function $Je(e,t,n,i){var l,c;let r=[],s=1/0;const a=MJe(e,n,t+LJe);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=kb(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 K1e(e,t,n,i,r,s=!1){var u,d,f;const a=i.get(e);if(!a)return null;const l=r==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...kb(a,c,c.position,!0)}:c}function X1e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FJe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Y1e=()=>!0;function BJe(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=Y1e,onReconnectEnd:x,updateConnection:O,getTransform:w,getFromHandle:k,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:C}){const N=$1e(e.target);let _=0,j;const{x:A,y:F}=_u(e),T=X1e(s,C),P=l==null?void 0:l.getBoundingClientRect();let R=!1;if(!P||!T)return;const L=K1e(r,T,i,c,t);if(!L)return;let M=_u(e,P),U=!1,I=null,H=!1,K=null;function Q(){if(!d||!P)return;const[W,X]=aB(M,P,S);h({x:W,y:X}),_=requestAnimationFrame(Q)}const q={...L,nodeId:r,type:T,position:L.position},B=c.get(r);let le={inProgress:!0,isValid:null,from:kb(B,q,sn.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:B,to:M,toHandle:null,toPosition:PG[q.position],toNode:null,pointer:M};function se(){R=!0,O(le),g==null||g(e,{nodeId:r,handleId:i,handleType:T})}E===0&&se();function re(W){if(!R){const{x:st,y:Le}=_u(W),Me=st-A,Ie=Le-F;if(!(Me*Me+Ie*Ie>E*E))return;se()}if(!k()||!q){ge(W);return}const X=w();M=_u(W,P),j=$Je($x(M,X,!1,[1,1]),n,c,q),U||(Q(),U=!0);const ae=Z1e(W,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:u,flowId:f,nodeLookup:c});K=ae.handleDomNode,I=ae.connection,H=FJe(!!j,ae.isValid);const ue=c.get(r),Oe=ue?kb(ue,q,sn.Left,!0):le.from,ke={...le,from:Oe,isValid:H,to:ae.toHandle&&H?Wv({x:ae.toHandle.x,y:ae.toHandle.y},X):M,toHandle:ae.toHandle,toPosition:H&&ae.toHandle?ae.toHandle.position:PG[q.position],toNode:ae.toHandle?c.get(ae.toHandle.nodeId):null,pointer:M};O(ke),le=ke}function ge(W){if(!("touches"in W&&W.touches.length>0)){if(R){(j||K)&&I&&H&&(b==null||b(I));const{inProgress:X,...ae}=le,ue={...ae,toPosition:le.toHandle?le.toPosition:null};v==null||v(W,ue),s&&(x==null||x(W,ue))}m(),cancelAnimationFrame(_),U=!1,H=!1,I=null,K=null,N.removeEventListener("mousemove",re),N.removeEventListener("mouseup",ge),N.removeEventListener("touchmove",re),N.removeEventListener("touchend",ge)}}N.addEventListener("mousemove",re),N.addEventListener("mouseup",ge),N.addEventListener("touchmove",re),N.addEventListener("touchend",ge)}function Z1e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=Y1e,nodeLookup:d}){const f=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=_u(e),b=a.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=X1e(void 0,v),O=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!O||!x)return y;const E={source:f?O:i,sourceHandle:f?w:r,target:f?i:O,targetHandle:f?r:w};y.connection=E;const N=k&&S&&(n===Vv.Strict?f&&x==="source"||!f&&x==="target":O!==i||w!==r);y.isValid=N&&u(E),y.toHandle=K1e(O,x,w,d,n,!0)}return y}const d6={onPointerDown:BJe,isValid:Z1e};function UJe({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Yl(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=O=>{if(O.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=O.sourceEvent.ctrlKey&&PS()?10:1,S=-O.sourceEvent.deltaY*(O.sourceEvent.deltaMode===1?.05:O.sourceEvent.deltaMode?1:.002)*d,E=w[2]*Math.pow(2,S*k);t.scaleTo(E)};let b=[0,0];const v=O=>{(O.sourceEvent.type==="mousedown"||O.sourceEvent.type==="touchstart")&&(b=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY])},y=O=>{const w=n();if(O.sourceEvent.type!=="mousemove"&&O.sourceEvent.type!=="touchmove"||!t)return;const k=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const E=i()*Math.max(w[2],Math.log(w[2]))*(m?-1:1),C={x:w[0]-S[0]*E,y:w[1]-S[1]*E},N=[[0,0],[c,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},N,l)},x=T1e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(x,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:Ou}}const PR=e=>({x:e.x,y:e.y,zoom:e.k}),rM=({x:e,y:t,zoom:n})=>jR.translate(e,t).scale(n),Ay=(e,t)=>e.target.closest(`.${t}`),J1e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),QJe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sM=(e,t=0,n=QJe,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},ewe=e=>{const t=e.ctrlKey&&PS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zJe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ay(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=Ou(d),y=ewe(d),x=f*Math.pow(2,y);i.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let m=r===rb.Vertical?0:d.deltaX*h,g=r===rb.Horizontal?0:d.deltaY*h;!PS()&&d.shiftKey&&r!==rb.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=PR(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function VJe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Ay(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function HJe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=PR(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function qJe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&J1e(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,PR(s.transform)))}}function WJe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&J1e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=PR(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function GJe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ay(f,`${u}-flow__node`)||Ay(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Ay(f,l)&&g||Ay(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!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 KJe({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=T1e().scaleExtent([t,n]).translateExtent(i),h=Yl(e).call(f);x({x:r.x,y:r.y,zoom:Hv(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(ewe);async function b(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).transform(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function v({noWheelClassName:j,noPanClassName:A,onPaneContextMenu:F,userSelectionActive:T,panOnScroll:P,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:U,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:Q,lib:q,onTransformChange:B,connectionInProgress:ee,paneClickDistance:le,selectionOnDrag:se}){T&&!u.isZoomingOrPanning&&y();const re=P&&!Q&&!T;f.clickDistance(se?1/0:!Au(le)||le<0?0:le);const ge=re?zJe({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):VJe({noWheelClassName:j,preventScrolling:U,d3ZoomHandler:m});h.on("wheel.zoom",ge,{passive:!1});const W=HJe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",W);const X=qJe({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:B});f.on("zoom",X);const ae=WJe({zoomPanValues:u,panOnDrag:R,panOnScroll:P,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:c});f.on("end",ae);const ue=GJe({zoomActivationKeyPressed:Q,panOnDrag:R,zoomOnScroll:H,panOnScroll:P,zoomOnDoubleClick:K,zoomOnPinch:I,userSelectionActive:T,noPanClassName:A,noWheelClassName:j,lib:q,connectionInProgress:ee});f.filter(ue),K?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(j,A,F){const T=rM(j),P=f==null?void 0:f.constrain()(T,A,F);return P&&await b(P),P}async function O(j,A){const F=rM(j);return await b(F,A),F}function w(j){if(h){const A=rM(j),F=h.property("__zoom");(F.k!==j.zoom||F.x!==j.x||F.y!==j.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const j=h?C1e(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function S(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleTo(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}async function E(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleBy(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function C(j){f==null||f.scaleExtent(j)}function N(j){f==null||f.translateExtent(j)}function _(j){const A=!Au(j)||j<0?0:j;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:O,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:E,setScaleExtent:C,setTranslateExtent:N,syncViewport:w,setClickDistance:_}}var Gv;(function(e){e.Line="line",e.Handle="handle"})(Gv||(Gv={}));function XJe({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const a=e-t,l=n-i,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function WG(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function lp(e,t){return Math.max(0,t-e)}function cp(e,t){return Math.max(0,e-t)}function bT(e,t,n){return Math.max(0,t-e,e-n)}function GG(e,t){return e?!t:t}function YJe(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=i,{x:O,y:w,width:k,height:S,aspectRatio:E}=e;let C=Math.floor(d?m-e.pointerX:0),N=Math.floor(f?g-e.pointerY:0);const _=k+(c?-C:C),j=S+(u?-N:N),A=-s[0]*k,F=-s[1]*S;let T=bT(_,b,v),P=bT(j,y,x);if(a){let M=0,U=0;c&&C<0?M=lp(O+C+A,a[0][0]):!c&&C>0&&(M=cp(O+_+A,a[1][0])),u&&N<0?U=lp(w+N+F,a[0][1]):!u&&N>0&&(U=cp(w+j+F,a[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(l){let M=0,U=0;c&&C>0?M=cp(O+C,l[0][0]):!c&&C<0&&(M=lp(O+_,l[1][0])),u&&N>0?U=cp(w+N,l[0][1]):!u&&N<0&&(U=lp(w+j,l[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(r){if(d){const M=bT(_/E,y,x)*E;if(T=Math.max(T,M),a){let U=0;!c&&!u||c&&!u&&h?U=cp(w+F+_/E,a[1][1])*E:U=lp(w+F+(c?C:-C)/E,a[0][1])*E,T=Math.max(T,U)}if(l){let U=0;!c&&!u||c&&!u&&h?U=lp(w+_/E,l[1][1])*E:U=cp(w+(c?C:-C)/E,l[0][1])*E,T=Math.max(T,U)}}if(f){const M=bT(j*E,b,v)/E;if(P=Math.max(P,M),a){let U=0;!c&&!u||u&&!c&&h?U=cp(O+j*E+A,a[1][0])/E:U=lp(O+(u?N:-N)*E+A,a[0][0])/E,P=Math.max(P,U)}if(l){let U=0;!c&&!u||u&&!c&&h?U=lp(O+j*E,l[1][0])/E:U=cp(O+(u?N:-N)*E,l[0][0])/E,P=Math.max(P,U)}}}N=N+(N<0?P:-P),C=C+(C<0?T:-T),r&&(h?_>j*E?N=(GG(c,u)?-C:C)/E:C=(GG(c,u)?-N:N)*E:d?(N=C/E,u=c):(C=N*E,c=u));const R=c?O+C:O,L=u?w+N:w;return{width:k+(c?-C:C),height:S+(u?-N:N),x:s[0]*C*(c?-1:1)+R,y:s[1]*N*(u?-1:1)+L}}const twe={width:0,height:0,x:0,y:0},ZJe={...twe,pointerX:0,pointerY:0,aspectRatio:1};function JJe(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[i-l,r-c],[i+s-l,r+a-c]]}function eet({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Yl(e);let a={controlDirection:WG("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={...twe},x={...ZJe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:WG(u)};let O,w=null,k=[],S,E,C,N=!1;const _=d1e().on("start",j=>{const{nodeLookup:A,transform:F,snapGrid:T,snapToGrid:P,nodeOrigin:R,paneDomNode:L}=n();if(O=A.get(t),!O)return;w=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:U}=SO(j.sourceEvent,{transform:F,snapGrid:T,snapToGrid:P,containerBounds:w});y={width:O.measured.width??0,height:O.measured.height??0,x:O.position.x??0,y:O.position.y??0},x={...y,pointerX:M,pointerY:U,aspectRatio:y.width/y.height},S=void 0,E=Sb(O.extent)?O.extent:void 0,O.parentId&&(O.extent==="parent"||O.expandParent)&&(S=A.get(O.parentId)),S&&O.extent==="parent"&&(E=[[0,0],[S.measured.width,S.measured.height]]),k=[],C=void 0;for(const[I,H]of A)if(H.parentId===t&&(k.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=JJe(H,O,H.origin??R);C?C=[[Math.min(K[0][0],C[0][0]),Math.min(K[0][1],C[0][1])],[Math.max(K[1][0],C[1][0]),Math.max(K[1][1],C[1][1])]]:C=K}m==null||m(j,{...y})}).on("drag",j=>{const{transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P}=n(),R=SO(j.sourceEvent,{transform:A,snapGrid:F,snapToGrid:T,containerBounds:w}),L=[];if(!O)return;const{x:M,y:U,width:I,height:H}=y,K={},Q=O.origin??P,{width:q,height:B,x:ee,y:le}=YJe(x,a.controlDirection,R,a.boundaries,a.keepAspectRatio,Q,E,C),se=q!==I,re=B!==H,ge=ee!==M&&se,W=le!==U&&re;if(!ge&&!W&&!se&&!re)return;if((ge||W||Q[0]===1||Q[1]===1)&&(K.x=ge?ee:y.x,K.y=W?le:y.y,y.x=K.x,y.y=K.y,k.length>0)){const Oe=ee-M,ke=le-U;for(const st of k)st.position={x:st.position.x-Oe+Q[0]*(q-I),y:st.position.y-ke+Q[1]*(B-H)},L.push(st)}if((se||re)&&(K.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,K.height=re&&(!a.resizeDirection||a.resizeDirection==="vertical")?B:y.height,y.width=K.width,y.height=K.height),S&&O.expandParent){const Oe=Q[0]*(K.width??0);K.x&&K.x{N&&(b==null||b(j,{...y}),r==null||r({...y}),N=!1)});s.call(_)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}var nwe={exports:{}},iwe={};/** +`)},Sze=0,R0=[];function kze(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Sze++)[0],s=p.useState(fve)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=HQe([e.lockRef.current],(e.shards||[]).map(KW),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=sT(b),x=n.current,O="deltaX"in b?b.deltaX:x[0]-y[0],w="deltaY"in b?b.deltaY:x[1]-y[1],k,S=b.target,E=Math.abs(O)>Math.abs(w)?"h":"v";if("touches"in b&&E==="h"&&S.type==="range")return!1;var C=window.getSelection(),N=C&&C.anchorNode,_=N?N===S||N.contains(S):!1;if(_)return!1;var j=WW(E,S);if(!j)return!0;if(j?k=E:(k=E==="v"?"h":"v",j=WW(E,S)),!j)return!1;if(!i.current&&"changedTouches"in b&&(O||w)&&(i.current=k),!k)return!0;var A=i.current||k;return xze(A,v,b,A==="h"?O:w)},[]),c=p.useCallback(function(b){var v=b;if(!(!R0.length||R0[R0.length-1]!==s)){var y="deltaY"in v?GW(v):sT(v),x=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&wze(k.delta,y)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var O=(a.current.shards||[]).map(KW).filter(Boolean).filter(function(k){return k.contains(v.target)}),w=O.length>0?l(v,O[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,x){var O={name:b,delta:v,target:y,should:x,shadowParent:Eze(y)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(w){return w!==O})},1)},[]),d=p.useCallback(function(b){n.current=sT(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,GW(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,sT(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return R0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,j0),document.addEventListener("touchmove",c,j0),document.addEventListener("touchstart",d,j0),function(){R0=R0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,j0),document.removeEventListener("touchmove",c,j0),document.removeEventListener("touchstart",d,j0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Oze(r)}):null,m?p.createElement(hze,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Eze(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cze=eze(dve,kze);var y7=p.forwardRef(function(e,t){return p.createElement(dR,bd({},e,{ref:t,sideCar:Cze}))});y7.classNames=dR.classNames;var Tze=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},I0=new WeakMap,aT=new WeakMap,oT={},qD=0,gve=function(e){return e&&(e.host||gve(e.parentNode))},Aze=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=gve(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})},_ze=function(e,t,n,i){var r=Aze(t,Array.isArray(e)?e:[e]);oT[n]||(oT[n]=new WeakMap);var s=oT[n],a=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(I0.get(h)||0)+1,v=(s.get(h)||0)+1;I0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&aT.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),qD++,function(){a.forEach(function(f){var h=I0.get(f)-1,m=s.get(f)-1;I0.set(f,h),s.set(f,m),h||(aT.has(f)||f.removeAttribute(i),aT.delete(f)),m||f.removeAttribute(n)}),qD--,qD||(I0=new WeakMap,I0=new WeakMap,aT=new WeakMap,oT={})}},bve=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Tze(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),_ze(i,r,n,"aria-hidden")):function(){return null}},Nze=Object.defineProperty,jze=(e,t)=>Nze(e,"name",{value:t,configurable:!0});function Gk(e){const[t,n]=p.useState(void 0);return Jc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}jze(Gk,"useSize");var Rze=Object.defineProperty,kh=(e,t)=>Rze(e,"name",{value:t,configurable:!0}),v7="Checkbox",[Ize,YVt]=kl(v7),[Pze,x7]=Ize(v7);function yve(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=su({prop:n,defaultProp:r??!1,onChange:c,caller:v7}),[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useRef(!1),[O,w]=p.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:rh(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(Pze,{scope:t,...S,children:vve(f)?f(S):i})}kh(yve,"CheckboxProvider");var Dze="CheckboxTrigger",Mze=p.forwardRef(kh(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=x7(Dze,t),y=ir(s,f),x=p.useRef(u);return p.useEffect(()=>{const O=a==null?void 0:a.form;if(O){const w=kh(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[a,h]),o.jsx(wr.button,{type:"button",role:"checkbox","aria-checked":rh(u)?"mixed":u,"aria-required":d,"data-state":w7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:yn(n,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:yn(i,O=>{g(),h(w=>rh(w)?!0:!w),v&&b&&(m.current=O.isPropagationStopped(),m.current||O.stopPropagation())})})},"CheckboxTrigger")),Lze=p.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(yve,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(Mze,{...h,ref:n,__scopeCheckbox:i}),m&&o.jsx(Uze,{__scopeCheckbox:i})]})})},"Checkbox")),$ze="CheckboxIndicator",Fze=p.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=x7($ze,i);return o.jsx(Gd,{present:r||rh(a.checked)||a.checked===!0,children:o.jsx(wr.span,{"data-state":w7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Bze="CheckboxBubbleInput",Uze=p.forwardRef(kh(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=x7(Bze,t),y=ir(r,v),x=Gk(s),O=p.useRef(!1),w=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});E.indeterminate=rh(c),_.call(E,rh(c)?!1:c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=p.useRef(rh(c)?!1:c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function vve(e){return typeof e=="function"}kh(vve,"isFunction");function rh(e){return e==="indeterminate"}kh(rh,"isIndeterminate");function w7(e){return rh(e)?"indeterminate":e?"checked":"unchecked"}kh(w7,"getState");const Qze=["top","right","bottom","left"],gm=Math.min,sh=Math.max,B_=Math.round,lT=Math.floor,ah=e=>({x:e,y:e}),zze={left:"right",right:"left",bottom:"top",top:"bottom"};function xve(e,t,n){return sh(e,gm(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function bm(e){return e.split("-")[0]}function jx(e){return e.split("-")[1]}function O7(e){return e==="x"?"y":"x"}function S7(e){return e==="y"?"height":"width"}function Ed(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function k7(e){return O7(Ed(e))}function Vze(e,t,n){n===void 0&&(n=!1);const i=jx(e),r=k7(e),s=S7(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=U_(a)),[a,U_(a)]}function Hze(e){const t=U_(e);return[q4(e),t,q4(t)]}function q4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const XW=["left","right"],YW=["right","left"],qze=["top","bottom"],Wze=["bottom","top"];function Gze(e,t,n){switch(e){case"top":case"bottom":return n?t?YW:XW:t?XW:YW;case"left":case"right":return t?qze:Wze;default:return[]}}function Kze(e,t,n,i){const r=jx(e);let s=Gze(bm(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(q4)))),s}function U_(e){const t=bm(e);return zze[t]+e.slice(t.length)}function Xze(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 wve(e){return typeof e!="number"?Xze(e):{top:e,right:e,bottom:e,left:e}}function Q_(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function ZW(e,t,n){let{reference:i,floating:r}=e;const s=Ed(t),a=k7(t),l=S7(a),c=bm(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let 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=jx(t);return g&&(m[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function Yze(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Eh(t,e),g=wve(m),v=l[h?f==="floating"?"reference":"floating":f],y=Q_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(O))&&await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1},k=Q_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:O,strategy:c}):x);return{top:(y.top-k.top+g.top)/w.y,bottom:(k.bottom-y.bottom+g.bottom)/w.y,left:(y.left-k.left+g.left)/w.x,right:(k.right-y.right+g.right)/w.x}}const Zze=50,Jze=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Yze},c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=ZW(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=wve(d),h={x:n,y:i},m=k7(r),g=S7(m),b=await a.getDimensions(u),v=m==="y",y=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=S?S[O]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=l.floating[O]||s.floating[g]);const C=w/2-k/2,N=E/2-b[g]/2-1,_=gm(f[y],N),j=gm(f[x],N),A=E-b[g]-j,F=E/2-b[g]/2+C,T=xve(_,F,A),P=!c.arrow&&jx(r)!=null&&F!==T&&s.reference[g]/2-(F<_?_:j)-b[g]/2<0,R=P?F<_?F-_:F-A:0;return{[m]:h[m]+R,data:{[m]:T,centerOffset:F-T-R,...P&&{alignmentOffset:R}},reset:P}}}),tVe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=Eh(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=bm(r),x=Ed(l),O=bm(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=h||(O||!b?[U_(l)]:Hze(l)),S=g!=="none";!h&&S&&k.push(...Kze(l,b,g,w));const E=[l,...k],C=await c.detectOverflow(t,v),N=[];let _=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&N.push(C[y]),f){const T=Vze(r,a,w);N.push(C[T[0]],C[T[1]])}if(_=[..._,{placement:r,overflows:N}],!N.every(T=>T<=0)){var j,A;const T=(((j=s.flip)==null?void 0:j.index)||0)+1,P=E[T];if(P&&(!(f==="alignment"?x!==Ed(P):!1)||_.every(M=>Ed(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:T,overflows:_},reset:{placement:P}};let R=(A=_.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(m){case"bestFit":{var F;const L=(F=_.filter(M=>{if(S){const U=Ed(M.placement);return U===x||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,I)=>U+I,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:F[0];L&&(R=L);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function JW(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eG(e){return Qze.some(t=>e[t]>=0)}const nVe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=JW(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:eG(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=JW(a,n.floating);return{data:{escapedOffsets:l,escaped:eG(l)}}}default:return{}}}}},Ove=new Set(["left","top"]);async function iVe(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=bm(n),l=jx(n),c=Ed(n)==="y",u=Ove.has(a)?-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 rVe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:a,middlewareData:l}=t,c=await iVe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},sVe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:O,y:w}=x;return{x:O,y:w}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Ed(r),m=O7(h);let g=d[m],b=d[h];const v=(x,O)=>xve(O+f[x==="y"?"top":"left"],O,O-f[x==="y"?"bottom":"right"]);a&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:a,[h]:l}}}}}},aVe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},m=Ed(a),g=O7(m);let b=h[g],v=h[m];const y=Eh(u,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+x.mainAxis,E=l.reference[g]+l.reference[k]-x.mainAxis;bE&&(b=E)}if(f){var O,w;const k=g==="y"?"width":"height",S=Ove.has(bm(a)),E=l.reference[m]-l.floating[k]+(S&&((O=c.offset)==null?void 0:O[m])||0)+(S?0:x.crossAxis),C=l.reference[m]+l.reference[k]+(S?0:((w=c.offset)==null?void 0:w[m])||0)-(S?x.crossAxis:0);vC&&(v=C)}return{[g]:b,[m]:v}}}},oVe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:a=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=bm(n),d=jx(n),f=Ed(n)==="y",{width:h,height: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,x=gm(m-c[g],v),O=gm(h-c[b],y),w=t.middlewareData.shift,k=!w;let S=x,E=O;w!=null&&w.enabled.x&&(E=y),w!=null&&w.enabled.y&&(S=v),k&&!d&&(f?E=h-2*sh(c.left,c.right):S=m-2*sh(c.top,c.bottom)),await a({...t,availableWidth:E,availableHeight:S});const C=await r.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function fR(){return typeof window<"u"}function Rx(e){return Sve(e)?(e.nodeName||"").toLowerCase():"#document"}function yo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $h(e){var t;return(t=(Sve(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sve(e){return fR()?e instanceof Node||e instanceof yo(e).Node:!1}function Fd(e){return fR()?e instanceof Element||e instanceof yo(e).Element:!1}function Kd(e){return fR()?e instanceof HTMLElement||e instanceof yo(e).HTMLElement:!1}function tG(e){return!fR()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yo(e).ShadowRoot}function hR(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Bd(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function lVe(e){return/^(table|td|th)$/.test(Rx(e))}function pR(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const cVe=/transform|translate|scale|rotate|perspective|filter/,uVe=/paint|layout|strict|content/,tg=e=>!!e&&e!=="none";let WD;function E7(e){const t=Fd(e)?Bd(e):e;return tg(t.transform)||tg(t.translate)||tg(t.scale)||tg(t.rotate)||tg(t.perspective)||!C7()&&(tg(t.backdropFilter)||tg(t.filter))||cVe.test(t.willChange||"")||uVe.test(t.contain||"")}function dVe(e){let t=yb(e);for(;Kd(t)&&!xS(t);){if(E7(t))return t;if(pR(t))return null;t=yb(t)}return null}function C7(){return WD==null&&(WD=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),WD}function xS(e){return/^(html|body|#document)$/.test(Rx(e))}function Bd(e){return yo(e).getComputedStyle(e)}function mR(e){return Fd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yb(e){if(Rx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tG(e)&&e.host||$h(e);return tG(t)?t.host:t}function kve(e){const t=yb(e);return xS(t)?(e.ownerDocument||e).body:Kd(t)&&hR(t)?t:kve(t)}function wS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=kve(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=yo(r);if(s){const l=W4(a);return t.concat(a,a.visualViewport||[],hR(r)?r:[],l&&n?wS(l):[])}else return t.concat(r,wS(r,[],n))}function W4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Eve(e){const t=Bd(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Kd(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=B_(n)!==s||B_(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function T7(e){return Fd(e)?e:e.contextElement}function Jy(e){const t=T7(e);if(!Kd(t))return ah(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=Eve(t);let a=(s?B_(n.width):n.width)/i,l=(s?B_(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const fVe=ah(0);function Cve(e){const t=yo(e);return!C7()||!t.visualViewport?fVe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hVe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===yo(e)}function vb(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=T7(e);let a=ah(1);t&&(i?Fd(i)&&(a=Jy(i)):a=Jy(e));const l=hVe(s,n,i)?Cve(s):ah(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(s&&i){const h=yo(s),m=Fd(i)?yo(i):i;let g=h,b=W4(g);for(;b&&m!==g;){const v=Jy(b),y=b.getBoundingClientRect(),x=Bd(b),O=y.left+(b.clientLeft+parseFloat(x.paddingLeft))*v.x,w=y.top+(b.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=O,u+=w,g=yo(b),b=W4(g)}}return Q_({width:d,height:f,x:c,y:u})}function gR(e,t){const n=mR(e).scrollLeft;return t?t.left+n:vb($h(e)).left+n}function Tve(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-gR(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function pVe(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=$h(i),l=t?pR(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ah(1);const d=ah(0),f=Kd(i);if((f||!s)&&((Rx(i)!=="body"||hR(a))&&(c=mR(i)),f)){const m=vb(i);u=Jy(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=a&&!f&&!s?Tve(a,c):ah(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function mVe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function gVe(e){const t=mR(e),n=e.ownerDocument.body,i=sh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=sh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+gR(e);const a=-t.scrollTop;return Bd(n).direction==="rtl"&&(s+=sh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const bVe=25;function yVe(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=yo(e),s=$h(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!C7()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(gR(s)<=0){const h=s.ownerDocument,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<=bVe&&(l-=y)}return{width:l,height:c,x:u,y:d}}function vVe(e,t){const n=vb(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=Jy(e),a=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:a,height:l,x:c,y:u}}function nG(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=yVe(e,n,t);else if(t==="document")i=gVe($h(e));else if(Fd(t))i=vVe(t,n);else{const r=Cve(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Q_(i)}function xVe(e,t){const n=t.get(e);if(n)return n;let i=wS(e,[],!1).filter(l=>Fd(l)&&Rx(l)!=="body"),r=null;const s=Bd(e).position==="fixed";let a=s?yb(e):e;for(;Fd(a)&&!xS(a);){const l=Bd(a),c=E7(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=yb(a)}return t.set(e,i),i}function wVe(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?pR(t)?[]:xVe(t,this._c):[].concat(n),i],l=nG(t,a[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}E=!1}try{i=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(C,S)}i.observe(e)}const c=yo(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function AVe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=T7(e),d=r||s?[...u?wS(u):[],...t?wS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?TVe(u,n,s):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var O;(O=m)==null||O.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?vb(e):null;c&&v();function v(){const y=vb(e);b&&!_ve(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const _Ve=rVe,NVe=sVe,jVe=tVe,RVe=oVe,IVe=nVe,rG=eVe,PVe=aVe,DVe=(e,t,n)=>{const i=new Map,r=n??{},s={...CVe,...r.platform,_c:i};return Jze(e,t,{...r,platform:s})};var MVe=typeof document<"u",LVe=function(){},lA=MVe?p.useLayoutEffect:LVe;function z_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!z_(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!z_(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Nve(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sG(e,t){const n=Nve(e);return Math.round(t*n)/n}function KD(e){const t=p.useRef(e);return lA(()=>{t.current=e}),t}function $Ve(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);z_(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useCallback(M=>{M!==S.current&&(S.current=M,b(M))},[]),O=p.useCallback(M=>{M!==E.current&&(E.current=M,y(M))},[]),w=s||g,k=a||v,S=p.useRef(null),E=p.useRef(null),C=p.useRef(d),N=c!=null,_=KD(c),j=KD(r),A=KD(u),F=p.useCallback(()=>{if(!S.current||!E.current)return;const M={placement:t,strategy:n,middleware:h};j.current&&(M.platform=j.current),DVe(S.current,E.current,M).then(U=>{const I={...U,isPositioned:A.current!==!1};T.current&&!z_(C.current,I)&&(C.current=I,Li.flushSync(()=>{f(I)}))})},[h,t,n,j,A]);lA(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const T=p.useRef(!1);lA(()=>(T.current=!0,()=>{T.current=!1}),[]),lA(()=>{if(w&&(S.current=w),k&&(E.current=k),w&&k){if(_.current)return _.current(w,k,F);F()}},[w,k,F,_,N]);const P=p.useMemo(()=>({reference:S,floating:E,setReference:x,setFloating:O}),[x,O]),R=p.useMemo(()=>({reference:w,floating:k}),[w,k]),L=p.useMemo(()=>{const M={position:n,left:0,top:0};if(!R.floating)return M;const U=sG(R.floating,d.x),I=sG(R.floating,d.y);return l?{...M,transform:"translate("+U+"px, "+I+"px)",...Nve(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:I}},[n,l,R.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:P,elements:R,floatingStyles:L}),[d,F,P,R,L])}const FVe=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?rG({element:i.current,padding:r}).fn(n):{}:i?rG({element:i,padding:r}).fn(n):{}}}},BVe=(e,t)=>{const n=_Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}},UVe=(e,t)=>{const n=NVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},QVe=(e,t)=>({fn:PVe(e).fn,options:[e,t]}),zVe=(e,t)=>{const n=jVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},VVe=(e,t)=>{const n=RVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},HVe=(e,t)=>{const n=IVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},qVe=(e,t)=>{const n=FVe(e);return{name:n.name,fn:n.fn,options:[e,t]}};var WVe=Object.defineProperty,em=(e,t)=>WVe(e,"name",{value:t,configurable:!0}),jve="Popper",[Rve,Ix]=kl(jve),[GVe,Ive]=Rve(jve),KVe=em(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,a]=p.useState(void 0);return o.jsx(GVe,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),XVe="PopperAnchor",YVe=p.forwardRef(em(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=Ive(XVe,i),l=p.useRef(null),c=a.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=ir(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&bR(a.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(wr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Pve="PopperContent",[ZVe,ZVt]=Rve(Pve),JVe=p.forwardRef(em(function(t,n){var re,ge,W,X,ae,ue,Oe;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=Ive(Pve,i),[x,O]=p.useState(null),w=ir(n,O),[k,S]=p.useState(null),E=Gk(k),C=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,_=r+(a!=="center"?"-"+a:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],F=A.length>0,T={padding:j,boundary:A.filter(Dve),altBoundary:F},{refs:P,floatingStyles:R,placement:L,isPositioned:M,middlewareData:U}=$Ve({strategy:"fixed",placement:_,whileElementsMounted:em((...ke)=>AVe(...ke,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[BVe({mainAxis:s+N,alignmentAxis:l}),u&&UVe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?QVe():void 0,...T}),u&&zVe({...T}),VVe({...T,apply:em(({elements:ke,rects:st,availableWidth:Le,availableHeight:Me})=>{const{width:Ie,height:qe}=st.reference,Ae=ke.floating.style;Ae.setProperty("--radix-popper-available-width",`${Le}px`),Ae.setProperty("--radix-popper-available-height",`${Me}px`),Ae.setProperty("--radix-popper-anchor-width",`${Ie}px`),Ae.setProperty("--radix-popper-anchor-height",`${qe}px`)},"apply")}),k&&qVe({element:k,padding:c}),eHe({arrowWidth:C,arrowHeight:N}),m&&HVe({strategy:"referenceHidden",...T,boundary:F?T.boundary:void 0})]}),I=y.setPlacementState;Jc(()=>(I(L),()=>{I(void 0)}),[L,I]);const[H,K]=bR(L),Q=$u(b);Jc(()=>{M&&(Q==null||Q())},[M,Q]);const q=(re=U.arrow)==null?void 0:re.x,B=(ge=U.arrow)==null?void 0:ge.y,ee=((W=U.arrow)==null?void 0:W.centerOffset)!==0,[le,se]=p.useState();return Jc(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:M?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(X=U.transformOrigin)==null?void 0:X.x,(ae=U.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=U.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(ZVe,{scope:i,placedSide:H,placedAlign:K,onArrowChange:S,arrowX:q,arrowY:B,shouldHideArrow:ee,children:o.jsx(wr.div,{"data-side":H,"data-align":K,...v,ref:w,style:{...v.style,animation:M?(Oe=v.style)==null?void 0:Oe.animation:"none"}})})})},"PopperContent"));function Dve(e){return e!==null}em(Dve,"isNotNull");var eHe=em(e=>({name:"transformOrigin",options:e,fn(t){var v,y,x;const{placement:n,rects:i,middlewareData:r}=t,a=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=bR(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((x=r.arrow)==null?void 0:x.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=a?f:`${h}px`,b=`${-c}px`):u==="top"?(g=a?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=a?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function bR(e){const[t,n="center"]=e.split("-");return[t,n]}em(bR,"getSideAndAlignFromPlacement");var yR=KVe,A7=YVe,_7=JVe,tHe=Object.defineProperty,N7=(e,t)=>tHe(e,"name",{value:t,configurable:!0}),XD=!1;function Mve(){const[e,t]=p.useState(XD);return p.useEffect(()=>{XD||(XD=!0,t(!0))},[]),e}N7(Mve,"useIsHydrated");var Lve=Fb[" useSyncExternalStore ".trim().toString()];function $ve(){return()=>{}}N7($ve,"subscribe");function Fve(){return Lve($ve,()=>!0,()=>!1)}N7(Fve,"useIsHydratedModern");var nHe=typeof Lve=="function"?Fve:Mve,iHe=Object.defineProperty,Gb=(e,t)=>iHe(e,"name",{value:t,configurable:!0}),YD="rovingFocusGroup.onEntryFocus",rHe={bubbles:!1,cancelable:!0},vR="RovingFocusGroup",[G4,Bve,sHe]=d7(vR),[aHe,Px]=kl(vR,[sHe]),[oHe,lHe]=aHe(vR),cHe=p.forwardRef(Gb(function(t,n){return o.jsx(G4.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(G4.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(uHe,{...t,ref:n})})})},"RovingFocusGroup")),uHe=p.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=ir(n,m),b=Wk(a),[v,y]=su({prop:l,defaultProp:c??null,onChange:u,caller:vR}),[x,O]=p.useState(!1),w=$u(d),k=Bve(i),S=p.useRef(!1),[E,C]=p.useState(0);return p.useEffect(()=>{const N=m.current;if(N)return N.addEventListener(YD,w),()=>N.removeEventListener(YD,w)},[w]),o.jsx(oHe,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(N=>y(N),[y]),onItemShiftTab:p.useCallback(()=>O(!0),[]),onFocusableItemAdd:p.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:p.useCallback(()=>C(N=>N-1),[]),children:o.jsx(wr.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:yn(t.onMouseDown,()=>{S.current=!0}),onFocus:yn(t.onFocus,N=>{const _=!S.current;if(N.target===N.currentTarget&&_&&!x){const j=new CustomEvent(YD,rHe);if(N.currentTarget.dispatchEvent(j),!j.defaultPrevented){const A=k().filter(L=>L.focusable),F=A.find(L=>L.active),T=A.find(L=>L.id===v),R=[F,T,...A].filter(Boolean).map(L=>L.ref.current);j7(R,f)}}S.current=!1}),onBlur:yn(t.onBlur,()=>O(!1))})})},"RovingFocusGroupImpl")),dHe="RovingFocusGroupItem",fHe=p.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=mm(),d=a||u,f=lHe(dHe,i),h=f.currentTabStopId===d,m=Bve(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=nHe();return Jc(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(G4.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(wr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:yn(t.onMouseDown,x=>{r?f.onItemFocus(d):x.preventDefault()}),onFocus:yn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:yn(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const O=Qve(x,f.orientation,f.dir);if(O!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=f.loop?zve(k,S+1):k.slice(S+1)}setTimeout(()=>j7(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),hHe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Gb(Uve,"getDirectionAwareKey");function Qve(e,t,n){const i=Uve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return hHe[i]}Gb(Qve,"getFocusIntent");function j7(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Gb(j7,"focusFirst");function zve(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Gb(zve,"wrapArray");var R7=cHe,I7=fHe,pHe=Object.defineProperty,Qi=(e,t)=>pHe(e,"name",{value:t,configurable:!0}),K4=["Enter"," "],mHe=["ArrowDown","PageUp","Home"],Vve=["ArrowUp","PageDown","End"],gHe=[...mHe,...Vve],bHe={ltr:[...K4,"ArrowRight"],rtl:[...K4,"ArrowLeft"]},yHe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xR="Menu",[OS,vHe,xHe]=d7(xR),[Kb,Hve]=kl(xR,[xHe,Ix,Px]),wR=Ix(),qve=Px(),[Wve,$m]=Kb(xR),[wHe,Kk]=Kb(xR),OHe=Qi(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=wR(t),[c,u]=p.useState(null),d=p.useRef(!1),f=$u(s),h=Wk(r);return p.useEffect(()=>{const m=Qi(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Qi(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",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=Qi(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),o.jsx(yR,{...l,children:o.jsx(Wve,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(wHe,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),Gve=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t,s=wR(i);return o.jsx(A7,{...s,...r,ref:n})},"MenuAnchor")),Kve="MenuPortal",[SHe,Xve]=Kb(Kve,{forceMount:void 0}),kHe=Qi(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=$m(Kve,t);return o.jsx(SHe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"MenuPortal"),Pu="MenuContent",[EHe,P7]=Kb(Pu),CHe=p.forwardRef(Qi(function(t,n){const i=Xve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=$m(Pu,t.__scopeMenu),l=Kk(Pu,t.__scopeMenu);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||a.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(THe,{...s,ref:n}):o.jsx(AHe,{...s,ref:n})})})})},"MenuContent")),THe=p.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu),r=p.useRef(null),s=ir(n,r);return p.useEffect(()=>{const a=r.current;if(a)return bve(a)},[]),o.jsx(D7,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:yn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),AHe=p.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu);return o.jsx(D7,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),_He=Oh("MenuContent.ScrollLock"),D7=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=$m(Pu,i),x=Kk(Pu,i),O=wR(i),w=qve(i),k=vHe(i),[S,E]=p.useState(null),C=p.useRef(null),N=ir(n,C,y.onContentChange),_=p.useRef(0),j=p.useRef(""),A=p.useRef(0),F=p.useRef(null),T=p.useRef("right"),P=p.useRef(0),R=b?y7:p.Fragment,L=b?{as:_He,allowPinchZoom:!0}:void 0,M=Qi(I=>{var se,re;const H=j.current+I,K=k().filter(ge=>!ge.disabled),Q=document.activeElement,q=(se=K.find(ge=>ge.ref.current===Q))==null?void 0:se.textValue,B=K.map(ge=>ge.textValue),ee=rxe(B,H,q),le=(re=K.find(ge=>ge.textValue===ee))==null?void 0:re.ref.current;Qi(function ge(W){j.current=W,window.clearTimeout(_.current),W!==""&&(_.current=window.setTimeout(()=>ge(""),1e3))},"updateSearch")(H),le&&setTimeout(()=>le.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(_.current),[]),uR();const U=p.useCallback(I=>{var K,Q;return T.current===((K=F.current)==null?void 0:K.side)&&axe(I,(Q=F.current)==null?void 0:Q.area)},[]);return o.jsx(EHe,{scope:i,searchRef:j,onItemEnter:p.useCallback(I=>{U(I)&&I.preventDefault()},[U]),onItemLeave:p.useCallback(I=>{var H;U(I)||((H=C.current)==null||H.focus(),E(null))},[U]),onTriggerLeave:p.useCallback(I=>{U(I)&&I.preventDefault()},[U]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(I=>{F.current=I},[]),children:o.jsx(R,{...L,children:o.jsx(nve,{asChild:!0,trapped:s,onMountAutoFocus:yn(a,I=>{var H;I.preventDefault(),(H=C.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:o.jsx(R7,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:yn(u,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(_7,{role:"menu","aria-orientation":"vertical","data-state":L7(y.open),"data-radix-menu-content":"",dir:x.dir,...O,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:yn(v.onKeyDown,I=>{const K=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Q=I.ctrlKey||I.altKey||I.metaKey,q=I.key.length===1;K&&(I.key==="Tab"&&I.preventDefault(),!Q&&q&&M(I.key));const B=C.current;if(I.target!==B||!gHe.includes(I.key))return;I.preventDefault();const le=k().filter(se=>!se.disabled).map(se=>se.ref.current);Vve.includes(I.key)&&le.reverse(),nxe(le)}),onBlur:yn(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),j.current="")}),onPointerMove:yn(t.onPointerMove,Bv(I=>{const H=I.target,K=P.current!==I.clientX;if(I.currentTarget.contains(H)&&K){const Q=I.clientX>P.current?"right":"left";T.current=Q,P.current=I.clientX}}))})})})})})})},"MenuContentImpl")),NHe=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"group",...r,ref:n})},"MenuGroup")),X4="MenuItem",aG="menu.itemSelect",M7=p.forwardRef(Qi(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=p.useRef(null),l=Kk(X4,t.__scopeMenu),c=P7(X4,t.__scopeMenu),u=ir(n,a),d=p.useRef(!1),f=Qi(()=>{const h=a.current;if(!i&&h){const m=new CustomEvent(aG,{bubbles:!0,cancelable:!0});h.addEventListener(aG,g=>r==null?void 0:r(g),{once:!0}),u7(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(Yve,{...s,ref:u,disabled:i,onClick:yn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:yn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:yn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||K4.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Yve=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=P7(X4,i),c=qve(i),u=p.useRef(null),d=ir(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(OS.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:o.jsx(I7,{asChild:!0,...c,focusable:!r,children:o.jsx(wr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:yn(t.onPointerMove,Bv(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yn(t.onPointerLeave,Bv(b=>l.onItemLeave(b))),onFocus:yn(t.onFocus,()=>h(!0)),onBlur:yn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),jHe=p.forwardRef(Qi(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(Jve,{scope:t.__scopeMenu,checked:i,children:o.jsx(M7,{role:"menuitemcheckbox","aria-checked":SS(i)?"mixed":i,...s,ref:n,"data-state":OR(i),onSelect:yn(s.onSelect,()=>r==null?void 0:r(SS(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),RHe="MenuRadioGroup",[IHe,PHe]=Kb(RHe,{value:void 0,onValueChange:Qi(()=>{},"onValueChange")}),DHe=p.forwardRef(Qi(function(t,n){const{value:i,onValueChange:r,...s}=t,a=$u(r);return o.jsx(IHe,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(NHe,{...s,ref:n})})},"MenuRadioGroup")),MHe="MenuRadioItem",LHe=p.forwardRef(Qi(function(t,n){const{value:i,...r}=t,s=PHe(MHe,t.__scopeMenu),a=i===s.value;return o.jsx(Jve,{scope:t.__scopeMenu,checked:a,children:o.jsx(M7,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":OR(a),onSelect:yn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Zve="MenuItemIndicator",[Jve,$He]=Kb(Zve,{checked:!1}),FHe=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=$He(Zve,i);return o.jsx(Gd,{present:r||SS(a.checked)||a.checked===!0,children:o.jsx(wr.span,{...s,ref:n,"data-state":OR(a.checked)})})},"MenuItemIndicator")),BHe=p.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),exe="MenuSub",[UHe,txe]=Kb(exe),QHe=Qi(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=$m(exe,t),a=wR(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=$u(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(yR,{...a,children:o.jsx(Wve,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(UHe,{scope:t,contentId:mm(),triggerId:mm(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),cT="MenuSubTrigger",zHe=p.forwardRef(Qi(function(t,n){const i=$m(cT,t.__scopeMenu),r=Kk(cT,t.__scopeMenu),s=txe(cT,t.__scopeMenu),a=P7(cT,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ir(n,s.onTriggerChange);return o.jsx(Gve,{asChild:!0,...d,children:o.jsx(Yve,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":L7(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:yn(t.onPointerMove,Bv(m=>{a.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:yn(t.onPointerLeave,Bv(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,x=y==="right",O=x?-5:5,w=g[x?"left":"right"],k=g[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+O,y:m.clientY},{x:w,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:yn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||a.searchRef.current!==""&&m.key===" "||bHe[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),VHe="MenuSubContent",HHe=p.forwardRef(Qi(function(t,n){const i=Xve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=$m(Pu,t.__scopeMenu),c=Kk(Pu,t.__scopeMenu),u=txe(VHe,t.__scopeMenu),d=p.useRef(null),f=ir(n,d);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||l.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:o.jsx(D7,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:yn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:yn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:yn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=yHe[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function L7(e){return e?"open":"closed"}Qi(L7,"getOpenState");function SS(e){return e==="indeterminate"}Qi(SS,"isIndeterminate");function OR(e){return SS(e)?"indeterminate":e?"checked":"unchecked"}Qi(OR,"getCheckedState");function nxe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Qi(nxe,"focusFirst");function ixe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Qi(ixe,"wrapArray");function rxe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=ixe(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Qi(rxe,"getNextMatch");function sxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Qi(sxe,"isPointInPolygon");function axe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return sxe(n,t)}Qi(axe,"isPointerInGraceArea");function Bv(e){return t=>t.pointerType==="mouse"?e(t):void 0}Qi(Bv,"whenMouse");var qHe=OHe,WHe=Gve,GHe=kHe,KHe=CHe,XHe=M7,YHe=jHe,ZHe=DHe,JHe=LHe,eqe=FHe,tqe=BHe,nqe=QHe,iqe=zHe,rqe=HHe,sqe=Object.defineProperty,mc=(e,t)=>sqe(e,"name",{value:t,configurable:!0}),$7="DropdownMenu",[aqe,JVt]=kl($7,[Hve]),gc=Hve(),[oqe,oxe]=aqe($7),lqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=gc(t),u=p.useRef(null),[d,f]=su({prop:r,defaultProp:s??!1,onChange:a,caller:$7});return o.jsx(oqe,{scope:t,triggerId:mm(),triggerRef:u,contentId:mm(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(qHe,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),cqe="DropdownMenuTrigger",uqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=oxe(cqe,i),l=gc(i),c=ir(n,a.triggerRef);return o.jsx(WHe,{asChild:!0,...l,children:o.jsx(wr.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:yn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:yn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),dqe=mc(e=>{const{__scopeDropdownMenu:t,...n}=e,i=gc(t);return o.jsx(GHe,{...i,...n})},"DropdownMenuPortal"),fqe="DropdownMenuContent",hqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=oxe(fqe,i),a=gc(i),l=p.useRef(!1);return o.jsx(KHe,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:yn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:yn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),pqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(XHe,{...s,...r,ref:n})},"DropdownMenuItem")),mqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(YHe,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),gqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(ZHe,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),bqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(JHe,{...s,...r,ref:n})},"DropdownMenuRadioItem")),yqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(eqe,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),vqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(tqe,{...s,...r,ref:n})},"DropdownMenuSeparator")),xqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=gc(t),[l,c]=su({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(nqe,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),wqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(iqe,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),Oqe=p.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(rqe,{...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")),Sqe=lqe,kqe=uqe,lxe=dqe,Eqe=hqe,cxe=pqe,Cqe=mqe,Tqe=gqe,Aqe=bqe,uxe=yqe,_qe=vqe,Nqe=xqe,jqe=wqe,Rqe=Oqe,Iqe=Object.defineProperty,Fm=(e,t)=>Iqe(e,"name",{value:t,configurable:!0}),F7="Popover",[dxe,eHt]=kl(F7,[Ix]),B7=Ix(),[Pqe,Dx]=dxe(F7),Dqe=Fm(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=B7(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=su({prop:i,defaultProp:r??!1,onChange:s,caller:F7});return o.jsx(yR,{...l,children:o.jsx(Pqe,{scope:t,contentId:mm(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),Mqe="PopoverTrigger",Lqe=p.forwardRef(Fm(function(t,n){const{__scopePopover:i,...r}=t,s=Dx(Mqe,i),a=B7(i),l=ir(n,s.triggerRef),c=o.jsx(wr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":U7(s.open),...r,ref:l,onClick:yn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(A7,{asChild:!0,...a,children:c})},"PopoverTrigger")),fxe="PopoverPortal",[$qe,Fqe]=dxe(fxe,{forceMount:void 0}),Bqe=Fm(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Dx(fxe,t);return o.jsx($qe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),kS="PopoverContent",Uqe=p.forwardRef(Fm(function(t,n){const i=Fqe(kS,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Dx(kS,t.__scopePopover);return o.jsx(Gd,{present:r||a.open,children:a.modal?o.jsx(zqe,{...s,ref:n}):o.jsx(Vqe,{...s,ref:n})})},"PopoverContent")),Qqe=Oh("PopoverContent.RemoveScroll"),zqe=p.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=p.useRef(null),s=ir(n,r),a=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return bve(l)},[]),o.jsx(y7,{as:Qqe,allowPinchZoom:!0,children:o.jsx(hxe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:yn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:yn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Vqe=p.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(hxe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,a),a.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),hxe=p.forwardRef(Fm(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Dx(kS,i),g=B7(i);return uR(),o.jsx(nve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(_7,{"data-state":U7(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 U7(e){return e?"open":"closed"}Fm(U7,"getState");var pxe=Dqe,mxe=Lqe,gxe=Bqe,bxe=Uqe,Hqe=Object.defineProperty,vo=(e,t)=>Hqe(e,"name",{value:t,configurable:!0}),yxe="Radio",[qqe,vxe]=kl(yxe),[Wqe,SR]=qqe(yxe);function xxe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(w=>w+1,0),x=f?!!s||!!f.closest("form"):!0,O={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:m,setBubbleInput:g,onCheck:vo(()=>l==null?void 0:l(),"onCheck")};return o.jsx(Wqe,{scope:t,...O,children:wxe(d)?d(O):i})}vo(xxe,"RadioProvider");var Gqe="RadioTrigger",Kqe=p.forwardRef(vo(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=SR(Gqe,t),g=ir(r,c);return o.jsx(wr.button,{type:"button",role:"radio","aria-checked":s,"data-state":Q7(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:yn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Xqe="RadioIndicator",Yqe=p.forwardRef(vo(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=SR(Xqe,i);return o.jsx(Gd,{present:r||a.checked,children:o.jsx(wr.span,{"data-state":Q7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Zqe="RadioBubbleInput",Jqe=p.forwardRef(vo(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=SR(Zqe,t),v=ir(r,m),y=Gk(s),x=p.useRef(!1),O=p.useRef(a),w=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const E=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(E,"checked").set,_=b!==w.current;w.current=b;const j=O.current!==a;O.current=a;const A=!(_&&g.current);if(j&&N){x.current=!_;const F=new Event("click",{bubbles:A});N.call(S,a),S.dispatchEvent(F),x.current=!1}},[h,a,g,b]);const k=p.useRef(a);return o.jsx(wr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:yn(n,S=>{x.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function wxe(e){return typeof e=="function"}vo(wxe,"isFunction");function Q7(e){return e?"checked":"unchecked"}vo(Q7,"getState");var eWe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],z7="RadioGroup",[tWe,tHt]=kl(z7,[Px,vxe]),Oxe=Px(),kR=vxe(),[nWe,iWe]=tWe(z7),rWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=Oxe(i),v=Wk(f),[y,x]=su({prop:l,defaultProp:a??null,onChange:m,caller:z7}),[O,w]=p.useState(null),k=ir(n,w),S=p.useRef(y);return p.useEffect(()=>{const E=s?O==null?void 0:O.ownerDocument.getElementById(s):O==null?void 0:O.closest("form");if(E instanceof HTMLFormElement){const C=vo(()=>x(S.current),"reset");return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[O,s,x]),o.jsx(nWe,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(R7,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(wr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),sWe="RadioGroupItemProvider",aWe="RadioGroupItemTrigger";function Sxe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=iWe(sWe,t),l=kR(t),c=a.disabled||i;return o.jsx(xxe,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:s,children:r})}vo(Sxe,"RadioGroupItemProvider");var oWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=Oxe(i),a=kR(i),{checked:l,disabled:c}=SR(aWe,a.__scopeRadio),u=p.useRef(null),d=ir(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=vo(g=>{eWe.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=vo(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),o.jsx(I7,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(Kqe,{...a,...r,ref:d,onKeyDown:yn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:yn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),lWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(Sxe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(oWe,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(cWe,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),cWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Jqe,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),uWe=p.forwardRef(vo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Yqe,{...s,...r,ref:n})},"RadioGroupIndicator")),dWe=Object.defineProperty,ym=(e,t)=>dWe(e,"name",{value:t,configurable:!0}),V7="Switch",[fWe,nHt]=kl(V7),[hWe,H7]=fWe(V7);function kxe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=su({prop:n,defaultProp:r??!1,onChange:c,caller:V7}),[g,b]=p.useState(null),[v,y]=p.useState(null),x=p.useRef(!1),[O,w]=p.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(hWe,{scope:t,...S,children:Exe(f)?f(S):i})}ym(kxe,"SwitchProvider");var pWe="SwitchTrigger",mWe=p.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=H7(pWe,t),y=ir(r,f),x=p.useRef(u);return p.useEffect(()=>{const O=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(O instanceof HTMLFormElement){const w=ym(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[s,a,h]),o.jsx(wr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":q7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:yn(n,O=>{g(),h(w=>!w),v&&b&&(m.current=O.isPropagationStopped(),m.current||O.stopPropagation())})})},"SwitchTrigger")),gWe=p.forwardRef(ym(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(kxe,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(mWe,{...h,ref:n,__scopeSwitch:i}),m&&o.jsx(xWe,{__scopeSwitch:i})]})})},"Switch")),bWe="SwitchThumb",yWe=p.forwardRef(ym(function(t,n){const{__scopeSwitch:i,...r}=t,s=H7(bWe,i);return o.jsx(wr.span,{"data-state":q7(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),vWe="SwitchBubbleInput",xWe=p.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=H7(vWe,t),y=ir(r,v),x=Gk(s),O=p.useRef(!1),w=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});_.call(E,c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=p.useRef(c);return o.jsx(wr.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:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Exe(e){return typeof e=="function"}ym(Exe,"isFunction");function q7(e){return e?"checked":"unchecked"}ym(q7,"getState");var wWe=Object.defineProperty,OWe=(e,t)=>wWe(e,"name",{value:t,configurable:!0}),SWe="Toggle",kWe=p.forwardRef(OWe(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=su({prop:i,onChange:s,defaultProp:r??!1,caller:SWe});return o.jsx(wr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:yn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),EWe=Object.defineProperty,vm=(e,t)=>EWe(e,"name",{value:t,configurable:!0}),Mx="ToggleGroup",[Cxe,iHt]=kl(Mx,[Px]),Txe=Px(),CWe=p.forwardRef(vm(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(TWe,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(AWe,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Mx}\``)},"ToggleGroup")),[Axe,_xe]=Cxe(Mx),TWe=p.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??"",onChange:s,caller:Mx});return o.jsx(Axe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:o.jsx(Nxe,{...a,ref:n})})},"ToggleGroupImplSingle")),AWe=p.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??[],onChange:s,caller:Mx}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return o.jsx(Axe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(Nxe,{...a,ref:n})})},"ToggleGroupImplMultiple")),[_We,NWe]=Cxe(Mx),Nxe=p.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=Txe(i),f=Wk(l),h={dir:f,...u};return o.jsx(_We,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(R7,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(wr.div,{...h,ref:n})}):o.jsx(wr.div,{...h,ref:n})})},"ToggleGroupImpl")),Y4="ToggleGroupItem",jWe=p.forwardRef(vm(function(t,n){const i=_xe(Y4,t.__scopeToggleGroup),r=NWe(Y4,t.__scopeToggleGroup),s=Txe(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=p.useRef(null);return r.rovingFocus?o.jsx(I7,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(oG,{...c,ref:n})}):o.jsx(oG,{...c,ref:n})},"ToggleGroupItem")),oG=p.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=_xe(Y4,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(kWe,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),RWe=Object.defineProperty,La=(e,t)=>RWe(e,"name",{value:t,configurable:!0}),[W7,rHt]=kl("Tooltip",[Ix]),G7=Ix(),IWe="TooltipProvider",PWe=700,Z4="tooltip.open",[DWe,K7]=W7(IWe),MWe=La(e=>{const{__scopeTooltip:t,delayDuration:n=PWe,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(DWe,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),J4="Tooltip",[LWe,Xk]=W7(J4),$We=La(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=K7(J4,e.__scopeTooltip),u=G7(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=mm(),b=p.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,x=p.useRef(!1),[O,w]=su({prop:i,defaultProp:r??!1,onChange:La(_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Z4))):c.onClose(),s==null||s(_)},"onChange"),caller:J4}),k=p.useMemo(()=>O?x.current?"delayed-open":"instant-open":"closed",[O]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,w(!0)},[w]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w(!1)},[w]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,w(!0),b.current=0},y)},[y,w]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const N=h??g;return o.jsx(yR,{...u,children:o.jsx(LWe,{scope:t,contentId:N,setContentId:m,open:O,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"),lG="TooltipTrigger",FWe=p.forwardRef(La(function(t,n){const{__scopeTooltip:i,...r}=t,s=Xk(lG,i),a=K7(lG,i),l=G7(i),c=p.useRef(null),u=ir(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(A7,{asChild:!0,...l,children:o.jsx(wr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:yn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:yn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:yn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:yn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:yn(t.onBlur,s.onClose),onClick:yn(t.onClick,s.onClose)})})},"TooltipTrigger")),jxe="TooltipPortal",[BWe,UWe]=W7(jxe,{forceMount:void 0}),QWe=La(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=Xk(jxe,t);return o.jsx(BWe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(g7,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),ES="TooltipContent",zWe=p.forwardRef(La(function(t,n){const i=UWe(ES,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=Xk(ES,t.__scopeTooltip);return o.jsx(Gd,{present:r||l.open,children:l.disableHoverableContent?o.jsx(Rxe,{side:s,...a,ref:n}):o.jsx(VWe,{side:s,...a,ref:n})})},"TooltipContent")),VWe=p.forwardRef(La(function(t,n){const i=Xk(ES,t.__scopeTooltip),r=K7(ES,t.__scopeTooltip),s=p.useRef(null),a=ir(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,x={x:b.clientX,y:b.clientY},O=Ixe(x,y.getBoundingClientRect()),w=Pxe(x,O),k=Dxe(v.getBoundingClientRect()),S=Lxe([...w,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=La(y=>g(y,f),"handleTriggerLeave"),v=La(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=La(v=>{const y=v.target,x={x:v.clientX,y:v.clientY},O=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),w=!Mxe(x,l);O?m():w&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),o.jsx(Rxe,{...t,ref:a})},"TooltipContentHoverable")),HWe=Iye("TooltipContent"),Rxe=p.forwardRef(La(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=Xk(ES,i),f=G7(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Z4,h),()=>document.removeEventListener(Z4,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=La(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Jc(()=>(m(a),()=>{m(void 0)}),[a,m]),o.jsx(h7,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(_7,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(HWe,{children:r}),s?o.jsx(hQe,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function Ixe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}La(Ixe,"getExitSideFromRect");function Pxe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}La(Pxe,"getPaddedExitPoints");function Dxe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}La(Dxe,"getPointsFromRect");function Mxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}La(Mxe,"isPointInPolygon");function Lxe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),$xe(t)}La(Lxe,"getHull");function $xe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}La($xe,"getHullPresorted");var qWe=MWe,WWe=$We,Fxe=FWe,GWe=QWe,KWe=zWe;function xm(e){const t=p.useRef(e);return t.current=e,t}let Uv=[],uT=!1;const cG=e=>{var t,n;if(e.key==="Escape"){const[i]=Uv;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},Bxe=()=>{Uv.length>0&&!uT?(document.body.addEventListener("keydown",cG),uT=!0):Uv.length===0&&uT&&(document.body.removeEventListener("keydown",cG),uT=!1)},XWe=e=>{Uv.unshift(e),Bxe()},YWe=({id:e})=>{Uv=Uv.filter(t=>t.id!==e),Bxe()},Yk=(e,t)=>{const n=p.useId(),i=xm(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return XWe(r),()=>YWe(r)},[n,e,i])},ZWe=p.createContext(null);function Uxe(){const e=p.useContext(ZWe);return(e==null?void 0:e.linkComponent)??"a"}function Zk(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const JWe=()=>Tye,uG=(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},P0=()=>{},D0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function eGe(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(a):a.concat(l)}function tGe(e,t,n){if((Tye||GUe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const nGe="_TransitionGroupChild_1hv1z_1",iGe={TransitionGroupChild:nGe},Qxe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},rGe=e=>({...Qxe,enter:!e}),sGe=(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 Qxe}},aGe=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,x]=p.useReducer(sGe,rGe(a||!1)),O=p.useRef(!1),w=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(N=>{const _=w.current;if(!(!_||N===E.current))switch(E.current=N,N){case"enter":f(_);break;case"enter-active":h(_);break;case"enter-complete":m(_);break;case"exit":g(_);break;case"exit-active":b(_);break;case"exit-complete":v(_);break}},[f,h,m,g,b,v]);return ii.useLayoutEffect(()=>{if(!l){let j;x({type:"exit-before"}),C("exit");const A=F_(()=>{x({type:"exit-active"}),C("exit-active"),j=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{A(),j!==void 0&&clearTimeout(j)}}if(a&&!O.current){O.current=!0;return}let N;x({type:"enter-before"}),C("enter");const _=F_(()=>{x({type:"enter-active"}),C("enter-active"),N=window.setTimeout(()=>{x({type:"done"}),C("enter-complete")},k.current)});return()=>{_(),N!==void 0&&clearTimeout(N)}},[l,a,d,C]),p.useEffect(()=>()=>{O.current=!1},[]),o.jsx(t,{ref:Zk([w,e]),className:pi(i,iGe.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})},oGe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return o7(()=>s(!0),r?null:i),r?o.jsx(aGe,{...e}):null},Lx=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=JWe()}=e,m=D0(e.onEnter??P0),g=D0(e.onEnterActive??P0),b=D0(e.onEnterComplete??P0),v=D0(e.onExit??P0),y=D0(e.onExitActive??P0),x=D0(e.onExitComplete??P0);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const O=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:x}),[m,g,b,v,y,x]),[w,k]=p.useState(()=>uG(i).map(S=>({...O(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const E=uG(i);return eGe(E,S,O,f)})},[i,f,O]),tGe("TransitionGroup",t,p.Children.count(i)),h?o.jsx(o.Fragment,{children:p.Children.map(i,S=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:S}))}):o.jsx(o.Fragment,{children:w.map(({component:S,...E})=>o.jsx(oGe,{...E,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:S},S.key))})},lGe="_Button_1864l_1",cGe="_ButtonInner_1864l_4",uGe="_ButtonLoader_1864l_749",ZD={Button:lGe,ButtonInner:cGe,ButtonLoader:uGe},Ht=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:x=u,...O}=e,w=v||x,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return o.jsxs("button",{type:t,className:pi(ZD.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:l7,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...O,children:[o.jsx(Lx,{className:ZD.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(Hk,{},"loader")}),o.jsx("span",{className:ZD.ButtonInner,children:a7(m)})]})},dGe=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function fGe(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function hGe(e,t=document.body){if(typeof e=="string")return dG(e,t);try{return dGe()?(await navigator.clipboard.write([fGe(e)]),!0):e["text/plain"]?dG(e["text/plain"],t):!1}catch{return!1}}async function dG(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 pGe="_TransitionItem_1o7b1_1",mGe={TransitionItem:pGe},gGe=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:a,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=wGe(e);return o.jsx(t,{className:pi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Lx,{as:t,className:pi(mGe.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},bGe=400,yGe=500,vGe=200,xGe=300;function wGe({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=$D(e),s=$D(t),a=$D(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?yGe:bGe),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?xGe:vGe),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Wb({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":LD((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":FD(t),"tg-enter-duration":tT(c),"tg-enter-delay":tT((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":LD((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":FD(n),"tg-exit-duration":tT(d),"tg-exit-delay":tT((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":LD((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":FD(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 X7=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),hGe(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(Ht,{...i,onClick:l,children:[o.jsx(gGe,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?o.jsx(Lv,{},"copied-icon"):o.jsx(PF,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},OGe="_Menu_1t4b0_1",SGe="_MenuList_1t4b0_3",kGe="_MenuItemContent_1t4b0_53",EGe="_MenuItem_1t4b0_53",CGe="_ItemActions_1t4b0_98",TGe="_PressableInner_1t4b0_117",AGe="_Separator_1t4b0_135",_Ge="_SubMenuItem_1t4b0_139",NGe="_SubTriggerIcon_1t4b0_141",jGe="_RadioItem_1t4b0_151",RGe="_RadioIndicatorActive_1t4b0_158",IGe="_RadioIndicator_1t4b0_158",PGe="_CheckboxItem_1t4b0_249",DGe="_CheckboxIndicator_1t4b0_256",MGe="_CheckboxCircle_1t4b0_269",Wr={Menu:OGe,MenuList:SGe,MenuItemContent:kGe,MenuItem:EGe,ItemActions:CGe,PressableInner:TGe,Separator:AGe,SubMenuItem:_Ge,SubTriggerIcon:NGe,RadioItem:jGe,RadioIndicatorActive:RGe,RadioIndicator:IGe,CheckboxItem:PGe,CheckboxIndicator:DGe,CheckboxCircle:MGe},zxe=p.createContext(null),Jk=()=>{const e=p.useContext(zxe);if(!e)throw new Error("Menu components must be wrapped in ");return e},vr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=p.useState(!1),l=t??s,c=xm(n),u=xm(i),d=p.useCallback(h=>{var m,g;a(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx(zxe.Provider,{value:f,children:o.jsx(Sqe,{open:l,onOpenChange:d,modal:r,children:e})})},LGe=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=Jk(),a=l=>{s||l.preventDefault()};return i?o.jsx(cxe,{className:pi(Wr.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:Wr.PressableInner,children:t})}):o.jsx("div",{className:pi(Wr.MenuItemContent,e),children:t})},$Ge=({className:e,children:t})=>o.jsx("div",{className:pi(Wr.ItemActions,e),children:t}),FGe=({children:e,onClick:t})=>{const{setOpen:n}=Jk();return o.jsx(Ht,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},BGe=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=Jk(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=Uxe(),h=a||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(cxe,{asChild:!0,className:pi(Wr.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:Wr.PressableInner,children:n})})})},UGe=({className:e})=>o.jsx(_qe,{className:pi(Wr.Separator,e),role:"separator"}),QGe=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=Jk();return o.jsx(lxe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(Eqe,{forceMount:!0,className:Wr.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},zGe=({children:e,disabled:t})=>o.jsx(kqe,{asChild:!0,disabled:t,children:e}),Vxe=p.createContext(null),Hxe=()=>{const e=p.useContext(Vxe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},VGe=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=t??r,c=xm(n),u=xm(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]);Yk(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(Vxe.Provider,{value:f,children:o.jsx(Nqe,{open:l,onOpenChange:d,children:e})})},HGe=({className:e,children:t,disabled:n})=>{const{open:i}=Jk(),{triggerRef:r}=Hxe(),s=a=>{i||a.preventDefault()};return o.jsx(jqe,{ref:r,className:pi(Wr.MenuItem,Wr.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:Wr.PressableInner,children:[t,o.jsx(MFe,{width:"16",height:"16",className:Wr.SubTriggerIcon})]})})},qGe=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=Hxe();return o.jsx(lxe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(Rqe,{className:Wr.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},WGe=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(Tqe,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),GGe=({className:e,children:t,...n})=>o.jsx(Aqe,{className:pi(Wr.MenuItem,Wr.RadioItem,e),...n,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.RadioIndicator,children:o.jsx(uxe,{className:Wr.RadioIndicatorActive})}),t]})}),KGe=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(Cqe,{className:pi(Wr.MenuItem,Wr.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.CheckboxIndicator,children:o.jsx(uxe,{children:i==="ghost"?o.jsx(Lv,{className:"size-4"}):o.jsx("div",{className:Wr.CheckboxCircle,children:o.jsx(Lv,{className:"size-4"})})})}),t]})});vr.Content=QGe;vr.Item=LGe;vr.ItemActions=$Ge;vr.ItemAction=FGe;vr.Link=BGe;vr.Separator=UGe;vr.Trigger=zGe;vr.Sub=VGe;vr.SubTrigger=HGe;vr.SubContent=qGe;vr.CheckboxItem=KGe;vr.RadioGroup=WGe;vr.RadioItem=GGe;const XGe="_Tooltip_16g2y_1",YGe="_TriggerDecorator_16g2y_73",qxe={Tooltip:XGe,TriggerDecorator:YGe},go=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:a=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...x}=e,[O,w]=p.useState(!1),[k,S]=p.useState(!1);o7(()=>S(!1),k?400:null);const E=r??O,C=_=>{typeof r!="boolean"&&(w(_),u&&S(_))},N=_=>{u&&k&&(_.preventDefault(),_.stopPropagation())};return o.jsxs(Wxe,{open:E,delayDuration:a,onOpenChange:C,disableHoverableContent:!l,children:[o.jsx(Fxe,{asChild:!0,children:o.jsx(jye,{...x,ref:t,onPointerDown:_=>{N(_),v==null||v(_)},onClick:_=>{N(_),y==null||y(_)},children:n})}),o.jsx(Gxe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},Wxe=({children:e,open:t,onOpenChange:n,...i})=>(Yk(t,()=>{n(!1)}),o.jsx(qWe,{children:o.jsx(WWe,{open:t,onOpenChange:n,...i,children:e})})),Gxe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:a="md",className:l,style:c,...u})=>o.jsx(GWe,{children:o.jsx(KWe,{...u,className:pi(qxe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":a,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:ih,children:e})}),ZGe=({children:e,asChild:t=!0,...n})=>o.jsx(Fxe,{asChild:t,...n,children:e}),JGe=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(jye,{ref:r,...s,className:pi(qxe.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};go.Root=Wxe;go.Content=Gxe;go.Trigger=ZGe;go.TriggerDecorator=JGe;const eKe=50,fG=48;function tKe(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function nKe(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return V("search.untitledSession")}function iKe(e,t,n){const i=Math.max(0,t-fG),r=Math.min(e.length,t+n+fG);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await iR(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of tKe(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:nKe(l),snippet:iKe(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,eKe)}async function sKe(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await a0e(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?V("search.webUnavailable"):V("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:V("search.webNotMounted")}}async function aKe(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await s0e(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:V(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??V(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:a.content,sourceName:s,sourceType:r.sourceType,author:a.author,ts:a.timestamp})}}async function oKe(e,t,n){return e==="session"?{results:await rKe(n.userId,n.appId,t)}:e==="web"?sKe(n.appId,t):aKe(e,n.appId,n.userId,t)}function Kxe({mirrored:e=!1}){return o.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[o.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),o.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function lKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Kxe,{})})}function cKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Kxe,{mirrored:!0})})}function uKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function dKe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),o.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function fKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function Xxe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),o.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),o.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function hKe({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function pKe({open:e}){return o.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function mKe({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[o.jsx(dKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function gKe(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),a=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:a(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:a(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:a(i("search.sources.memory"))}]}function V_(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function hG(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 bKe({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var M,U;const{t:a,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,x]=p.useState(!1),[O,w]=p.useState(!1),[k,S]=p.useState(!1),E=p.useRef(0),C=p.useRef(null),N=gKe(t,n,i,a),_=N.find(I=>I.id===u),j=u==="knowledge"?(M=n==null?void 0:n.components)==null?void 0:M.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):u==="memory"?(U=n==null?void 0:n.components)==null?void 0:U.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;p.useEffect(()=>{E.current+=1,d("session"),g([]),v(void 0),w(!1),x(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function I(H){var K;(K=C.current)!=null&&K.contains(H.target)||S(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[k]);async function A(I,H){var B;const K=I.trim();if(!K||!((B=N.find(ee=>ee.id===H))!=null&&B.ready))return;const Q=++E.current;x(!0),w(!0);let q;try{q=await oKe(H,K,{userId:e,appId:t})}catch(ee){const le=ee instanceof Error?ee.message:String(ee);q={results:[],note:a("search.failed",{message:le})}}Q===E.current&&(g(q.results),v(q.note),x(!1))}function F(I){E.current+=1,h(I),g([]),v(void 0),w(!1),x(!1)}function T(I){E.current+=1,d(I),S(!1),g([]),v(void 0),w(!1),x(!1)}const P=!!(_!=null&&_.ready),R=t?u==="web"?a("search.placeholder.web"):u==="knowledge"?a("search.placeholder.knowledge",{name:(j==null?void 0:j.name)??a("search.placeholder.knowledgeFallback")}):u==="memory"?a("search.placeholder.memory",{name:(j==null?void 0:j.name)??a("search.placeholder.memoryFallback")}):a("search.placeholder.session"):a("search.placeholder.selectAgent"),L=j!=null&&j.backend?V_(j.backend,a):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:C,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(_==null?void 0:_.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(I=>!I),children:[o.jsx("span",{children:(_==null?void 0:_.label)??a("search.sourceType")}),L&&o.jsx("small",{children:L}),o.jsx(pKe,{open:k})]}),k&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:N.map(I=>{var Q,q;const H=I.id==="knowledge"?(Q=n==null?void 0:n.components)==null?void 0:Q.find(B=>B.source==="knowledgebase"||B.kind==="knowledgebase"):I.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(B=>B.source==="long_term_memory"||B.kind==="memory"):void 0,K=H?[H.name,H.backend?V_(H.backend,a):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":u===I.id,disabled:!I.ready,onClick:()=>T(I.id),children:[o.jsx("span",{children:I.label}),K&&o.jsx("small",{children:K})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:f,onChange:I=>F(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(f,u))},placeholder:R,disabled:!P,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(fi,{className:"icon spin"}):o.jsx(hKe,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:P?O?y?null:b?o.jsx("div",{className:"search-empty",children:b}):m.length===0&&O?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):m.map((I,H)=>o.jsx(yKe,{result:I,agentLabel:r,onOpen:s,locale:c},H)):o.jsx("div",{className:"search-empty",children:a(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):o.jsx("div",{className:"search-empty",children:t?i?a("search.loadingCapabilities"):(_==null?void 0:_.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function yKe({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(_be,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${hG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(Zj,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(gb,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(pG,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(pG,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:"",e.ts?` · ${hG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function pG({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function vKe({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function xKe({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function Yxe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const ER="/assets/media/logo-DCsNZy-k.svg",Y7="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",mG="(max-width: 860px)";function gG({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),a={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return o.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:a,children:o.jsx("span",{ref:n,className:"history-title-text",children:e})})}function wKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function OKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),o.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function SKe(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 kKe={admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function EKe({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=X7e(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=SKe(h),b=Y7e(n),v=b===d?"":b,y=wj(u.resolvedLanguage??u.language)??xj;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(vr,{modal:!0,children:[o.jsx(vr.Trigger,{children:o.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[o.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsx("span",{className:"sidebar-user-identity",children:o.jsx("span",{className:"sidebar-user-name",children:h})})]})}),o.jsxs(vr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[o.jsxs("div",{className:"account-menu-head",children:[o.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:h}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${kKe[t.role]}`)})]}),m&&m!==h&&o.jsx("div",{className:"account-sub",children:m})]})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Wd,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(vr.Sub,{children:[o.jsx(vr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(OKe,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(vr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(vr.RadioGroup,{value:y,onChange:x=>{oLe(x)},indicatorPosition:"end",children:K8.map(x=>o.jsx(vr.RadioItem,{value:x,children:c(`common:languageNames.${x}`)},x))})})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Yxe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(T7e,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),o.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[o.jsx(go,{compact:!0,content:c("sidebar:account.tryCli"),children:o.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:o.jsx(HFe,{className:"icon"})})}),o.jsx(go,{compact:!0,content:c("sidebar:account.developerResources"),children:o.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:o.jsx(IFe,{className:"icon"})})})]})]})})}function CKe({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:a,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onAddAgent:g,onMyAgents:b,onWorkspace:v,onApplications:y,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onPickSession:E,onDeleteSession:C,userInfo:N,onLogout:_}){const{t:j}=Te("sidebar"),A=H=>(s==null?void 0:s[H])!==!1,[F,T]=p.useState(null),P=p.useRef(typeof window<"u"&&window.matchMedia(mG).matches),[R,L]=p.useState(P.current),M=n.map(H=>({id:H.id,title:cR(H.events,j("history.newConversation")),createdAt:(H.lastUpdateTime??0)*1e3})).sort((H,K)=>K.createdAt-H.createdAt),U=()=>{P.current=!1,L(H=>!H),T(null)};p.useEffect(()=>{const H=window.matchMedia(mG),K=Q=>{Q.matches?L(q=>q||(P.current=!0,!0)):P.current&&(P.current=!1,L(!1))};return H.addEventListener("change",K),()=>H.removeEventListener("change",K)},[]);const I=t==="byteplus"?Y7:ER;return o.jsxs("aside",{className:`sidebar ${R?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":j("navigation.home"),title:j("navigation.home"),children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||I,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":j(R?"navigation.expand":"navigation.collapse"),title:j(R?"navigation.expand":"navigation.collapse"),children:R?o.jsx(cKe,{className:"icon"}):o.jsx(lKe,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":j("navigation.label"),children:[A("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":j("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:j("navigation.newChat"),children:[o.jsx(uKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.newChat")})]}),A("search")&&o.jsx(mKe,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:b,"aria-label":j("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:j("navigation.agents"),children:[o.jsx(fKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.agents")})]}),o.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:v,"aria-label":j("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:j("navigation.workspaces"),children:[o.jsx(o7e,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.workspaces")})]}),o.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":j("navigation.library"),"aria-current":r==="library"?"page":void 0,title:j("navigation.library"),children:[o.jsx(Xxe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.library")})]}),o.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":j("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:j("navigation.cronjobs"),children:[o.jsx(IF,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.cronjobs")})]}),o.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:y,"aria-label":j("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:j("navigation.automations"),children:[o.jsx(wKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.automations")})]})]})]}),A("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:j("history.title")}),A("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":j("history.create"),title:j("history.create"),children:o.jsx(Fo,{className:"icon"})})]}),o.jsx("div",{className:"history-list",children:u?o.jsxs(o.Fragment,{children:[u.loading&&u.threads.length===0?o.jsx("div",{className:"history-empty",role:"status",children:j("history.loading")}):null,u.error?o.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,u.threads.map(H=>{const K=H.id===u.currentThreadId,Q=H.name||H.preview||`Thread ${H.id.slice(0,8)}`,q=H.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(H.id),"aria-current":K?"page":void 0,title:Q,disabled:q,children:[o.jsx(gG,{title:Q}),K?o.jsx("span",{className:"history-current-badge",children:j("history.current")}):null]}),o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:Q}),title:j("history.more"),disabled:q,onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(xW,{className:"icon"})}),F===H.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),u.onDelete(H)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]}):null]},H.id)}),u.hasMore?o.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?j("history.loadingMore"):j("history.loadMore")}):null]}):o.jsxs(o.Fragment,{children:[M.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,M.map(H=>{const K=H.id===i,Q=(l==null?void 0:l.has(H.id))===!0,q=!Q&&(c==null?void 0:c.has(H.id))===!0;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>E(H.id),"aria-current":K?"page":void 0,title:H.title,children:[o.jsx(gG,{title:H.title}),q&&o.jsxs("span",{className:"history-evaluating-status",title:j("history.evaluatingTitle"),children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),j("history.evaluating")]})]}),o.jsxs("div",{className:"history-action-slot",children:[Q?o.jsx(Hk,{className:"history-streaming-indicator",size:12,role:"status","aria-label":j("history.generating")}):null,o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:H.title}),title:j("history.more"),onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(xW,{className:"icon"})})]}),F===H.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),C(H.id)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]})]},H.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(EKe,{activePage:r,access:a,userInfo:N,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onLogout:_})})]})}function ta(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function CR(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cA.prototype=CR.prototype={constructor:cA,on:function(e,t){var n=this._,i=AKe(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yG.hasOwnProperty(t)?{space:yG[t],local:e}:e}function NKe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===e6&&t.documentElement.namespaceURI===e6?t.createElement(e):t.createElementNS(n,e)}}function jKe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Zxe(e){var t=TR(e);return(t.local?jKe:NKe)(t)}function RKe(){}function Z7(e){return e==null?RKe:function(){return this.querySelector(e)}}function IKe(e){typeof e!="function"&&(e=Z7(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=O&&(O=x+1);!(k=v[O])&&++O=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function rXe(e){e||(e=sXe);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 aXe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oXe(){return Array.from(this)}function lXe(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?vXe:typeof t=="function"?wXe:xXe)(e,t,n??"")):Qv(this.node(),e)}function Qv(e,t){return e.style.getPropertyValue(t)||i1e(e).getComputedStyle(e,null).getPropertyValue(t)}function SXe(e){return function(){delete this[e]}}function kXe(e,t){return function(){this[e]=t}}function EXe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CXe(e,t){return arguments.length>1?this.each((t==null?SXe:typeof t=="function"?EXe:kXe)(e,t)):this.node()[e]}function r1e(e){return e.trim().split(/^|\s+/)}function J7(e){return e.classList||new s1e(e)}function s1e(e){this._node=e,this._names=r1e(e.getAttribute("class")||"")}s1e.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 a1e(e,t){for(var n=J7(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function eYe(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function t6(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}t6.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uYe(e){return!e.ctrlKey&&!e.button}function dYe(){return this.parentNode}function fYe(e,t){return t??{x:e.x,y:e.y}}function hYe(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1e(){var e=uYe,t=dYe,n=fYe,i=hYe,r={},s=CR("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,cYe).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(w,k){if(!(d||!e.call(this,w,k))){var S=O(this,t.call(this,w,k),w,k,"mouse");S&&(Yl(w.view).on("mousemove.drag",g,CS).on("mouseup.drag",b,CS),u1e(w.view),JD(w),u=!1,l=w.clientX,c=w.clientY,S("start",w))}}function g(w){if(ev(w),!u){var k=w.clientX-l,S=w.clientY-c;u=k*k+S*S>f}r.mouse("drag",w)}function b(w){Yl(w.view).on("mousemove.drag mouseup.drag",null),d1e(w.view,u),ev(w),r.mouse("end",w)}function v(w,k){if(e.call(this,w,k)){var S=w.changedTouches,E=t.call(this,w,k),C=S.length,N,_;for(N=0;N>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fT(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fT(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mYe.exec(e))?new dl(t[1],t[2],t[3],1):(t=gYe.exec(e))?new dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bYe.exec(e))?fT(t[1],t[2],t[3],t[4]):(t=yYe.exec(e))?fT(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vYe.exec(e))?EG(t[1],t[2]/100,t[3]/100,1):(t=xYe.exec(e))?EG(t[1],t[2]/100,t[3]/100,t[4]):vG.hasOwnProperty(e)?OG(vG[e]):e==="transparent"?new dl(NaN,NaN,NaN,0):null}function OG(e){return new dl(e>>16&255,e>>8&255,e&255,1)}function fT(e,t,n,i){return i<=0&&(e=t=n=NaN),new dl(e,t,n,i)}function SYe(e){return e instanceof tE||(e=xb(e)),e?(e=e.rgb(),new dl(e.r,e.g,e.b,e.opacity)):new dl}function n6(e,t,n,i){return arguments.length===1?SYe(e):new dl(e,t,n,i??1)}function dl(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}eB(dl,n6,h1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dl(ib(this.r),ib(this.g),ib(this.b),W_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:SG,formatHex:SG,formatHex8:kYe,formatRgb:kG,toString:kG}));function SG(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}`}function kYe(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}${Mg((isNaN(this.opacity)?1:this.opacity)*255)}`}function kG(){const e=W_(this.opacity);return`${e===1?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${e===1?")":`, ${e})`}`}function W_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mg(e){return e=ib(e),(e<16?"0":"")+e.toString(16)}function EG(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cu(e,t,n,i)}function p1e(e){if(e instanceof Cu)return new Cu(e.h,e.s,e.l,e.opacity);if(e instanceof tE||(e=xb(e)),!e)return new Cu;if(e instanceof Cu)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,l=s-r,c=(s+r)/2;return l?(t===s?a=(n-i)/l+(n0&&c<1?0:a,new Cu(a,l,c,e.opacity)}function EYe(e,t,n,i){return arguments.length===1?p1e(e):new Cu(e,t,n,i??1)}function Cu(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}eB(Cu,EYe,h1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new Cu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new Cu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dl(eM(e>=240?e-240:e+120,r,i),eM(e,r,i),eM(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Cu(CG(this.h),hT(this.s),hT(this.l),W_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=W_(this.opacity);return`${e===1?"hsl(":"hsla("}${CG(this.h)}, ${hT(this.s)*100}%, ${hT(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CG(e){return e=(e||0)%360,e<0?e+360:e}function hT(e){return Math.max(0,Math.min(1,e||0))}function eM(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const AR=e=>()=>e;function m1e(e,t){return function(n){return e+n*t}}function CYe(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 sHt(e,t){var n=t-e;return n?m1e(e,n>180||n<-180?n-360*Math.round(n/360):n):AR(isNaN(e)?t:e)}function TYe(e){return(e=+e)==1?g1e:function(t,n){return n-t?CYe(t,n,e):AR(isNaN(t)?n:t)}}function g1e(e,t){var n=t-e;return n?m1e(e,n):AR(isNaN(e)?t:e)}const G_=function e(t){var n=TYe(t);function i(r,s){var a=n((r=n6(r)).r,(s=n6(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=g1e(r.opacity,s.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function AYe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:pd(i,r)})),n=tM.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:pd(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:pd(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:pd(u,f)},{i:b-2,x:pd(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--zv}function _G(){wb=(X_=_S.now())+_R,zv=Rw=0;try{zYe()}finally{zv=0,HYe(),wb=0}}function VYe(){var e=_S.now(),t=e-X_;t>x1e&&(_R-=t,X_=e)}function HYe(){for(var e,t=K_,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K_=n);Iw=e,s6(i)}function s6(e){if(!zv){Rw&&(Rw=clearTimeout(Rw));var t=e-wb;t>24?(e<1/0&&(Rw=setTimeout(_G,e-_S.now()-_R)),$1&&($1=clearInterval($1))):($1||(X_=_S.now(),$1=setInterval(VYe,x1e)),zv=1,w1e(_G))}}function NG(e,t,n){var i=new Y_;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var qYe=CR("start","end","cancel","interrupt"),WYe=[],S1e=0,jG=1,a6=2,dA=3,RG=4,o6=5,fA=6;function NR(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;GYe(e,n,{name:t,index:i,group:r,on:qYe,tween:WYe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:S1e})}function nB(e,t){var n=Wu(e,t);if(n.state>S1e)throw new Error("too late; already scheduled");return n}function Xd(e,t){var n=Wu(e,t);if(n.state>dA)throw new Error("too late; already running");return n}function Wu(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function GYe(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=O1e(s,0,n.time);function s(u){n.state=jG,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==jG)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===dA)return NG(a);m.state===RG?(m.state=fA,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+da6&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function kZe(e,t,n){var i,r,s=SZe(t)?nB:Xd;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function EZe(e,t){var n=this._id;return arguments.length<2?Wu(this.node(),n).on.on(e):this.each(kZe(n,e,t))}function CZe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function TZe(){return this.on("end.remove",CZe(this._id))}function AZe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Z7(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function JZe(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Kf(e,t,n){this.k=e,this.x=t,this.y=n}Kf.prototype={constructor:Kf,scale:function(e){return e===1?this:new Kf(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kf(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jR=new Kf(1,0,0);T1e.prototype=Kf.prototype;function T1e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jR;return e.__zoom}function nM(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function eJe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tJe(){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 IG(){return this.__zoom||jR}function nJe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function iJe(){return navigator.maxTouchPoints||"ontouchstart"in this}function rJe(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function A1e(){var e=eJe,t=tJe,n=rJe,i=nJe,r=iJe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=uA,u=CR("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(T){T.property("__zoom",IG).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",_).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,P,R,L){var M=T.selection?T.selection():T;M.property("__zoom",IG),T!==M?k(T,P,R,L):M.interrupt().each(function(){S(this,arguments).event(L).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(T,P,R,L){y.scaleTo(T,function(){var M=this.__zoom.k,U=typeof P=="function"?P.apply(this,arguments):P;return M*U},R,L)},y.scaleTo=function(T,P,R,L){y.transform(T,function(){var M=t.apply(this,arguments),U=this.__zoom,I=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R,H=U.invert(I),K=typeof P=="function"?P.apply(this,arguments):P;return n(O(x(U,K),I,H),M,a)},R,L)},y.translateBy=function(T,P,R,L){y.transform(T,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,L)},y.translateTo=function(T,P,R,L,M){y.transform(T,function(){var U=t.apply(this,arguments),I=this.__zoom,H=L==null?w(U):typeof L=="function"?L.apply(this,arguments):L;return n(jR.translate(H[0],H[1]).scale(I.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof R=="function"?-R.apply(this,arguments):-R),U,a)},L,M)};function x(T,P){return P=Math.max(s[0],Math.min(s[1],P)),P===T.k?T:new Kf(P,T.x,T.y)}function O(T,P,R){var L=P[0]-R[0]*T.k,M=P[1]-R[1]*T.k;return L===T.x&&M===T.y?T:new Kf(T.k,L,M)}function w(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function k(T,P,R,L){T.on("start.zoom",function(){S(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,U=arguments,I=S(M,U).event(L),H=t.apply(M,U),K=R==null?w(H):typeof R=="function"?R.apply(M,U):R,Q=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=M.__zoom,B=typeof P=="function"?P.apply(M,U):P,ee=c(q.invert(K).concat(Q/q.k),B.invert(K).concat(Q/B.k));return function(le){if(le===1)le=B;else{var se=ee(le),re=Q/se[2];le=new Kf(re,K[0]-se[0]*re,K[1]-se[1]*re)}I.zoom(null,le)}})}function S(T,P,R){return!R&&T.__zooming||new E(T,P)}function E(T,P){this.that=T,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,P),this.taps=0}E.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,P){return this.mouse&&T!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var P=Yl(this.that).datum();u.call(T,this.that,new JZe(T,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),P)}};function C(T,...P){if(!e.apply(this,arguments))return;var R=S(this,P).event(T),L=this.__zoom,M=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,i.apply(this,arguments)))),U=Ou(T);if(R.wheel)(R.mouse[0][0]!==U[0]||R.mouse[0][1]!==U[1])&&(R.mouse[1]=L.invert(R.mouse[0]=U)),clearTimeout(R.wheel);else{if(L.k===M)return;R.mouse=[U,L.invert(U)],hA(this),R.start()}F1(T),R.wheel=setTimeout(I,g),R.zoom("mouse",n(O(x(L,M),R.mouse[0],R.mouse[1]),R.extent,a));function I(){R.wheel=null,R.end()}}function N(T,...P){if(h||!e.apply(this,arguments))return;var R=T.currentTarget,L=S(this,P,!0).event(T),M=Yl(T.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",Q,!0),U=Ou(T,R),I=T.clientX,H=T.clientY;u1e(T.view),nM(T),L.mouse=[U,this.__zoom.invert(U)],hA(this),L.start();function K(q){if(F1(q),!L.moved){var B=q.clientX-I,ee=q.clientY-H;L.moved=B*B+ee*ee>b}L.event(q).zoom("mouse",n(O(L.that.__zoom,L.mouse[0]=Ou(q,R),L.mouse[1]),L.extent,a))}function Q(q){M.on("mousemove.zoom mouseup.zoom",null),d1e(q.view,L.moved),F1(q),L.event(q).end()}}function _(T,...P){if(e.apply(this,arguments)){var R=this.__zoom,L=Ou(T.changedTouches?T.changedTouches[0]:T,this),M=R.invert(L),U=R.k*(T.shiftKey?.5:2),I=n(O(x(R,U),L,M),t.apply(this,P),a);F1(T),l>0?Yl(this).transition().duration(l).call(k,I,L,T):Yl(this).call(y.transform,I,L,T)}}function j(T,...P){if(e.apply(this,arguments)){var R=T.touches,L=R.length,M=S(this,P,T.changedTouches.length===L).event(T),U,I,H,K;for(nM(T),I=0;I`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},NS=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_1e=["Enter"," ","Escape"],N1e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Vv;(function(e){e.Strict="strict",e.Loose="loose"})(Vv||(Vv={}));var rb;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rb||(rb={}));var jS;(function(e){e.Partial="partial",e.Full="full"})(jS||(jS={}));const j1e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Np;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Np||(Np={}));var RS;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(RS||(RS={}));var sn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(sn||(sn={}));const PG={[sn.Left]:sn.Right,[sn.Right]:sn.Left,[sn.Top]:sn.Bottom,[sn.Bottom]:sn.Top};function R1e(e){return e===null?null:e?"valid":"invalid"}const I1e=e=>"id"in e&&"source"in e&&"target"in e,sJe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rB=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nE=(e,t=[0,0])=>{const{width:n,height:i}=Fh(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},aJe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let a=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(r):rB(r)?r:t.nodeLookup.get(r.id));const l=a?Z_(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return RR(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return IR(n)},iE=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=RR(n,Z_(r)),i=!0)}),i?IR(n):{x:0,y:0,width:0,height:0}},sB=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...$x(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=IS(l,qv(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},oJe=(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 lJe(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 cJe({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=lJe(e,a),c=iE(l),u=oB(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await i.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function P1e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??i;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)s==null||s("005",Fu.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Sb(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=Sb(f)?Ob(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Fu.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function uJe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&a.find(b=>b.id===h.parentId);(m||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=oJe(a,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Hv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ob=(e={x:0,y:0},t,n)=>({x:Hv(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hv(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function D1e(e,t,n){const{width:i,height:r}=Fh(n),{x:s,y:a}=n.internals.positionAbsolute;return Ob(e,[[s,a],[s+i,a+r]],t)}const DG=(e,t,n)=>en?-Hv(Math.abs(e-n),1,t)/t:0,aB=(e,t,n=15,i=40)=>{const r=DG(e.x,i,t.width-i)*n,s=DG(e.y,i,t.height-i)*n;return[r,s]},RR=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),l6=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),IR=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),qv=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=rB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Z_=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=rB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},M1e=(e,t)=>IR(RR(l6(e),l6(t))),IS=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},MG=e=>Au(e.width)&&Au(e.height)&&Au(e.x)&&Au(e.y),Au=e=>!isNaN(e)&&isFinite(e),L1e=(e,t)=>(n,i)=>{},rE=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$x=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?rE(l,a):l},Wv=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function M0(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function dJe(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=M0(e,n),r=M0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=M0(e.top??e.y??0,n),r=M0(e.bottom??e.y??0,n),s=M0(e.left??e.x??0,t),a=M0(e.right??e.x??0,t);return{top:i,right:a,bottom:r,left:s,x:s+a,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fJe(e,t,n,i,r,s){const{x:a,y:l}=Wv(e,[t,n,i]),{x:c,y:u}=Wv({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const oB=(e,t,n,i,r,s)=>{const a=dJe(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Hv(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=fJe(e,m,g,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},PS=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sb(e){return e!=null&&e!=="parent"}function Fh(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function lB(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 $1e(e,t={width:0,height:0},n,i,r){const s={...e},a=i.get(n);if(a){const l=a.origin||r;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function LG(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hJe(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function pJe(e){return{...N1e,...e||{}}}function SO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=_u(e),l=$x({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?rE(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const cB=e=>({width:e.offsetWidth,height:e.offsetHeight}),F1e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},mJe=["INPUT","SELECT","TEXTAREA"];function B1e(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:mJe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const U1e=e=>"clientX"in e,_u=(e,t)=>{var s,a;const n=U1e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},$G=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...cB(a)}})};function Q1e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function FG({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case sn.Left:return[t-gT(t-i,s),n];case sn.Right:return[t+gT(i-t,s),n];case sn.Top:return[t,n-gT(n-r,s)];case sn.Bottom:return[t,n+gT(r-n,s)]}}function z1e({sourceX:e,sourceY:t,sourcePosition:n=sn.Bottom,targetX:i,targetY:r,targetPosition:s=sn.Top,curvature:a=.25}){const[l,c]=FG({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=FG({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,m,g]=Q1e({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 V1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const yJe=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,vJe=(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)),xJe=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Fu.error006()),t;const i=n.getEdgeId||yJe;let r;return I1e(e)?r={...e}:r={...e,id:i(e)},vJe(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function H1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=V1e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const BG={[sn.Left]:{x:-1,y:0},[sn.Right]:{x:1,y:0},[sn.Top]:{x:0,y:-1},[sn.Bottom]:{x:0,y:1}},wJe=({source:e,sourcePosition:t=sn.Bottom,target:n})=>t===sn.Left||t===sn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function OJe({source:e,sourcePosition:t=sn.Bottom,target:n,targetPosition:i=sn.Top,center:r,offset:s,stepPosition:a}){const l=BG[t],c=BG[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=wJe({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},x={x:0,y:0},[,,O,w]=V1e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*a,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*a);const C=[{x:b,y:u.y},{x:b,y:d.y}],N=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?C:N:g=h==="x"?N:C}else{const C=[{x:u.x,y:d.y}],N=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?N:C:g=l.y===m?C:N,t===i){const T=Math.abs(e[h]-n[h]);if(T<=s){const P=Math.min(s-1,s-T);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*P:x[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const T=h==="x"?"y":"x",P=l[h]===c[T],R=u[T]>d[T],L=u[T]=F?(b=(_.x+j.x)/2,v=g[0].y):(b=g[0].x,v=(_.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,O,w]}function SJe(e,t,n,i){const r=Math.min(UG(e,t)/2,UG(t,n)/2,i),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function c6(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function EJe(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=c6(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const q1e=1e3,CJe=10,uB={nodeOrigin:[0,0],nodeExtent:NS,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},TJe={...uB,checkEquality:!0};function dB(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function AJe(e,t,n){const i=dB(uB,n);for(const r of e.values())if(r.parentId)hB(r,e,t,i);else{const s=nE(r,i.nodeOrigin),a=Sb(r.extent)?r.extent:i.nodeExtent,l=Ob(s,a,Fh(r));r.internals.positionAbsolute=l}}function _Je(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 fB(e){return e==="manual"}function u6(e,t,n,i={}){var d,f;const r=dB(TJe,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!fB(r.zIndexMode)?q1e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=a.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=nE(h,r.nodeOrigin),b=Sb(h.extent)?h.extent:r.nodeExtent,v=Ob(g,b,Fh(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:_Je(h,m),z:W1e(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&&hB(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function NJe(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 hB(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=dB(uB,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}NJe(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*CJe),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!fB(c)?q1e:0,{x:h,y:m,z:g}=jJe(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function W1e(e,t,n){const i=Au(e.zIndex)?e.zIndex:0;return fB(n)?i:i+(e.selected?t:0)}function jJe(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Fh(e),u=nE(e,n),d=Sb(e.extent)?Ob(u,e.extent,c):u;let f=Ob({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=D1e(f,c,t));const h=W1e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function pB(e,t,n,i=[0,0]){var a;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=s.get(l.parentId))==null?void 0:a.expandedRect)??qv(c),d=M1e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var O;const d=c.internals.positionAbsolute,f=Fh(c),h=c.origin??i,m=l.x0||g>0||y||x)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+x}}),(O=n.get(u))==null||O.forEach(w=>{e.some(k=>k.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+m,y:w.position.y+g}})})),(f.width0){const m=pB(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function IJe({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function HG(e,t,n,i,r,s){let a=r;const l=i.get(a)||new Map;i.set(a,l.set(n,t)),a=`${r}-${e}`;const c=i.get(a)||new Map;if(i.set(a,c.set(n,t)),s){a=`${r}-${e}-${s}`;const u=i.get(a)||new Map;i.set(a,u.set(n,t))}}function G1e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:a=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${s}-${l}`,d=`${s}-${l}--${r}-${a}`;HG("source",c,d,e,r,a),HG("target",c,u,e,s,l),t.set(i.id,i)}}function K1e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:K1e(n,t):!1}function qG(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 PJe(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!K1e(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function iM({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function DJe({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},a=rE(s,t);return{x:a.x-s.x,y:a.y-s.y}}function MJe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:x,handleSelector:O,domNode:w,isSelectable:k,nodeId:S,nodeClickDistance:E=0}){h=Yl(w);function C({x:A,y:F}){const{nodeLookup:T,nodeExtent:P,snapGrid:R,snapToGrid:L,nodeOrigin:M,onNodeDrag:U,onSelectionDrag:I,onError:H,updateNodePositions:K}=t();s={x:A,y:F};let Q=!1;const q=l.size>1,B=q&&P?l6(iE(l)):null,ee=q&&L?DJe({dragItems:l,snapGrid:R,x:A,y:F}):null;for(const[le,se]of l){if(!T.has(le))continue;let re={x:A-se.distance.x,y:F-se.distance.y};L&&(re=ee?{x:Math.round(re.x+ee.x),y:Math.round(re.y+ee.y)}:rE(re,R));let ge=null;if(q&&P&&!se.extent&&B){const{positionAbsolute:ae}=se.internals,ue=ae.x-B.x+P[0][0],Oe=ae.x+se.measured.width-B.x2+P[1][0],ke=ae.y-B.y+P[0][1],st=ae.y+se.measured.height-B.y2+P[1][1];ge=[[ue,ke],[Oe,st]]}const{position:W,positionAbsolute:X}=P1e({nodeId:le,nextPosition:re,nodeLookup:T,nodeExtent:ge||P,nodeOrigin:M,onError:H});Q=Q||se.position.x!==W.x||se.position.y!==W.y,se.position=W,se.internals.positionAbsolute=X}if(g=g||Q,!!Q&&(K(l,!0),b&&(i||U||!S&&I))){const[le,se]=iM({nodeId:S,dragItems:l,nodeLookup:T});i==null||i(b,l,le,se),U==null||U(b,le,se),S||I==null||I(b,se)}}async function N(){if(!d)return;const{transform:A,panBy:F,autoPanSpeed:T,autoPanOnNodeDrag:P}=t();if(!P){c=!1,cancelAnimationFrame(a);return}const[R,L]=aB(u,d,T);(R!==0||L!==0)&&(s.x=(s.x??0)-R/A[2],s.y=(s.y??0)-L/A[2],await F({x:R,y:L})&&C(s)),a=requestAnimationFrame(N)}function _(A){var q;const{nodeLookup:F,multiSelectionActive:T,nodesDraggable:P,transform:R,snapGrid:L,snapToGrid:M,selectNodesOnDrag:U,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:K}=t();f=!0,(!U||!k)&&!T&&S&&((q=F.get(S))!=null&&q.selected||K()),k&&U&&S&&(e==null||e(S));const Q=SO(A.sourceEvent,{transform:R,snapGrid:L,snapToGrid:M,containerBounds:d});if(s=Q,l=PJe(F,P,Q,S),l.size>0&&(n||I||!S&&H)){const[B,ee]=iM({nodeId:S,dragItems:l,nodeLookup:F});n==null||n(A.sourceEvent,l,B,ee),I==null||I(A.sourceEvent,B,ee),S||H==null||H(A.sourceEvent,ee)}}const j=f1e().clickDistance(E).on("start",A=>{const{domNode:F,nodeDragThreshold:T,transform:P,snapGrid:R,snapToGrid:L}=t();d=(F==null?void 0:F.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,T===0&&_(A),s=SO(A.sourceEvent,{transform:P,snapGrid:R,snapToGrid:L,containerBounds:d}),u=_u(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:F,transform:T,snapGrid:P,snapToGrid:R,nodeDragThreshold:L,nodeLookup:M}=t(),U=SO(A.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!M.has(S))&&(m=!0),!m){if(!c&&F&&f&&(c=!0,N()),!f){const I=_u(A.sourceEvent,d),H=I.x-u.x,K=I.y-u.y;Math.sqrt(H*H+K*K)>L&&_(A)}(s.x!==U.xSnapped||s.y!==U.ySnapped)&&l&&f&&(u=_u(A.sourceEvent,d),C(U))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:F,updateNodePositions:T,onNodeDragStop:P,onSelectionDragStop:R}=t();if(g&&(T(l,!1),g=!1),r||P||!S&&R){const[L,M]=iM({nodeId:S,dragItems:l,nodeLookup:F,dragging:!1});r==null||r(A.sourceEvent,l,L,M),P==null||P(A.sourceEvent,L,M),S||R==null||R(A.sourceEvent,M)}}}).filter(A=>{const F=A.target;return!A.button&&(!x||!qG(F,`.${x}`,w))&&(!O||qG(F,O,w))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function LJe(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())IS(r,qv(s))>0&&i.push(s);return i}const $Je=250;function FJe(e,t,n,i){var l,c;let r=[],s=1/0;const a=LJe(e,n,t+$Je);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=kb(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 X1e(e,t,n,i,r,s=!1){var u,d,f;const a=i.get(e);if(!a)return null;const l=r==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...kb(a,c,c.position,!0)}:c}function Y1e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function BJe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Z1e=()=>!0;function UJe(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=Z1e,onReconnectEnd:x,updateConnection:O,getTransform:w,getFromHandle:k,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:C}){const N=F1e(e.target);let _=0,j;const{x:A,y:F}=_u(e),T=Y1e(s,C),P=l==null?void 0:l.getBoundingClientRect();let R=!1;if(!P||!T)return;const L=X1e(r,T,i,c,t);if(!L)return;let M=_u(e,P),U=!1,I=null,H=!1,K=null;function Q(){if(!d||!P)return;const[W,X]=aB(M,P,S);h({x:W,y:X}),_=requestAnimationFrame(Q)}const q={...L,nodeId:r,type:T,position:L.position},B=c.get(r);let le={inProgress:!0,isValid:null,from:kb(B,q,sn.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:B,to:M,toHandle:null,toPosition:PG[q.position],toNode:null,pointer:M};function se(){R=!0,O(le),g==null||g(e,{nodeId:r,handleId:i,handleType:T})}E===0&&se();function re(W){if(!R){const{x:st,y:Le}=_u(W),Me=st-A,Ie=Le-F;if(!(Me*Me+Ie*Ie>E*E))return;se()}if(!k()||!q){ge(W);return}const X=w();M=_u(W,P),j=FJe($x(M,X,!1,[1,1]),n,c,q),U||(Q(),U=!0);const ae=J1e(W,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:u,flowId:f,nodeLookup:c});K=ae.handleDomNode,I=ae.connection,H=BJe(!!j,ae.isValid);const ue=c.get(r),Oe=ue?kb(ue,q,sn.Left,!0):le.from,ke={...le,from:Oe,isValid:H,to:ae.toHandle&&H?Wv({x:ae.toHandle.x,y:ae.toHandle.y},X):M,toHandle:ae.toHandle,toPosition:H&&ae.toHandle?ae.toHandle.position:PG[q.position],toNode:ae.toHandle?c.get(ae.toHandle.nodeId):null,pointer:M};O(ke),le=ke}function ge(W){if(!("touches"in W&&W.touches.length>0)){if(R){(j||K)&&I&&H&&(b==null||b(I));const{inProgress:X,...ae}=le,ue={...ae,toPosition:le.toHandle?le.toPosition:null};v==null||v(W,ue),s&&(x==null||x(W,ue))}m(),cancelAnimationFrame(_),U=!1,H=!1,I=null,K=null,N.removeEventListener("mousemove",re),N.removeEventListener("mouseup",ge),N.removeEventListener("touchmove",re),N.removeEventListener("touchend",ge)}}N.addEventListener("mousemove",re),N.addEventListener("mouseup",ge),N.addEventListener("touchmove",re),N.addEventListener("touchend",ge)}function J1e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=Z1e,nodeLookup:d}){const f=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=_u(e),b=a.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=Y1e(void 0,v),O=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!O||!x)return y;const E={source:f?O:i,sourceHandle:f?w:r,target:f?i:O,targetHandle:f?r:w};y.connection=E;const N=k&&S&&(n===Vv.Strict?f&&x==="source"||!f&&x==="target":O!==i||w!==r);y.isValid=N&&u(E),y.toHandle=X1e(O,x,w,d,n,!0)}return y}const d6={onPointerDown:UJe,isValid:J1e};function QJe({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Yl(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=O=>{if(O.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=O.sourceEvent.ctrlKey&&PS()?10:1,S=-O.sourceEvent.deltaY*(O.sourceEvent.deltaMode===1?.05:O.sourceEvent.deltaMode?1:.002)*d,E=w[2]*Math.pow(2,S*k);t.scaleTo(E)};let b=[0,0];const v=O=>{(O.sourceEvent.type==="mousedown"||O.sourceEvent.type==="touchstart")&&(b=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY])},y=O=>{const w=n();if(O.sourceEvent.type!=="mousemove"&&O.sourceEvent.type!=="touchmove"||!t)return;const k=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const E=i()*Math.max(w[2],Math.log(w[2]))*(m?-1:1),C={x:w[0]-S[0]*E,y:w[1]-S[1]*E},N=[[0,0],[c,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},N,l)},x=A1e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(x,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:Ou}}const PR=e=>({x:e.x,y:e.y,zoom:e.k}),rM=({x:e,y:t,zoom:n})=>jR.translate(e,t).scale(n),Ay=(e,t)=>e.target.closest(`.${t}`),ewe=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),zJe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sM=(e,t=0,n=zJe,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},twe=e=>{const t=e.ctrlKey&&PS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function VJe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ay(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=Ou(d),y=twe(d),x=f*Math.pow(2,y);i.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let m=r===rb.Vertical?0:d.deltaX*h,g=r===rb.Horizontal?0:d.deltaY*h;!PS()&&d.shiftKey&&r!==rb.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=PR(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function HJe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Ay(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function qJe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=PR(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function WJe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&ewe(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,PR(s.transform)))}}function GJe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&ewe(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=PR(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function KJe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ay(f,`${u}-flow__node`)||Ay(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Ay(f,l)&&g||Ay(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!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 XJe({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=A1e().scaleExtent([t,n]).translateExtent(i),h=Yl(e).call(f);x({x:r.x,y:r.y,zoom:Hv(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(twe);async function b(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).transform(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function v({noWheelClassName:j,noPanClassName:A,onPaneContextMenu:F,userSelectionActive:T,panOnScroll:P,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:U,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:Q,lib:q,onTransformChange:B,connectionInProgress:ee,paneClickDistance:le,selectionOnDrag:se}){T&&!u.isZoomingOrPanning&&y();const re=P&&!Q&&!T;f.clickDistance(se?1/0:!Au(le)||le<0?0:le);const ge=re?VJe({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):HJe({noWheelClassName:j,preventScrolling:U,d3ZoomHandler:m});h.on("wheel.zoom",ge,{passive:!1});const W=qJe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",W);const X=WJe({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:B});f.on("zoom",X);const ae=GJe({zoomPanValues:u,panOnDrag:R,panOnScroll:P,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:c});f.on("end",ae);const ue=KJe({zoomActivationKeyPressed:Q,panOnDrag:R,zoomOnScroll:H,panOnScroll:P,zoomOnDoubleClick:K,zoomOnPinch:I,userSelectionActive:T,noPanClassName:A,noWheelClassName:j,lib:q,connectionInProgress:ee});f.filter(ue),K?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(j,A,F){const T=rM(j),P=f==null?void 0:f.constrain()(T,A,F);return P&&await b(P),P}async function O(j,A){const F=rM(j);return await b(F,A),F}function w(j){if(h){const A=rM(j),F=h.property("__zoom");(F.k!==j.zoom||F.x!==j.x||F.y!==j.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const j=h?T1e(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function S(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleTo(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}async function E(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleBy(sM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function C(j){f==null||f.scaleExtent(j)}function N(j){f==null||f.translateExtent(j)}function _(j){const A=!Au(j)||j<0?0:j;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:O,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:E,setScaleExtent:C,setTranslateExtent:N,syncViewport:w,setClickDistance:_}}var Gv;(function(e){e.Line="line",e.Handle="handle"})(Gv||(Gv={}));function YJe({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const a=e-t,l=n-i,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function WG(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function lp(e,t){return Math.max(0,t-e)}function cp(e,t){return Math.max(0,e-t)}function bT(e,t,n){return Math.max(0,t-e,e-n)}function GG(e,t){return e?!t:t}function ZJe(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=i,{x:O,y:w,width:k,height:S,aspectRatio:E}=e;let C=Math.floor(d?m-e.pointerX:0),N=Math.floor(f?g-e.pointerY:0);const _=k+(c?-C:C),j=S+(u?-N:N),A=-s[0]*k,F=-s[1]*S;let T=bT(_,b,v),P=bT(j,y,x);if(a){let M=0,U=0;c&&C<0?M=lp(O+C+A,a[0][0]):!c&&C>0&&(M=cp(O+_+A,a[1][0])),u&&N<0?U=lp(w+N+F,a[0][1]):!u&&N>0&&(U=cp(w+j+F,a[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(l){let M=0,U=0;c&&C>0?M=cp(O+C,l[0][0]):!c&&C<0&&(M=lp(O+_,l[1][0])),u&&N>0?U=cp(w+N,l[0][1]):!u&&N<0&&(U=lp(w+j,l[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(r){if(d){const M=bT(_/E,y,x)*E;if(T=Math.max(T,M),a){let U=0;!c&&!u||c&&!u&&h?U=cp(w+F+_/E,a[1][1])*E:U=lp(w+F+(c?C:-C)/E,a[0][1])*E,T=Math.max(T,U)}if(l){let U=0;!c&&!u||c&&!u&&h?U=lp(w+_/E,l[1][1])*E:U=cp(w+(c?C:-C)/E,l[0][1])*E,T=Math.max(T,U)}}if(f){const M=bT(j*E,b,v)/E;if(P=Math.max(P,M),a){let U=0;!c&&!u||u&&!c&&h?U=cp(O+j*E+A,a[1][0])/E:U=lp(O+(u?N:-N)*E+A,a[0][0])/E,P=Math.max(P,U)}if(l){let U=0;!c&&!u||u&&!c&&h?U=lp(O+j*E,l[1][0])/E:U=cp(O+(u?N:-N)*E,l[0][0])/E,P=Math.max(P,U)}}}N=N+(N<0?P:-P),C=C+(C<0?T:-T),r&&(h?_>j*E?N=(GG(c,u)?-C:C)/E:C=(GG(c,u)?-N:N)*E:d?(N=C/E,u=c):(C=N*E,c=u));const R=c?O+C:O,L=u?w+N:w;return{width:k+(c?-C:C),height:S+(u?-N:N),x:s[0]*C*(c?-1:1)+R,y:s[1]*N*(u?-1:1)+L}}const nwe={width:0,height:0,x:0,y:0},JJe={...nwe,pointerX:0,pointerY:0,aspectRatio:1};function eet(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[i-l,r-c],[i+s-l,r+a-c]]}function tet({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Yl(e);let a={controlDirection:WG("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={...nwe},x={...JJe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:WG(u)};let O,w=null,k=[],S,E,C,N=!1;const _=f1e().on("start",j=>{const{nodeLookup:A,transform:F,snapGrid:T,snapToGrid:P,nodeOrigin:R,paneDomNode:L}=n();if(O=A.get(t),!O)return;w=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:U}=SO(j.sourceEvent,{transform:F,snapGrid:T,snapToGrid:P,containerBounds:w});y={width:O.measured.width??0,height:O.measured.height??0,x:O.position.x??0,y:O.position.y??0},x={...y,pointerX:M,pointerY:U,aspectRatio:y.width/y.height},S=void 0,E=Sb(O.extent)?O.extent:void 0,O.parentId&&(O.extent==="parent"||O.expandParent)&&(S=A.get(O.parentId)),S&&O.extent==="parent"&&(E=[[0,0],[S.measured.width,S.measured.height]]),k=[],C=void 0;for(const[I,H]of A)if(H.parentId===t&&(k.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=eet(H,O,H.origin??R);C?C=[[Math.min(K[0][0],C[0][0]),Math.min(K[0][1],C[0][1])],[Math.max(K[1][0],C[1][0]),Math.max(K[1][1],C[1][1])]]:C=K}m==null||m(j,{...y})}).on("drag",j=>{const{transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P}=n(),R=SO(j.sourceEvent,{transform:A,snapGrid:F,snapToGrid:T,containerBounds:w}),L=[];if(!O)return;const{x:M,y:U,width:I,height:H}=y,K={},Q=O.origin??P,{width:q,height:B,x:ee,y:le}=ZJe(x,a.controlDirection,R,a.boundaries,a.keepAspectRatio,Q,E,C),se=q!==I,re=B!==H,ge=ee!==M&&se,W=le!==U&&re;if(!ge&&!W&&!se&&!re)return;if((ge||W||Q[0]===1||Q[1]===1)&&(K.x=ge?ee:y.x,K.y=W?le:y.y,y.x=K.x,y.y=K.y,k.length>0)){const Oe=ee-M,ke=le-U;for(const st of k)st.position={x:st.position.x-Oe+Q[0]*(q-I),y:st.position.y-ke+Q[1]*(B-H)},L.push(st)}if((se||re)&&(K.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,K.height=re&&(!a.resizeDirection||a.resizeDirection==="vertical")?B:y.height,y.width=K.width,y.height=K.height),S&&O.expandParent){const Oe=Q[0]*(K.width??0);K.x&&K.x{N&&(b==null||b(j,{...y}),r==null||r({...y}),N=!1)});s.call(_)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}var iwe={exports:{}},rwe={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -496,100 +496,100 @@ ${n}`}}async function*hBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follo * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var DR=p,tet=zfe;function net(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iet=typeof Object.is=="function"?Object.is:net,ret=tet.useSyncExternalStore,set=DR.useRef,aet=DR.useEffect,oet=DR.useMemo,cet=DR.useDebugValue;iwe.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=set(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=oet(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&a.hasValue){var g=a.value;if(r(g,m))return f=g}return f=m}if(g=f,iet(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=ret(e,s[0],s[1]);return aet(function(){a.hasValue=!0,a.value=l},[l]),cet(l),l};nwe.exports=iwe;var uet=nwe.exports;const det=px(uet),fet={},KG=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:()=>{(fet?"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},het=e=>e?KG(e):KG,{useDebugValue:pet}=ii,{useSyncExternalStoreWithSelector:met}=det,get=e=>e;function rwe(e,t=get,n){const i=met(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return pet(i),i}const XG=(e,t)=>{const n=het(e),i=(r,s=t)=>rwe(n,r,s);return Object.assign(i,n),i},bet=(e,t)=>e?XG(e,t):XG;function rs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const MR=p.createContext(null),yet=MR.Provider,swe=Fu.error001("react");function _i(e,t){const n=p.useContext(MR);if(n===null)throw new Error(swe);return rwe(n,e,t)}function ss(){const e=p.useContext(MR);if(e===null)throw new Error(swe);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const YG={display:"none"},vet={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},awe="react-flow__node-desc",owe="react-flow__edge-desc",xet="react-flow__aria-live",wet=e=>e.ariaLiveMessage,Oet=e=>e.ariaLabelConfig;function ket({rfId:e}){const t=_i(wet);return o.jsx("div",{id:`${xet}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vet,children:t})}function Eet({rfId:e,disableKeyboardA11y:t}){const n=_i(Oet);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${awe}-${e}`,style:YG,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${owe}-${e}`,style:YG,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(ket,{rfId:e})]})}const LR=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const a=`${e}`.split("-");return o.jsx("div",{className:ta(["react-flow__panel",n,...a]),style:i,ref:s,...r,children:t})});LR.displayName="Panel";function Cet({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(LR,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Tet=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}},yT=e=>e.id;function Aet(e,t){return rs(e.selectedNodes.map(yT),t.selectedNodes.map(yT))&&rs(e.selectedEdges.map(yT),t.selectedEdges.map(yT))}function _et({onSelectionChange:e}){const t=ss(),{selectedNodes:n,selectedEdges:i}=_i(Tet,Aet);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 Net=e=>!!e.onSelectionChangeHandlers;function jet({onSelectionChange:e}){const t=_i(Net);return e||t?o.jsx(_et,{onSelectionChange:e}):null}const lwe=[0,0],Ret={x:0,y:0,zoom:1},Iet=["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"],ZG=[...Iet,"rfId"],Pet=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}),JG={translateExtent:NS,nodeOrigin:lwe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Det(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=_i(Pet,rs),u=ss();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=JG,l()}),[]);const d=p.useRef(JG);return p.useEffect(()=>{for(const f of ZG){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:hJe(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},ZG.map(f=>e[f])),null}function eK(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Met(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=eK(),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=eK())!=null&&i.matches?"dark":"light"}const tK=typeof document<"u"?document:null;function DS(e=null,t={target:tK,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[a,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var DR=p,net=Vfe;function iet(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ret=typeof Object.is=="function"?Object.is:iet,set=net.useSyncExternalStore,aet=DR.useRef,oet=DR.useEffect,cet=DR.useMemo,uet=DR.useDebugValue;rwe.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=aet(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=cet(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&a.hasValue){var g=a.value;if(r(g,m))return f=g}return f=m}if(g=f,ret(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=set(e,s[0],s[1]);return oet(function(){a.hasValue=!0,a.value=l},[l]),uet(l),l};iwe.exports=rwe;var det=iwe.exports;const fet=px(det),het={},KG=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:()=>{(het?"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},pet=e=>e?KG(e):KG,{useDebugValue:met}=ii,{useSyncExternalStoreWithSelector:get}=fet,bet=e=>e;function swe(e,t=bet,n){const i=get(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return met(i),i}const XG=(e,t)=>{const n=pet(e),i=(r,s=t)=>swe(n,r,s);return Object.assign(i,n),i},yet=(e,t)=>e?XG(e,t):XG;function rs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const MR=p.createContext(null),vet=MR.Provider,awe=Fu.error001("react");function _i(e,t){const n=p.useContext(MR);if(n===null)throw new Error(awe);return swe(n,e,t)}function ss(){const e=p.useContext(MR);if(e===null)throw new Error(awe);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const YG={display:"none"},xet={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},owe="react-flow__node-desc",lwe="react-flow__edge-desc",wet="react-flow__aria-live",Oet=e=>e.ariaLiveMessage,ket=e=>e.ariaLabelConfig;function Eet({rfId:e}){const t=_i(Oet);return o.jsx("div",{id:`${wet}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xet,children:t})}function Cet({rfId:e,disableKeyboardA11y:t}){const n=_i(ket);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${owe}-${e}`,style:YG,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${lwe}-${e}`,style:YG,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Eet,{rfId:e})]})}const LR=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const a=`${e}`.split("-");return o.jsx("div",{className:ta(["react-flow__panel",n,...a]),style:i,ref:s,...r,children:t})});LR.displayName="Panel";function Tet({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(LR,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Aet=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}},yT=e=>e.id;function _et(e,t){return rs(e.selectedNodes.map(yT),t.selectedNodes.map(yT))&&rs(e.selectedEdges.map(yT),t.selectedEdges.map(yT))}function Net({onSelectionChange:e}){const t=ss(),{selectedNodes:n,selectedEdges:i}=_i(Aet,_et);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 jet=e=>!!e.onSelectionChangeHandlers;function Ret({onSelectionChange:e}){const t=_i(jet);return e||t?o.jsx(Net,{onSelectionChange:e}):null}const cwe=[0,0],Iet={x:0,y:0,zoom:1},Pet=["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"],ZG=[...Pet,"rfId"],Det=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}),JG={translateExtent:NS,nodeOrigin:cwe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Met(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=_i(Det,rs),u=ss();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=JG,l()}),[]);const d=p.useRef(JG);return p.useEffect(()=>{for(const f of ZG){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:pJe(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},ZG.map(f=>e[f])),null}function eK(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Let(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=eK(),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=eK())!=null&&i.matches?"dark":"light"}const tK=typeof document<"u"?document:null;function DS(e=null,t={target:tK,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[a,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??tK,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)&&F1e(m))return!1;const b=iK(m.code,l);if(s.current.add(m[b]),nK(a,s.current,!1)){const x=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,O=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(r.current||!O)&&m.preventDefault(),i(!0)}},f=m=>{const g=iK(m.code,l);nK(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function nK(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function iK(e,t){return t.includes(e)?"code":"key"}const Let=()=>{const e=ss();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=oB(t,i,r,s,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return $x(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),a=Wv(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function cwe(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const a=i.get(s.id);a?a.push(s):i.set(s.id,[s])}for(const s of t){const a=i.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const c of a)$et(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 $et(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 uwe(e,t){return cwe(e,t)}function dwe(e,t){return cwe(e,t)}function Og(e,t){return{id:e,type:"select",selected:t}}function _y(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const a=t.has(r);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),i.push(Og(s.id,a)))}return i}function rK({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function sK(e){return{id:e.id,type:"remove"}}const Fet=M1e();function Bet(e,t,n={}){return vJe(e,t,{...n,onError:n.onError??Fet})}const aK=e=>rJe(e),Uet=e=>R1e(e);function fwe(e){return p.forwardRef(e)}const Qet=typeof window<"u"?p.useLayoutEffect:p.useEffect;function oK(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>zet(()=>n(r=>r+BigInt(1))));return Qet(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function zet(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const hwe=p.createContext(null);function Vet({children:e}){const t=ss(),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=rK({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:x,setNodes:O}=t.getState();y&&O(x)})},[]),i=oK(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(rK({items:m,lookup:h}))},[]),s=oK(r),a=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(hwe.Provider,{value:a,children:e})}function Het(){const e=p.useContext(hwe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const qet=e=>!!e.panZoom;function $R(){const e=Let(),t=ss(),n=Het(),i=_i(qet),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=aK(f)?f:h.get(f.id),b=g.parentId?L1e(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:((x=g.measured)==null?void 0:x.height)??g.height};return qv(v)},u=(f,h,m={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&aK(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&&Uet(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:O,onBeforeDelete:w}=t.getState(),{nodes:k,edges:S}=await cJe({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:w}),E=S.length>0,C=k.length>0;if(E){const N=S.map(sK);v==null||v(S),x(N)}if(C){const N=k.map(sK);b==null||b(k),y(N)}return(C||E)&&(O==null||O({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=MG(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!g&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const O=qv(v?y:x),w=IS(O,b);return h&&w>0||w>=O.width*O.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=MG(f)?f:c(f);if(!b)return!1;const v=IS(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 sJe(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??fJe();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 lK=e=>e.selected,Wet=typeof window<"u"?window:void 0;function Get({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ss(),{deleteElements:i}=$R(),r=DS(e,{actInsideInputWithModifier:!1}),s=DS(t,{target:Wet});p.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(lK),edges:a.filter(lK)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Ket(e){const t=ss();p.useEffect(()=>{const n=()=>{var r,s,a,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=cB(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Fu.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const FR={position:"absolute",width:"100%",height:"100%",top:0,left:0},Xet=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Yet({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=rb.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:O,selectionOnDrag:w}){const k=ss(),S=p.useRef(null),{userSelectionActive:E,lib:C,connectionInProgress:N}=_i(Xet,rs),_=DS(h),j=p.useRef();Ket(S);const A=p.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||k.setState({transform:F})},[y,x]);return p.useEffect(()=>{if(S.current){j.current=KJe({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:R=>k.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:M,onMoveStart:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoom:(R,L)=>{const{onViewportChange:M,onMove:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:M,onMoveEnd:U}=k.getState();U==null||U(R,L),M==null||M(L)}});const{x:F,y:T,zoom:P}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[F,T,P],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=j.current)==null||R.destroy()}}},[]),p.useEffect(()=>{var F;(F=j.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:_,preventScrolling:m,noPanClassName:v,userSelectionActive:E,noWheelClassName:b,lib:C,onTransformChange:A,connectionInProgress:N,selectionOnDrag:w,paneClickDistance:O})},[e,t,n,i,r,s,a,l,_,m,v,E,b,C,A,N,w,O]),o.jsx("div",{className:"react-flow__renderer",ref:S,style:FR,children:g})}const Zet=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Jet(){const{userSelectionActive:e,userSelectionRect:t}=_i(Zet,rs);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const aM=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ett=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ttt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jS.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=ss(),{userSelectionActive:x,elementsSelectable:O,dragging:w,connectionInProgress:k,panBy:S,autoPanSpeed:E}=_i(ett,rs),C=O&&(e||x),N=p.useRef(null),_=p.useRef(),j=p.useRef(new Set),A=p.useRef(new Set),F=p.useRef(!1),T=p.useRef({x:0,y:0}),P=p.useRef(!1),R=se=>{if(F.current||k){F.current=!1;return}u==null||u(se),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},L=se=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){se.preventDefault();return}d==null||d(se)},M=f?se=>f(se):void 0,U=se=>{F.current&&(se.stopPropagation(),F.current=!1)},I=se=>{var st,Le;const{domNode:re,transform:ge}=y.getState();if(_.current=re==null?void 0:re.getBoundingClientRect(),!_.current)return;const W=se.target===N.current;if(!W&&!!se.target.closest(".nokey")||!e||!(a&&W||t)||se.button!==0||!se.isPrimary)return;(Le=(st=se.target)==null?void 0:st.setPointerCapture)==null||Le.call(st,se.pointerId),F.current=!1;const{x:ue,y:Oe}=_u(se.nativeEvent,_.current),ke=$x({x:ue,y:Oe},ge);y.setState({userSelectionRect:{width:0,height:0,startX:ke.x,startY:ke.y,x:ue,y:Oe}}),W||(se.stopPropagation(),se.preventDefault())};function H(se,re){const{userSelectionRect:ge}=y.getState();if(!ge)return;const{transform:W,nodeLookup:X,edgeLookup:ae,connectionLookup:ue,triggerNodeChanges:Oe,triggerEdgeChanges:ke,defaultEdgeOptions:st}=y.getState(),Le={x:ge.startX,y:ge.startY},{x:Me,y:Ie}=Wv(Le,W),qe={startX:Le.x,startY:Le.y,x:seDe.id)),A.current=new Set;const Ee=(st==null?void 0:st.selectable)??!0;for(const De of j.current){const J=ue.get(De);if(J)for(const{edgeId:he}of J.values()){const _e=ae.get(he);_e&&(_e.selectable??Ee)&&A.current.add(he)}}if(!LG(Ae,j.current)){const De=_y(X,j.current,!0);Oe(De)}if(!LG(ze,A.current)){const De=_y(ae,A.current);ke(De)}y.setState({userSelectionRect:qe,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!_.current)return;const[se,re]=aB(T.current,_.current,E);S({x:se,y:re}).then(ge=>{if(!F.current||!ge){v.current=requestAnimationFrame(K);return}const{x:W,y:X}=T.current;H(W,X),v.current=requestAnimationFrame(K)})}const Q=()=>{cancelAnimationFrame(v.current),v.current=0,P.current=!1};p.useEffect(()=>()=>Q(),[]);const q=se=>{const{userSelectionRect:re,transform:ge,resetSelectedElements:W}=y.getState();if(!_.current||!re)return;const{x:X,y:ae}=_u(se.nativeEvent,_.current);T.current={x:X,y:ae};const ue=Wv({x:re.startX,y:re.startY},ge);if(!F.current){const Oe=t?0:s;if(Math.hypot(X-ue.x,ae-ue.y)<=Oe)return;W(),l==null||l(se)}F.current=!0,P.current||(K(),P.current=!0),H(X,ae)},B=se=>{var re,ge;se.button===0&&((ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),!x&&se.target===N.current&&y.getState().userSelectionRect&&(R==null||R(se)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(se),y.setState({nodesSelectionActive:j.current.size>0})),Q())},ee=se=>{var re,ge;(ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),Q()},le=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:ta(["react-flow__pane",{draggable:le,dragging:w,selection:e}]),onClick:C?void 0:aM(R,N),onContextMenu:aM(L,N),onWheel:aM(M,N),onPointerEnter:C?void 0:h,onPointerMove:C?q:m,onPointerUp:C?B:void 0,onPointerCancel:C?ee:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?U:void 0,onPointerLeave:g,ref:N,style:FR,children:[b,o.jsx(Jet,{})]})}function f6({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fu.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function pwe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=ss(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=DJe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{f6({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,a]),c}const ntt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function mwe(){const e=ss();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=ntt(a),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(x=rE(x,s));const{position:O,positionAbsolute:w}=I1e({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=O,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const mB=p.createContext(null),itt=mB.Provider;mB.Consumer;const gwe=()=>p.useContext(mB),rtt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),stt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:a}=i,{fromHandle:l,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===Vv.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function att({type:e="source",position:t=sn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var P,R;const g=a||null,b=e==="target",v=ss(),y=gwe(),{connectOnClick:x,noPanClassName:O,rfId:w}=_i(rtt,rs),{connectingFrom:k,connectingTo:S,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:N,clickConnectionInProcess:_,valid:j}=_i(stt(y,g,e),rs);y||(R=(P=v.getState()).onError)==null||R.call(P,"010",Fu.error010());const A=L=>{const{defaultEdgeOptions:M,onConnect:U,hasDefaultEdges:I}=v.getState(),H={...M,...L};if(I){const{edges:K,setEdges:Q,onError:q}=v.getState();Q(Bet(H,K,{onError:q}))}U==null||U(H),l==null||l(H)},F=L=>{if(!y)return;const M=B1e(L.nativeEvent);if(r&&(M&&L.button===0||!M)){const U=v.getState();d6.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:b,handleId:g,nodeId:y,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...I)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...I)},updateConnection:U.updateConnection,onConnect:A,isValidConnection:n||((...I)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...I))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}M?d==null||d(L):f==null||f(L)},T=L=>{const{onClickConnectStart:M,onClickConnectEnd:U,connectionClickStartHandle:I,connectionMode:H,isValidConnection:K,lib:Q,rfId:q,nodeLookup:B,connection:ee}=v.getState();if(!y||!I&&!r)return;if(!I){M==null||M(L.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const le=$1e(L.target),se=n||K,{connection:re,isValid:ge}=d6.isValid(L.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:se,flowId:q,doc:le,lib:Q,nodeLookup:B});ge&&re&&A(re);const W=structuredClone(ee);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,U==null||U(L,W),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${g}-${e}`,className:ta(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",O,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:S,valid:j,connectionindicator:i&&(!N||C)&&(N||_?s:r)}]),onMouseDown:F,onTouchStart:F,onClick:x?T:void 0,ref:m,...h,children:c})}const fl=p.memo(fwe(att));function ott({data:e,isConnectable:t,sourcePosition:n=sn.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function ltt({data:e,isConnectable:t,targetPosition:n=sn.Top,sourcePosition:i=sn.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(fl,{type:"source",position:i,isConnectable:t})]})}function ctt(){return null}function utt({data:e,isConnectable:t,targetPosition:n=sn.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const eN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cK={input:ott,default:ltt,output:utt,group:ctt};function dtt(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 ftt=e=>{const{width:t,height:n,x:i,y:r}=iE(e.nodeLookup,{filter:s=>!!s.selected});return{width:Au(t)?t:null,height:Au(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function htt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ss(),{width:r,height:s,transformString:a,userSelectionActive:l}=_i(ftt,rs),c=mwe(),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(pwe({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(eN,m.key)&&(m.preventDefault(),c({direction:eN[m.key],factor:m.shiftKey?4:1}))};return o.jsx("div",{className:ta(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const uK=typeof window<"u"?window:void 0,ptt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function bwe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:C,autoPanOnSelection:N,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,preventScrolling:T,onSelectionContextMenu:P,noWheelClassName:R,noPanClassName:L,disableKeyboardA11y:M,onViewportChange:U,isControlledViewport:I}){const{nodesSelectionActive:H,userSelectionActive:K}=_i(ptt,rs),Q=DS(u,{target:uK}),q=DS(b,{target:uK}),B=q||C,ee=q||w,le=d&&B!==!0,se=Q||K||le;return Get({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(Yet,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:ee,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!Q&&B,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:R,noPanClassName:L,onViewportChange:U,isControlledViewport:I,paneClickDistance:l,selectionOnDrag:le,children:o.jsxs(ttt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!se,selectionMode:f,selectionKeyPressed:Q,paneClickDistance:l,selectionOnDrag:le,children:[e,H&&o.jsx(htt,{onSelectionContextMenu:P,noPanClassName:L,disableKeyboardA11y:M})]})})}bwe.displayName="FlowRenderer";const mtt=p.memo(bwe),gtt=e=>t=>e?sB(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 btt(e){return _i(p.useCallback(gtt(e),[e]),rs)}const ytt=e=>e.updateNodeInternals;function vtt(){const e=_i(ytt),[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 xtt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=ss(),s=p.useRef(null),a=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(s.current),a.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function wtt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:O,internals:w,isParent:k}=_i(se=>{const re=se.nodeLookup.get(e),ge=se.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ge}},rs);let S=O.type||"default",E=(v==null?void 0:v[S])||cK[S];E===void 0&&(x==null||x("003",Fu.error003(S)),S="default",E=(v==null?void 0:v.default)||cK.default);const C=!!(O.draggable||l&&typeof O.draggable>"u"),N=!!(O.selectable||c&&typeof O.selectable>"u"),_=!!(O.connectable||u&&typeof O.connectable>"u"),j=!!(O.focusable||d&&typeof O.focusable>"u"),A=ss(),F=lB(O),T=xtt({node:O,nodeType:S,hasDimensions:F,resizeObserver:f}),P=pwe({nodeRef:T,disabled:O.hidden||!C,noDragClassName:h,handleSelector:O.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:y}),R=mwe();if(O.hidden)return null;const L=Fh(O),M=dtt(O),U=N||C||t||n||i||r,I=n?se=>n(se,{...w.userNode}):void 0,H=i?se=>i(se,{...w.userNode}):void 0,K=r?se=>r(se,{...w.userNode}):void 0,Q=s?se=>s(se,{...w.userNode}):void 0,q=a?se=>a(se,{...w.userNode}):void 0,B=se=>{const{selectNodesOnDrag:re,nodeDragThreshold:ge}=A.getState();N&&(!re||!C||ge>0)&&f6({id:e,store:A,nodeRef:T}),t&&t(se,{...w.userNode})},ee=se=>{if(!(F1e(se.nativeEvent)||g)){if(A1e.includes(se.key)&&N){const re=se.key==="Escape";f6({id:e,store:A,unselect:re,nodeRef:T})}else if(C&&O.selected&&Object.prototype.hasOwnProperty.call(eN,se.key)){se.preventDefault();const{ariaLabelConfig:re}=A.getState();A.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),R({direction:eN[se.key],factor:se.shiftKey?4:1})}}},le=()=>{var ue;if(g||!((ue=T.current)!=null&&ue.matches(":focus-visible")))return;const{transform:se,width:re,height:ge,autoPanOnNodeFocus:W,setCenter:X}=A.getState();if(!W)return;sB(new Map([[e,O]]),{x:0,y:0,width:re,height:ge},se,!0).length>0||X(O.position.x+L.width/2,O.position.y+L.height/2,{zoom:se[2]})};return o.jsx("div",{className:ta(["react-flow__node",`react-flow__node-${S}`,{[m]:C},O.className,{selected:O.selected,selectable:N,parent:k,draggable:C,dragging:P}]),ref:T,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:F?"visible":"hidden",...O.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:K,onContextMenu:Q,onClick:B,onDoubleClick:q,onKeyDown:j?ee:void 0,tabIndex:j?0:void 0,onFocus:j?le:void 0,role:O.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${awe}-${b}`,"aria-label":O.ariaLabel,...O.domAttributes,children:o.jsx(itt,{value:e,children:o.jsx(E,{id:e,data:O.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:O.selected??!1,selectable:N,draggable:C,deletable:O.deletable??!0,isConnectable:_,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:P,dragHandle:O.dragHandle,zIndex:w.z,parentId:O.parentId,...L})})})}var Ott=p.memo(wtt);const Stt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ywe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=_i(Stt,rs),a=btt(e.onlyRenderVisibleElements),l=vtt();return o.jsx("div",{className:"react-flow__nodes",style:FR,children:a.map(c=>o.jsx(Ott,{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))})}ywe.displayName="NodeRenderer";const ktt=p.memo(ywe);function Ett(e){return _i(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);s&&a&&gJe({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),rs)}const Ctt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Ttt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},dK={[RS.Arrow]:Ctt,[RS.ArrowClosed]:Ttt};function Att(e){const t=ss();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(dK,e)?dK[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Fu.error009(e)),null)},[e])}const _tt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Att(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},vwe=({defaultColor:e,rfId:t})=>{const n=_i(s=>s.edges),i=_i(s=>s.defaultEdgeOptions),r=p.useMemo(()=>kJe(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(s=>o.jsx(_tt,{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};vwe.displayName="MarkerDefinitions";var Ntt=p.memo(vwe);function xwe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=ta(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}xwe.displayName="EdgeText";const jtt=p.memo(xwe);function sE({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:ta(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&Au(t)&&Au(n)?o.jsx(jtt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function fK({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===sn.Left||e===sn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function wwe({sourceX:e,sourceY:t,sourcePosition:n=sn.Bottom,targetX:i,targetY:r,targetPosition:s=sn.Top}){const[a,l]=fK({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=fK({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=U1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function Owe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,O,w]=wwe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(sE,{id:k,path:x,labelX:O,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const Rtt=Owe({isInternal:!1}),Swe=Owe({isInternal:!0});Rtt.displayName="SimpleBezierEdge";Swe.displayName="SimpleBezierEdgeInternal";function kwe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=sn.Bottom,targetPosition:g=sn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=J_({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 o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const Ewe=kwe({isInternal:!1}),Cwe=kwe({isInternal:!0});Ewe.displayName="SmoothStepEdge";Cwe.displayName="SmoothStepEdgeInternal";function Twe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(Ewe,{...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 Itt=Twe({isInternal:!1}),Awe=Twe({isInternal:!0});Itt.displayName="StepEdge";Awe.displayName="StepEdgeInternal";function _we(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,x]=V1e({sourceX:n,sourceY:i,targetX:r,targetY:s}),O=e.isInternal?void 0:t;return o.jsx(sE,{id:O,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const Ptt=_we({isInternal:!1}),Nwe=_we({isInternal:!0});Ptt.displayName="StraightEdge";Nwe.displayName="StraightEdgeInternal";function jwe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=sn.Bottom,targetPosition:l=sn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=Q1e({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:x})})}const Dtt=jwe({isInternal:!1}),Rwe=jwe({isInternal:!0});Dtt.displayName="BezierEdge";Rwe.displayName="BezierEdgeInternal";const hK={default:Rwe,straight:Nwe,step:Awe,smoothstep:Cwe,simplebezier:Swe},pK={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Mtt=(e,t,n)=>n===sn.Left?e-t:n===sn.Right?e+t:e,Ltt=(e,t,n)=>n===sn.Top?e-t:n===sn.Bottom?e+t:e,mK="react-flow__edgeupdater";function gK({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:a,className:ta([mK,`${mK}-${l}`]),cx:Mtt(t,i,e),cy:Ltt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function $tt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=ss(),b=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:C,connectionRadius:N,lib:_,onConnectStart:j,cancelConnection:A,nodeLookup:F,rfId:T,panBy:P,updateConnection:R}=g.getState(),L=k.type==="target",M=(H,K)=>{h(!1),f==null||f(H,n,k.type,K)},U=H=>u==null?void 0:u(n,H),I=(H,K)=>{h(!0),d==null||d(w,n,k.type),j==null||j(H,K)};d6.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:N,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:F,isTarget:L,edgeUpdaterType:k.type,lib:_,flowId:T,cancelConnection:A,panBy:P,isValidConnection:(...H)=>{var K,Q;return((Q=(K=g.getState()).isValidConnection)==null?void 0:Q.call(K,...H))??!0},onConnect:U,onConnectStart:I,onConnectEnd:(...H)=>{var K,Q;return(Q=(K=g.getState()).onConnectEnd)==null?void 0:Q.call(K,...H)},onReconnectEnd:M,updateConnection:R,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>m(!0),O=()=>m(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(gK,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:O,type:"source"}),(e===!0||e==="target")&&o.jsx(gK,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:O,type:"target"})]})}function Ftt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let O=_i(X=>X.edgeLookup.get(e));const w=_i(X=>X.defaultEdgeOptions);O=w?{...w,...O}:O;let k=O.type||"default",S=(b==null?void 0:b[k])||hK[k];S===void 0&&(y==null||y("011",Fu.error011(k)),k="default",S=(b==null?void 0:b.default)||hK.default);const E=!!(O.focusable||t&&typeof O.focusable>"u"),C=typeof f<"u"&&(O.reconnectable||n&&typeof O.reconnectable>"u"),N=!!(O.selectable||i&&typeof O.selectable>"u"),_=p.useRef(null),[j,A]=p.useState(!1),[F,T]=p.useState(!1),P=ss(),{zIndex:R,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K}=_i(p.useCallback(X=>{const ae=X.nodeLookup.get(O.source),ue=X.nodeLookup.get(O.target);if(!ae||!ue)return{zIndex:O.zIndex,...pK};const Oe=SJe({id:e,sourceNode:ae,targetNode:ue,sourceHandle:O.sourceHandle||null,targetHandle:O.targetHandle||null,connectionMode:X.connectionMode,onError:y});return{zIndex:mJe({selected:O.selected,zIndex:O.zIndex,sourceNode:ae,targetNode:ue,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode}),...Oe||pK}},[O.source,O.target,O.sourceHandle,O.targetHandle,O.selected,O.zIndex]),rs),Q=p.useMemo(()=>O.markerStart?`url('#${c6(O.markerStart,g)}')`:void 0,[O.markerStart,g]),q=p.useMemo(()=>O.markerEnd?`url('#${c6(O.markerEnd,g)}')`:void 0,[O.markerEnd,g]);if(O.hidden||L===null||M===null||U===null||I===null)return null;const B=X=>{var ke;const{addSelectedEdges:ae,unselectNodesAndEdges:ue,multiSelectionActive:Oe}=P.getState();N&&(P.setState({nodesSelectionActive:!1}),O.selected&&Oe?(ue({nodes:[],edges:[O]}),(ke=_.current)==null||ke.blur()):ae([e])),r&&r(X,O)},ee=s?X=>{s(X,{...O})}:void 0,le=a?X=>{a(X,{...O})}:void 0,se=l?X=>{l(X,{...O})}:void 0,re=c?X=>{c(X,{...O})}:void 0,ge=u?X=>{u(X,{...O})}:void 0,W=X=>{var ae;if(!x&&A1e.includes(X.key)&&N){const{unselectNodesAndEdges:ue,addSelectedEdges:Oe}=P.getState();X.key==="Escape"?((ae=_.current)==null||ae.blur(),ue({edges:[O]})):Oe([e])}};return o.jsx("svg",{style:{zIndex:R},children:o.jsxs("g",{className:ta(["react-flow__edge",`react-flow__edge-${k}`,O.className,v,{selected:O.selected,animated:O.animated,inactive:!N&&!r,updating:j,selectable:N}]),onClick:B,onDoubleClick:ee,onContextMenu:le,onMouseEnter:se,onMouseMove:re,onMouseLeave:ge,onKeyDown:E?W:void 0,tabIndex:E?0:void 0,role:O.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":O.ariaLabel===null?void 0:O.ariaLabel||`Edge from ${O.source} to ${O.target}`,"aria-describedby":E?`${owe}-${g}`:void 0,ref:_,...O.domAttributes,children:[!F&&o.jsx(S,{id:e,source:O.source,target:O.target,type:O.type,selected:O.selected,animated:O.animated,selectable:N,deletable:O.deletable??!0,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,data:O.data,style:O.style,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerStart:Q,markerEnd:q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth}),C&&o.jsx($tt,{edge:O,isReconnectable:C,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,setUpdateHover:A,setReconnecting:T})]})})}var Btt=p.memo(Ftt);const Utt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Iwe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:O}=_i(Utt,rs),w=Ett(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(Ntt,{defaultColor:e,rfId:n}),w.map(k=>o.jsx(Btt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:O,edgeTypes:i,disableKeyboardA11y:b},k))]})}Iwe.displayName="EdgeRenderer";const Qtt=p.memo(Iwe),ztt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Vtt({children:e}){const t=_i(ztt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Htt(e){const t=$R(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const qtt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Wtt(e){const t=_i(qtt),n=ss();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Gtt(e){return e.connection.inProgress?{...e.connection,to:$x(e.connection.to,e.transform)}:{...e.connection}}function Ktt(e){return Gtt}function Xtt(e){const t=Ktt();return _i(t,rs)}const Ytt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ztt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=_i(Ytt,rs);return!(s&&r&&c)?null:o.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ta(["react-flow__connection",j1e(l)]),children:o.jsx(Pwe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const Pwe=({style:e,type:t=Np.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=Xtt();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:j1e(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 Np.Bezier:[g]=Q1e(b);break;case Np.SimpleBezier:[g]=wwe(b);break;case Np.Step:[g]=J_({...b,borderRadius:0});break;case Np.SmoothStep:[g]=J_(b);break;default:[g]=V1e(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};Pwe.displayName="ConnectionLine";const Jtt={};function bK(e=Jtt){p.useRef(e),ss(),p.useEffect(()=>{},[e])}function ent(){ss(),p.useRef(!1),p.useEffect(()=>{},[])}function Dwe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,preventScrolling:P,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:M,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:Q,autoPanOnSelection:q,onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneScroll:re,onPaneContextMenu:ge,paneClickDistance:W,nodeClickDistance:X,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:ke,reconnectRadius:st,onReconnect:Le,onReconnectStart:Me,onReconnectEnd:Ie,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:ze,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J,viewport:he,onViewportChange:_e}){return bK(e),bK(t),ent(),Htt(n),Wtt(he),o.jsx(mtt,{onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneContextMenu:ge,onPaneScroll:re,paneClickDistance:W,deleteKeyCode:C,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:_,zoomOnScroll:L,zoomOnPinch:M,zoomOnDoubleClick:K,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:Q,autoPanOnSelection:q,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,onSelectionContextMenu:f,preventScrolling:P,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:ze,disableKeyboardA11y:Ee,onViewportChange:_e,isControlledViewport:!!he,children:o.jsxs(Vtt,{children:[o.jsx(Qtt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:Le,onReconnectStart:Me,onReconnectEnd:Ie,onlyRenderVisibleElements:N,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:ke,reconnectRadius:st,defaultMarkerColor:R,noPanClassName:ze,disableKeyboardA11y:Ee,rfId:J}),o.jsx(Ztt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(ktt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:X,onlyRenderVisibleElements:N,noPanClassName:ze,noDragClassName:qe,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}Dwe.displayName="GraphView";const tnt=p.memo(Dwe),nnt=M1e(),yK=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],x=n??e??[],O=d??[0,0],w=f??NS;W1e(b,v,y);const{nodesInitialized:k}=u6(x,m,g,{nodeOrigin:O,nodeExtent:w,zIndexMode:h});let S=[0,0,1];if(a&&r&&s){const E=iE(m,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:C,y:N,zoom:_}=oB(E,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[C,N,_]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:x,nodesInitialized:k,nodeLookup: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:NS,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vv.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:O,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...N1e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nnt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:_1e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},int=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>bet((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:O,width:w,height:k,minZoom:S,maxZoom:E}=g();y&&(await lJe({nodes:v,width:w,height:k,panZoom:y,minZoom:S,maxZoom:E},x),O==null||O.resolve(!0),m({fitViewResolver:null}))}return{...yK({nodes:e,edges:t,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:w,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:E}=g(),{nodesInitialized:C,hasSelectedNodes:N}=u6(v,y,x,{nodeOrigin:O,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:S}),_=E&&N;k&&C?(b(),m({nodes:v,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_})):m({nodes:v,nodesInitialized:C,nodesSelectionActive:_})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=g();W1e(y,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=g();x(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:x}=g();x(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:O,domNode:w,nodeOrigin:k,nodeExtent:S,debug:E,fitViewQueued:C,zIndexMode:N}=g(),{changes:_,updatedInternals:j}=jJe(v,x,O,w,k,S,N);j&&(TJe(x,O,{nodeOrigin:k,nodeExtent:S,zIndexMode:N}),C?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(_==null?void 0:_.length)>0&&(E&&console.log("React Flow: trigger node changes",_),y==null||y(_)))},updateNodePositions:(v,y=!1)=>{const x=[];let O=[];const{nodeLookup:w,triggerNodeChanges:k,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:C}=g();for(const[N,_]of v){const j=w.get(N),A=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(_!=null&&_.position)),F={id:N,type:"position",position:A?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:y};if(j&&S.inProgress&&S.fromNode.id===j.id){const T=kb(j,S.fromHandle,sn.Left,!0);E({...S,from:T})}A&&j.parentId&&x.push({id:N,parentId:j.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),O.push(F)}if(x.length>0){const{parentLookup:N,nodeOrigin:_}=g(),j=pB(x,w,N,_);O.push(...j)}for(const N of C.values())O=N(O);k(O)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:O,hasDefaultNodes:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=uwe(v,O);x(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:O,hasDefaultEdges:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=dwe(v,O);x(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));w(S);return}w(_y(O,new Set([...v]),!0)),k(_y(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));k(S);return}k(_y(x,new Set([...v]))),w(_y(O,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:O,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),E=v||O,C=y||x,N=[];for(const j of E){if(!j.selected)continue;const A=w.get(j.id);A&&(A.selected=!1),N.push(Og(j.id,!1))}const _=[];for(const j of C)j.selected&&_.push(Og(j.id,!1));k(N),S(_)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=g();y==null||y.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=g();y==null||y.setScaleExtent([x,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:x,triggerEdgeChanges:O,elementsSelectable:w}=g();if(!w)return;const k=y.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]),S=v.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]);x(k),O(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:O,nodeOrigin:w,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:E}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(u6(y,x,O,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:O,panZoom:w,translateExtent:k}=g();return RJe({delta:v,panZoom:w,transform:y,translateExtent:k,width:x,height:O})},setCenter:async(v,y,x)=>{const{width:O,height:w,maxZoom:k,panZoom:S}=g();if(!S)return!1;const E=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await S.setViewport({x:O/2-v*E,y:w/2-y*E,zoom:E},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...N1e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...yK()})}},Object.is);function Mwe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>int({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(yet,{value:g,children:o.jsx(Vet,{children:m})})}function rnt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(MR)?o.jsx(o.Fragment,{children:e}):o.jsx(Mwe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const snt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ant({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onSelectionChange:F,onSelectionDragStart:T,onSelectionDrag:P,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onBeforeDelete:I,connectionMode:H,connectionLineType:K=Np.Bezier,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,deleteKeyCode:ee="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:se=!1,selectionMode:re=jS.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:W=PS()?"Meta":"Control",zoomActivationKeyCode:X=PS()?"Meta":"Control",snapToGrid:ae,snapGrid:ue,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:ke,nodesDraggable:st,autoPanOnNodeFocus:Le,nodesConnectable:Me,nodesFocusable:Ie,nodeOrigin:qe=lwe,edgesFocusable:Ae,edgesReconnectable:ze,elementsSelectable:Ee=!0,defaultViewport:De=Ret,minZoom:J=.5,maxZoom:he=2,translateExtent:_e=NS,preventScrolling:Ze=!0,nodeExtent:at,defaultMarkerColor:wt="#b1b1b7",zoomOnScroll:Se=!0,zoomOnPinch:ve=!0,panOnScroll:He=!1,panOnScrollSpeed:Je=.5,panOnScrollMode:Ce=rb.Free,zoomOnDoubleClick:Wt=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:Ot,onPaneMouseMove:jt,onPaneMouseLeave:ot,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:Et=1,nodeClickDistance:bt=0,children:Mt,onReconnect:$e,onReconnectStart:ye,onReconnectEnd:Ue,onEdgeContextMenu:Ke,onEdgeDoubleClick:ft,onEdgeMouseEnter:ut,onEdgeMouseMove:Gt,onEdgeMouseLeave:Rt,reconnectRadius:zt=10,onNodesChange:Z,onEdgesChange:Bt,noDragClassName:Qe="nodrag",noWheelClassName:tt="nowheel",noPanClassName:ht="nopan",fitView:pe,fitViewOptions:We,connectOnClick:vt,attributionPosition:vn,proOptions:Ki,defaultEdgeOptions:Fe,elevateNodesOnSelect:Pt=!0,elevateEdgesOnSelect:pn=!1,disableKeyboardA11y:Jt=!1,autoPanOnConnect:en,autoPanOnNodeDrag:Un,autoPanOnSelection:wn=!0,autoPanSpeed:oi,connectionRadius:Oi,isValidConnection:mi,onError:bn,style:qi,id:ri,nodeDragThreshold:zi,connectionDragThreshold:as,viewport:Lr,onViewportChange:_r,width:xs,height:os,colorMode:ia="light",debug:Nr,onScroll:As,ariaLabelConfig:Vs,zIndexMode:Yr="basic",...ra},sa){const ls=ri||"1",va=Met(ia),aa=p.useCallback(ws=>{ws.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),As==null||As(ws)},[As]);return o.jsx("div",{"data-testid":"rf__wrapper",...ra,onScroll:aa,style:{...qi,...snt},ref:sa,className:ta(["react-flow",r,va]),id:ri,role:"application",children:o.jsxs(rnt,{nodes:e,edges:t,width:xs,height:os,fitView:pe,fitViewOptions:We,minZoom:J,maxZoom:he,nodeOrigin:qe,nodeExtent:at,zIndexMode:Yr,children:[o.jsx(Det,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:st,autoPanOnNodeFocus:Le,nodesConnectable:Me,nodesFocusable:Ie,edgesFocusable:Ae,edgesReconnectable:ze,elementsSelectable:Ee,elevateNodesOnSelect:Pt,elevateEdgesOnSelect:pn,minZoom:J,maxZoom:he,nodeExtent:at,onNodesChange:Z,onEdgesChange:Bt,snapToGrid:ae,snapGrid:ue,connectionMode:H,translateExtent:_e,connectOnClick:vt,defaultEdgeOptions:Fe,fitView:pe,fitViewOptions:We,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:P,onSelectionDragStart:T,onSelectionDragStop:R,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ht,nodeOrigin:qe,rfId:ls,autoPanOnConnect:en,autoPanOnNodeDrag:Un,autoPanSpeed:oi,onError:bn,connectionRadius:Oi,isValidConnection:mi,selectNodesOnDrag:ke,nodeDragThreshold:zi,connectionDragThreshold:as,onBeforeDelete:I,debug:Nr,ariaLabelConfig:Vs,zIndexMode:Yr}),o.jsx(tnt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:a,connectionLineType:K,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,selectionKeyCode:le,selectionOnDrag:se,selectionMode:re,deleteKeyCode:ee,multiSelectionKeyCode:W,panActivationKeyCode:ge,zoomActivationKeyCode:X,onlyRenderVisibleElements:Oe,defaultViewport:De,translateExtent:_e,minZoom:J,maxZoom:he,preventScrolling:Ze,zoomOnScroll:Se,zoomOnPinch:ve,zoomOnDoubleClick:Wt,panOnScroll:He,panOnScrollSpeed:Je,panOnScrollMode:Ce,panOnDrag:ln,autoPanOnSelection:wn,onPaneClick:cn,onPaneMouseEnter:Ot,onPaneMouseMove:jt,onPaneMouseLeave:ot,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:Et,nodeClickDistance:bt,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onReconnect:$e,onReconnectStart:ye,onReconnectEnd:Ue,onEdgeContextMenu:Ke,onEdgeDoubleClick:ft,onEdgeMouseEnter:ut,onEdgeMouseMove:Gt,onEdgeMouseLeave:Rt,reconnectRadius:zt,defaultMarkerColor:wt,noDragClassName:Qe,noWheelClassName:tt,noPanClassName:ht,rfId:ls,disableKeyboardA11y:Jt,nodeExtent:at,viewport:Lr,onViewportChange:_r}),o.jsx(jet,{onSelectionChange:F}),Mt,o.jsx(Cet,{proOptions:Ki,position:vn}),o.jsx(Eet,{rfId:ls,disableKeyboardA11y:Jt})]})})}var ont=fwe(ant);const lnt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function cnt({children:e}){const t=_i(lnt);return t?Li.createPortal(e,t):null}function unt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>uwe(r,s)),[]);return[t,n,i]}function dnt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>dwe(r,s)),[]);return[t,n,i]}const fnt=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||!lB(n.userNode))return!1;return!0};function hnt(e={includeHiddenNodes:!1}){return _i(fnt(e))}function pnt({dimensions:e,lineWidth:t,variant:n,className:i}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ta(["react-flow__background-pattern",n,i])})}function mnt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ta(["react-flow__background-pattern","dots",t])})}var tm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tm||(tm={}));const gnt={[tm.Dots]:1,[tm.Lines]:1,[tm.Cross]:6},bnt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Lwe({id:e,variant:t=tm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=_i(bnt,rs),g=i||gnt[t],b=t===tm.Dots,v=t===tm.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],O=g*h[2],w=Array.isArray(s)?s:[s,s],k=v?[O,O]:x,S=[w[0]*h[2]||1+k[0]/2,w[1]*h[2]||1+k[1]/2],E=`${m}${e||""}`;return o.jsxs("svg",{className:ta(["react-flow__background",u]),style:{...c,...FR,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:E,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?o.jsx(mnt,{radius:O/2,className:d}):o.jsx(pnt,{dimensions:k,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}Lwe.displayName="Background";const ynt=p.memo(Lwe);function vnt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xnt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function wnt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Ont(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 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 Snt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function vT({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ta(["react-flow__controls-button",t]),...n,children:e})}const knt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $we({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=ss(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=_i(knt,rs),{zoomIn:O,zoomOut:w,fitView:k}=$R(),S=()=>{O(),s==null||s()},E=()=>{w(),a==null||a()},C=()=>{k(r),l==null||l()},N=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},_=h==="horizontal"?"horizontal":"vertical";return o.jsxs(LR,{className:ta(["react-flow__controls",_,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(vT,{onClick:S,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(vnt,{})}),o.jsx(vT,{onClick:E,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(xnt,{})})]}),n&&o.jsx(vT,{className:"react-flow__controls-fitview",onClick:C,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(wnt,{})}),i&&o.jsx(vT,{className:"react-flow__controls-interactive",onClick:N,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(Snt,{}):o.jsx(Ont,{})}),d]})}$we.displayName="Controls";const Ent=p.memo($we);function Cnt({id:e,x:t,y:n,width:i,height:r,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:ta(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Tnt=p.memo(Cnt),Ant=e=>e.nodes.map(t=>t.id),oM=e=>e instanceof Function?e:()=>e;function _nt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Tnt,onClick:a}){const l=_i(Ant,rs),c=oM(t),u=oM(e),d=oM(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(jnt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function Nnt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=_i(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:O,height:w}=Fh(v);return{node:v,x:y,y:x,width:O,height:w}},rs);return!u||u.hidden||!lB(u)?null:o.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}const jnt=p.memo(Nnt);var Rnt=p.memo(_nt);const Int=200,Pnt=150,Dnt=e=>!e.hidden,Mnt=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?D1e(iE(e.nodeLookup,{filter:Dnt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Lnt="react-flow__minimap-desc";function Fwe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:O=1,offsetScale:w=5}){const k=ss(),S=p.useRef(null),{boundingRect:E,viewBB:C,rfId:N,panZoom:_,translateExtent:j,flowWidth:A,flowHeight:F,ariaLabelConfig:T}=_i(Mnt,rs),P=(e==null?void 0:e.width)??Int,R=(e==null?void 0:e.height)??Pnt,L=E.width/P,M=E.height/R,U=Math.max(L,M),I=U*P,H=U*R,K=w*U,Q=E.x-(I-E.width)/2-K,q=E.y-(H-E.height)/2-K,B=I+K*2,ee=H+K*2,le=`${Lnt}-${N}`,se=p.useRef(0),re=p.useRef();se.current=U,p.useEffect(()=>{if(S.current&&_)return re.current=UJe({domNode:S.current,panZoom:_,getTransform:()=>k.getState().transform,getViewScale:()=>se.current}),()=>{var ae;(ae=re.current)==null||ae.destroy()}},[_]),p.useEffect(()=>{var ae;(ae=re.current)==null||ae.update({translateExtent:j,width:A,height:F,inversePan:x,pannable:b,zoomStep:O,zoomable:v})},[b,v,x,O,j,A,F]);const ge=m?ae=>{var ke;const[ue,Oe]=((ke=re.current)==null?void 0:ke.pointer(ae))||[0,0];m(ae,{x:ue,y:Oe})}:void 0,W=g?p.useCallback((ae,ue)=>{const Oe=k.getState().nodeLookup.get(ue).internals.userNode;g(ae,Oe)},[]):void 0,X=y??T["minimap.ariaLabel"];return o.jsx(LR,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ta(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:P,height:R,viewBox:`${Q} ${q} ${B} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:S,onClick:ge,children:[X&&o.jsx("title",{id:le,children:X}),o.jsx(Rnt,{onClick:W,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-K},${q-K}h${B+K*2}v${ee+K*2}h${-B-K*2}z - M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Fwe.displayName="MiniMap";p.memo(Fwe);const $nt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Fnt={[Gv.Line]:"right",[Gv.Handle]:"bottom-right"};function Bnt({nodeId:e,position:t,variant:n=Gv.Handle,className:i,style:r=void 0,children:s,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=gwe(),O=typeof e=="string"?e:x,w=ss(),k=p.useRef(null),S=n===Gv.Handle,E=_i(p.useCallback($nt(S&&m),[S,m]),rs),C=p.useRef(null),N=t??Fnt[n];p.useEffect(()=>{if(!(!k.current||!O))return C.current||(C.current=eet({domNode:k.current,nodeId:O,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,domNode:R}=w.getState();return{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,paneDomNode:R}},onChange:(j,A)=>{const{triggerNodeChanges:F,nodeLookup:T,parentLookup:P,nodeOrigin:R}=w.getState(),L=[],M={x:j.x,y:j.y},U=T.get(O);if(U&&U.expandParent&&U.parentId){const I=U.origin??R,H=j.width??U.measured.width??0,K=j.height??U.measured.height??0,Q={id:U.id,parentId:U.parentId,rect:{width:H,height:K,...L1e({x:j.x??U.position.x,y:j.y??U.position.y},{width:H,height:K},U.parentId,T,I)}},q=pB([Q],T,P,R);L.push(...q),M.x=j.x?Math.max(I[0]*H,j.x):void 0,M.y=j.y?Math.max(I[1]*K,j.y):void 0}if(M.x!==void 0&&M.y!==void 0){const I={id:O,type:"position",position:{...M}};L.push(I)}if(j.width!==void 0&&j.height!==void 0){const H={id:O,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};L.push(H)}for(const I of A){const H={...I,type:"position"};L.push(H)}F(L)},onEnd:({width:j,height:A})=>{const F={id:O,type:"dimensions",resizing:!1,dimensions:{width:j,height:A}};w.getState().triggerNodeChanges([F])}})),C.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var j;(j=C.current)==null||j.destroy()}},[N,l,c,u,d,f,b,v,y,g]);const _=N.split("-");return o.jsx("div",{className:ta(["react-flow__resize-control","nodrag",..._,n,i]),ref:k,style:{...r,scale:E,...a&&{[S?"backgroundColor":"borderColor"]:a}},children:s})}p.memo(Bnt);var Bwe=Object.defineProperty,Unt=(e,t,n)=>t in e?Bwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qnt=(e,t)=>{for(var n in t)Bwe(e,n,{get:t[n],enumerable:!0})},znt=(e,t,n)=>Unt(e,t+"",n),Uwe={};Qnt(Uwe,{Graph:()=>au,alg:()=>gB,json:()=>zwe,version:()=>qnt});var Vnt=Object.defineProperty,Qwe=(e,t)=>{for(var n in t)Vnt(e,n,{get:t[n],enumerable:!0})},au=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(i=>{n!==void 0?this.setNode(i,n):this.setNode(i)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(i=>{this.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let i=n;i!==void 0;i=this.parent(i))if(i===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let i=new Set(n);for(let r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,a])=>{t(s)&&n.setNode(s,a)}),Object.values(this._edgeObjs).forEach(s=>{n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,this.edge(s))});let i={},r=s=>{let a=this.parent(s);return!a||n.hasNode(a)?(i[s]=a??void 0,a??void 0):a in i?i[a]:r(a)};return this._isCompound&&n.nodes().forEach(s=>n.setParent(s,r(s))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((i,r)=>(n!==void 0?this.setEdge(i,r,n):this.setEdge(i,r),r)),this}setEdge(t,n,i,r){let s,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(s=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(s=t,a=n,l=r,arguments.length>2&&(c=i,u=!0)),s=""+s,a=""+a,l!==void 0&&(l=""+l);let d=Pw(this._isDirected,s,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(s,a,l);let f=Hnt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,vK(this._preds[a],s),vK(this._sucs[s],a),this._in[a][d]=f,this._out[s][d]=f,this._edgeCount++,this}edge(t,n,i){let r=arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i);return this._edgeLabels[r]}edgeAsObj(t,n,i){let r=arguments.length===1?this.edge(t):this.edge(t,n,i);return typeof r!="object"?{label:r}:r}hasEdge(t,n,i){return(arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i),s=this._edgeObjs[r];if(s){let a=s.v,l=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],xK(this._preds[l],a),xK(this._sucs[a],l),delete this._in[l][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,i){if(!t)return;let r=Object.values(t);return i?r.filter(s=>s.v===n&&s.w===i||s.v===i&&s.w===n):r}};function vK(e,t){e[t]?e[t]++:e[t]=1}function xK(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Pw(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let a=r;r=s,s=a}return r+""+s+""+(i===void 0?"\0":i)}function Hnt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let a={v:r,w:s};return i&&(a.name=i),a}function lM(e,t){return Pw(e,t.v,t.w,t.name)}var qnt="4.0.1",zwe={};Qwe(zwe,{read:()=>Xnt,write:()=>Wnt});function Wnt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Gnt(e),edges:Knt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Gnt(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 Knt(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 Xnt(e){let t=new au(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var gB={};Qwe(gB,{CycleException:()=>nN,bellmanFord:()=>Vwe,components:()=>Jnt,dijkstra:()=>tN,dijkstraAll:()=>nit,findCycles:()=>iit,floydWarshall:()=>sit,isAcyclic:()=>oit,postorder:()=>cit,preorder:()=>uit,prim:()=>dit,shortestPaths:()=>fit,tarjan:()=>qwe,topsort:()=>Wwe});var Ynt=()=>1;function Vwe(e,t,n,i){return Znt(e,String(t),n||Ynt,i||function(r){return e.outEdges(r)})}function Znt(e,t,n,i){let r={},s,a=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function tN(e,t,n,i){let r=function(s){return e.outEdges(s)};return tit(e,String(t),n||eit,i||r)}function tit(e,t,n,i){let r={},s=new Hwe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(a=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function nit(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=tN(e,r,t,n),i},{})}function qwe(e){let t=0,n=[],i={},r=[];function s(a){let l=i[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(a!==u);r.push(c)}}return e.nodes().forEach(function(a){a in i||s(a)}),r}function iit(e){return qwe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var rit=()=>1;function sit(e,t,n){return ait(e,t||rit,n||function(i){return e.outEdges(i)})}function ait(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(a){s!==a&&(i[s][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(a){let l=a.v===s?a.w:a.v,c=t(a);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let a=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=a[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=Gwe(e,l,n==="post",a,s,i,r)}),r}function Gwe(e,t,n,i,r,s,a){return t in i||(i[t]=!0,n||(a=s(a,t)),r(t).forEach(function(l){a=Gwe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function Kwe(e,t,n){return lit(e,t,n,function(i,r){return i.push(r),i},[])}function cit(e,t){return Kwe(e,t,"post")}function uit(e,t){return Kwe(e,t,"pre")}function dit(e,t){let n=new au,i={},r=new Hwe,s;function a(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(a)}return n}function fit(e,t,n,i){return hit(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function hit(e,t,n,i){if(n===void 0)return tN(e,t,n,i);let r=!1,s=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function Xwe(e){let t=new au({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function wK(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,a=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*a>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(a=-a),c=a,u=a*s/r),{x:n+c,y:i+u}}function aE(e){let t=MS(Zwe(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 mit(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Cd(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function git(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Cd(Math.min,t),i=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;i[l]||(i[l]=[]),i[l].push(a)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((a,l)=>{a===void 0&&l%s!==0?--r:a!==void 0&&r&&a.forEach(c=>e.node(c).rank+=r)})}function OK(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Fx(e,"border",r,t)}function bit(e,t=Ywe){let n=[];for(let i=0;iYwe){let n=bit(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function Zwe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Cd(Math.max,t)}function yit(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function Jwe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function eOe(e,t){return t()}var vit=0;function bB(e){let t=++vit;return e+(""+t)}function MS(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function xit(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var UR="\0",wit="3.0.0",Oit=class{constructor(){znt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return SK(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&SK(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,Sit)),n=n._prev;return"["+e.join(", ")+"]"}};function SK(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Sit(e,t){if(e!=="_next"&&e!=="_prev")return t}var kit=Oit,Eit=()=>1;function Cit(e,t){if(e.nodeCount()<=1)return[];let n=Ait(e,t||Eit);return Tit(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function Tit(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)cM(e,t,n,l);for(;l=s.dequeue();)cM(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(cM(e,t,n,l,!0)||[]);break}}}return r}function cM(e,t,n,i,r){let s=[],a=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,h6(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,h6(t,n,d)}),e.removeNode(i.v),a}function Ait(e,t){let n=new au,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=_it(r+i+3).map(()=>new kit),a=i+1;return n.nodes().forEach(l=>{h6(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function h6(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 _it(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,bB("rev"))});function t(n){return i=>n.edge(i).weight}}function jit(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):r(a.w)}),delete n[s])}return e.nodes().forEach(r),t}function Rit(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 Iit(e){e.graph().dummyChains=[],e.edges().forEach(t=>Pit(e,t))}function Pit(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function yB(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),a=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=Cd(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function Kv(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var tOe=Mit;function Mit(e){let t=new au({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,a;for(;Lit(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!Kv(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function $it(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=Kv(t,i)),rt.node(i).rank+=n)}var{preorder:Bit,postorder:Uit}=gB,Qit=Xb;Xb.initLowLimValues=xB;Xb.initCutValues=vB;Xb.calcCutValue=nOe;Xb.leaveEdge=rOe;Xb.enterEdge=sOe;Xb.exchangeEdges=aOe;function Xb(e){e=pit(e),yB(e);let t=tOe(e);xB(t),vB(t,e);let n,i;for(;n=rOe(t);)i=sOe(t,e,n),aOe(t,e,n,i)}function vB(e,t){let n=Uit(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>zit(e,t,i))}function zit(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=nOe(e,t,n)}function nOe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),a=0;s||(r=!1,s=t.edge(i,n)),a=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(a+=f?h:-h,Hit(e,n,d)){let m=e.edge(n,d).cutvalue;a+=f?-m:m}}}),a}function xB(e,t){arguments.length<2&&(t=e.nodes()[0]),iOe(e,{},1,t)}function iOe(e,t,n,i,r){let s=n,a=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=iOe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function rOe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function sOe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),a=e.node(r),l=s,c=!1;return s.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===kK(e,e.node(u.v),l)&&c!==kK(e,e.node(u.w),l)).reduce((u,d)=>Kv(t,d)!e.node(r).parent);if(!n)return;let i=Bit(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,a=t.edge(r,s),l=!1;a||(a=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?a.minlen:-a.minlen)})}function Hit(e,t,n){return e.hasEdge(t,n)}function kK(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var qit=Wit;function Wit(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":EK(e);break;case"tight-tree":Kit(e);break;case"longest-path":Git(e);break;case"none":break;default:EK(e)}}var Git=yB;function Kit(e){yB(e),tOe(e)}function EK(e){Qit(e)}var Xit=Yit;function Yit(e){let t=Jit(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=Zit(e,t,r.v,r.w),a=s.path,l=s.lca,c=0,u=a[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function Jit(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(UR).forEach(i),t}function ert(e){let t=Fx(e,"root",{},"_root"),n=trt(e),i=Object.values(n),r=Cd(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=nrt(e)+1;e.children(UR).forEach(l=>oOe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function oOe(e,t,n,i,r,s,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=OK(e,"_bt"),d=OK(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var m;oOe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,x=b!==v?1:r-((m=s[a])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function trt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(a=>n(a,r+1)),t[i]=r}return e.children(UR).forEach(i=>n(i,1)),t}function nrt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function irt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var rrt=srt;function srt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,a=r.maxRank+1;sTK(e.node(t))),e.edges().forEach(t=>TK(e.edge(t)))}function TK(e){let t=e.width;e.width=e.height,e.height=t}function lrt(e){e.nodes().forEach(t=>uM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(uM),Object.hasOwn(i,"y")&&uM(i)})}function uM(e){e.y=-e.y}function crt(e){e.nodes().forEach(t=>dM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(dM),Object.hasOwn(i,"x")&&dM(i)})}function dM(e){let t=e.x;e.x=e.y,e.y=t}function urt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Cd(Math.max,i),s=MS(r+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),s}function drt(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 hrt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function prt(e,t){let n={};e.forEach((r,s)=>{let a={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(a.barycenter=r.barycenter,a.weight=r.weight),n[r.v]=a}),t.edges().forEach(r=>{let s=n[r.v],a=n[r.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(a))});let i=Object.values(n).filter(r=>!r.indegree);return mrt(i)}function mrt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&grt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>iN(r,["vs","i","barycenter","weight"]))}function grt(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 brt(e,t){let n=yit(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],a=0,l=0,c=0;i.sort(yrt(!!t)),c=AK(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=AK(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function AK(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 yrt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function cOe(e,t,n,i){let r=e.children(t),s=e.node(t),a=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};a&&(r=r.filter(h=>h!==a&&h!==l));let u=hrt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=cOe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&xrt(h,m)}});let d=prt(u,n);vrt(d,c);let f=brt(d,i);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function vrt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function xrt(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 wrt(e,t,n,i){i||(i=e.nodes());let r=Ort(e),s=new au({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(a=>e.node(a));return i.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(a),s.setParent(a,c||r);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=s.edge(f,a),m=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function Ort(e){let t;for(;e.hasNode(t=bB("_root")););return t}function Srt(e,t,n){let i={},r;n.forEach(s=>{let a=e.parent(s),l,c;for(;a;){if(l=e.parent(a),l?(c=i[l],i[l]=a):(c=r,r=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function uOe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,uOe);return}let n=Zwe(e),i=_K(e,MS(1,n+1),"inEdges"),r=_K(e,MS(n-1,-1,-1),"outEdges"),s=urt(e);if(NK(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){krt(u%2?i:r,u%4>=2,c),s=aE(e);let f=drt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(a)};for(let s of e.nodes()){let a=e.node(s);if(typeof a.rank=="number"&&r(a.rank,s),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&r(l,s)}return t.map(function(s){return wrt(e,s,n,i.get(s)||[])})}function krt(e,t,n){let i=new au;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=cOe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),Srt(r,i,a.vs)})}function NK(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function Ert(e,t){let n={};function i(r,s){let a=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=Trt(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),x=y.order;(x{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)&&dOe(n,m,f)})}})}function r(s,a){let l=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(a,u,f,l,c),u=f,l=c}}i(a,u,a.length,c,s.length)}),a}return t.length&&t.reduce(r),n}function Trt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function dOe(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 Art(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 _rt(e,t,n,i){let r={},s={},a={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=a[m],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let x=(y=s[v.v])!=null?y:0,O=a.edge(v);return Math.max(b,x+(O!==void 0?O:0))},0):s[m]=0}function d(m){let g=a.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,x)=>{let O=s[x.w],w=a.edge(x);return Math.min(y,(O!==void 0?O:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return a.predecessors(m)||[]}function h(m){return a.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function jrt(e,t,n,i){let r=new au,s=e.graph(),a=Mrt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),r}function Rrt(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=Lrt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let a=r-s;return a{["l","r"].forEach(a=>{let l=s+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-Cd(Math.min,u);a!=="l"&&(d=r-Cd(Math.max,u)),d&&(e[l]=BR(c,f=>f+d))})})}function Prt(e,t=void 0){let n=e.ul;return n?BR(n,(i,r)=>{var s,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((a=l[2])!=null?a:0))/2}):{}}function Drt(e){let t=aE(e),n=Object.assign(Ert(e,t),Crt(e,t)),i={},r;["u","d"].forEach(a=>{r=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=_rt(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=Nrt(e,r,c.root,c.align,l==="r");l==="r"&&(u=BR(u,d=>-d)),i[a+l]=u})});let s=Rrt(e,i);return Irt(i,s),Prt(i,e.graph().align)}function Mrt(e,t,n){return(i,r,s)=>{let a=i.node(r),l=i.node(s),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function Lrt(e,t){return e.node(t).width}function $rt(e){e=Xwe(e),Frt(e),Object.entries(Drt(e)).forEach(([t,n])=>e.node(t).x=n)}function Frt(e){let t=aE(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(a=>{let l=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function Brt(e,t={}){let n=t.debugTiming?Jwe:eOe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Xrt(e));return n(" runLayout",()=>Urt(i,n,t)),n(" updateInputGraph",()=>Qrt(e,i)),i})}function Urt(e,t,n){t(" makeSpaceForEdgeLabels",()=>Yrt(e)),t(" removeSelfEdges",()=>ast(e)),t(" acyclic",()=>Nit(e)),t(" nestingGraph.run",()=>ert(e)),t(" rank",()=>qit(Xwe(e))),t(" injectEdgeLabelProxies",()=>Zrt(e)),t(" removeEmptyRanks",()=>git(e)),t(" nestingGraph.cleanup",()=>irt(e)),t(" normalizeRanks",()=>mit(e)),t(" assignRankMinMax",()=>Jrt(e)),t(" removeEdgeLabelProxies",()=>est(e)),t(" normalize.run",()=>Iit(e)),t(" parentDummyChains",()=>Xit(e)),t(" addBorderSegments",()=>rrt(e)),t(" order",()=>uOe(e,n)),t(" insertSelfEdges",()=>ost(e)),t(" adjustCoordinateSystem",()=>art(e)),t(" position",()=>$rt(e)),t(" positionSelfEdges",()=>lst(e)),t(" removeBorderNodes",()=>sst(e)),t(" normalize.undo",()=>Dit(e)),t(" fixupEdgeLabelCoords",()=>ist(e)),t(" undoCoordinateSystem",()=>ort(e)),t(" translateGraph",()=>tst(e)),t(" assignNodeIntersects",()=>nst(e)),t(" reversePoints",()=>rst(e)),t(" acyclic.undo",()=>Rit(e))}function Qrt(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 zrt=["nodesep","edgesep","ranksep","marginx","marginy"],Vrt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Hrt=["acyclicer","ranker","rankdir","align","rankalign"],qrt=["width","height","rank"],jK={width:0,height:0},Wrt=["minlen","weight","width","height","labeloffset"],Grt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Krt=["labelpos"];function Xrt(e){let t=new au({multigraph:!0,compound:!0}),n=hM(e.graph());return t.setGraph(Object.assign({},Vrt,fM(n,zrt),iN(n,Hrt))),e.nodes().forEach(i=>{let r=hM(e.node(i)),s=fM(r,qrt);Object.keys(jK).forEach(l=>{s[l]===void 0&&(s[l]=jK[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=hM(e.edge(i));t.setEdge(i,Object.assign({},Grt,fM(r,Wrt),iN(r,Krt)))}),t}function Yrt(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 Zrt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Fx(e,"edge-proxy",r,"_ep")}})}function Jrt(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 est(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 tst(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),a=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+a,s.height=r-i+l}function nst(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,a;n.points?(s=n.points[0],a=n.points[n.points.length-1]):(n.points=[],s=r,a=i),n.points.unshift(wK(i,s)),n.points.push(wK(r,a))})}function ist(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 rst(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function sst(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function ast(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 ost(e){aE(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Fx(e,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function lst(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,a=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:a-c},{x:s+5*l/6,y:a-c},{x:s+l,y:a},{x:s+5*l/6,y:a+c},{x:s+2*l/3,y:a+c}],i.label.x=n.x,i.label.y=n.y}})}function fM(e,t){return BR(iN(e,t),Number)}function hM(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function cst(e){let t=aE(e),n=new au({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var ust={graphlib:Uwe,version:wit,layout:Brt,debug:cst,util:{time:Jwe,notime:eOe}},RK=ust;/*! For license information please see dagre.esm.js.LEGAL.txt */const Dw={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Ebe},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:k7e},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:r7e},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:_be},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:Zj}},p6=220,m6=88,IK=96,PK=34,kO=64,pM=310,Ny=24,fOe=56,g6=40,DK=40,dst=18,fst=58,hst=!1,pst=e=>e==="sequential"||e==="parallel"||e==="loop";function b6(e,t){const n=e.agentType??"llm";return pst(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function y6(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!b6(e,t))return{width:p6,height:m6};if(i&&e.subAgents.length===0)return{width:pM,height:kO};const s=e.subAgents.map((f,h)=>y6(f,[...t,h],n,i)),a=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?fOe:Ny,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?dst+DK:r==="loop"?fst:0:DK;return u?{width:Math.max(pM,s.reduce((f,h)=>f+h.width,0)+g6*Math.max(0,s.length-1)+c*2),height:kO+Ny+l+d+Ny}:{width:Math.max(pM,a+Ny*2),height:kO+c+s.reduce((f,h)=>f+h.height,0)+g6*Math.max(0,s.length-1)+d+c}}function B1(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function mst(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function MK(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function U1(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:RS.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function LK(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function a(f,h,m,g,b){const v=f.agentType??"llm",y=B1(h);return b6(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(Dw[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=B1(h),x=y6(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:x.width,height:x.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(Dw[v].labelKey)),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:x.width,layoutHeight:x.height,compactEmptyGroup:n&&f.subAgents.length===0}});const O=f.subAgents.map((C,N)=>y6(C,[...h,N],t,n)),w=O.length&&v!=="parallel"?fOe:Ny,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=w;const E=f.subAgents.map((C,N)=>{const _=O[N],j=k?{x:S,y:kO+Ny}:{x:(x.width-_.width)/2,y:kO+S};return S+=(k?_.width:_.height)+g6,a(C,[...h,N],y,j,v)});if(v==="sequential"||v==="loop"){for(let C=0;C1&&s.push(U1(E[E.length-1],E[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=B1(h);if(b6(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(Dw[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const x=[...h,y],O=B1(x);s.push(U1(g,O,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,x))}),b},u=B1([]),d=c(e,[]);return s.push(U1("terminal-input",u)),d.forEach(f=>s.push(U1(f,"terminal-output"))),gst(r,s,t)}function gst(e,t,n){const i=new RK.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const a=s.data.kind==="terminal";i.setNode(s.id,{width:a?IK:s.data.layoutWidth??p6,height:a?PK:s.data.layoutHeight??m6})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),RK.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?IK:s.data.layoutWidth??p6,u=l?PK:s.data.layoutHeight??m6;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const QR=p.createContext(null),zR=p.createContext("horizontal");function bst({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(QR),[m,g]=p.useState(!1),[b,v,y]=J_({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(sE,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&o.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&o.jsx(cnt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:x=>{x.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(Fo,{})})]})})]})}function yst({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(QR),r=p.useContext(zR),s=r==="vertical"?sn.Top:sn.Left,a=r==="vertical"?sn.Bottom:sn.Right,l=r==="vertical"?sn.Right:sn.Bottom,c=e.pattern??"llm",u=Dw[c],d=u.icon;return o.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(d,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:n(u.labelKey)})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function vst({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(QR),r=p.useContext(zR),s=r==="vertical"?sn.Top:sn.Left,a=r==="vertical"?sn.Bottom:sn.Right,l=r==="vertical"?sn.Right:sn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return o.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:o.jsx(Fo,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:o.jsx(Fo,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx(Fo,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx(Fo,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function xst({data:e}){const t=p.useContext(zR);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(fl,{type:"target",position:t==="vertical"?sn.Top:sn.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(fl,{type:"source",position:t==="vertical"?sn.Bottom:sn.Right,className:"abc-handle"})]})}const wst={agent:yst,group:vst,terminal:xst},Ost={insertStep:bst};function Sst({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>LK(e,c,a,u),[]),[f,h,m]=unt(d.nodes),[g,b,v]=dnt(d.edges),y=hnt(),x=p.useRef(`${c}:${a?"readonly":"editable"}:${MK(e)}`),O=p.useRef(null),{fitView:w}=$R(),k=p.useMemo(()=>LK(e,c,a,u),[c,e,a,u]),[S,E]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=p.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),N=p.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=O.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&j<8){N(j+1);return}w(C)})})},[C,w]);p.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),A=F=>E(F.matches);return j.addEventListener("change",A),()=>j.removeEventListener("change",A)},[]),p.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${MK(e)}`,A=j!==x.current;x.current=j,b(k.edges),h(F=>{const T=new Map(F.map(P=>[P.id,P]));return k.nodes.map(P=>{const R=T.get(P.id);return{...P,measured:!A&&R&&R.type===P.type?R.measured:void 0,position:!A&&R?R.position:P.position,selected:P.data.kind==="agent"&&!!P.data.path&&mst(P.data.path,t)}})}),A&&N()},[k,e,N,t,b,h]),p.useEffect(()=>{N()},[S,N]),p.useEffect(()=>{y&&N()},[k,N,y]),p.useEffect(()=>{if(!a||!O.current)return;const j=new ResizeObserver(()=>N());return j.observe(O.current),N(),()=>j.disconnect()},[N,a]);const _=p.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(zR.Provider,{value:c,children:o.jsx(QR.Provider,{value:_,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":u(a?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:o.jsx("div",{ref:O,className:"abc-canvas",children:o.jsxs(ont,{nodes:f,edges:g,nodeTypes:wst,edgeTypes:Ost,onNodesChange:m,onEdgesChange:v,onNodeClick:(j,A)=>{!a&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:C,onInit:()=>N(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[o.jsx(ynt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(Ent,{showInteractive:!1}),hst]})})})})})}function LS(e){return o.jsx(Mwe,{children:o.jsx(Sst,{...e})})}an.hasResourceBundle("en-US","create")||an.addResourceBundle("en-US","create",xse,!0,!0);an.hasResourceBundle("zh-CN","create")||an.addResourceBundle("zh-CN","create",Lce,!0,!0);function $t(e,t={}){return an.t(e,{...t,ns:"create"})}function oE(e,t){return e.map(n=>({...n,get label(){return $t(`${t}.${n.id}.label`)},get desc(){return $t(`${t}.${n.id}.description`)}}))}function qc(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>$t(r)});return n}const hOe="https://ark.cn-beijing.volces.com/api/v3/";qc({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const pA=[qc({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:hOe}],rN=[],sN={get label(){return $t("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},kst={get label(){return $t("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},pOe="https://api.vikingdb.cn-beijing.volces.com/openviking",Est=`{ +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??tK,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)&&B1e(m))return!1;const b=iK(m.code,l);if(s.current.add(m[b]),nK(a,s.current,!1)){const x=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,O=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(r.current||!O)&&m.preventDefault(),i(!0)}},f=m=>{const g=iK(m.code,l);nK(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function nK(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function iK(e,t){return t.includes(e)?"code":"key"}const $et=()=>{const e=ss();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=oB(t,i,r,s,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return $x(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),a=Wv(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function uwe(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const a=i.get(s.id);a?a.push(s):i.set(s.id,[s])}for(const s of t){const a=i.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const c of a)Fet(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 Fet(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 dwe(e,t){return uwe(e,t)}function fwe(e,t){return uwe(e,t)}function Og(e,t){return{id:e,type:"select",selected:t}}function _y(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const a=t.has(r);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),i.push(Og(s.id,a)))}return i}function rK({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function sK(e){return{id:e.id,type:"remove"}}const Bet=L1e();function Uet(e,t,n={}){return xJe(e,t,{...n,onError:n.onError??Bet})}const aK=e=>sJe(e),Qet=e=>I1e(e);function hwe(e){return p.forwardRef(e)}const zet=typeof window<"u"?p.useLayoutEffect:p.useEffect;function oK(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>Vet(()=>n(r=>r+BigInt(1))));return zet(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function Vet(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const pwe=p.createContext(null);function Het({children:e}){const t=ss(),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=rK({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:x,setNodes:O}=t.getState();y&&O(x)})},[]),i=oK(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(rK({items:m,lookup:h}))},[]),s=oK(r),a=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(pwe.Provider,{value:a,children:e})}function qet(){const e=p.useContext(pwe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Wet=e=>!!e.panZoom;function $R(){const e=$et(),t=ss(),n=qet(),i=_i(Wet),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=aK(f)?f:h.get(f.id),b=g.parentId?$1e(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:((x=g.measured)==null?void 0:x.height)??g.height};return qv(v)},u=(f,h,m={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&aK(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&&Qet(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:O,onBeforeDelete:w}=t.getState(),{nodes:k,edges:S}=await uJe({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:w}),E=S.length>0,C=k.length>0;if(E){const N=S.map(sK);v==null||v(S),x(N)}if(C){const N=k.map(sK);b==null||b(k),y(N)}return(C||E)&&(O==null||O({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=MG(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!g&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const O=qv(v?y:x),w=IS(O,b);return h&&w>0||w>=O.width*O.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=MG(f)?f:c(f);if(!b)return!1;const v=IS(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 aJe(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??hJe();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 lK=e=>e.selected,Get=typeof window<"u"?window:void 0;function Ket({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ss(),{deleteElements:i}=$R(),r=DS(e,{actInsideInputWithModifier:!1}),s=DS(t,{target:Get});p.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(lK),edges:a.filter(lK)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Xet(e){const t=ss();p.useEffect(()=>{const n=()=>{var r,s,a,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=cB(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Fu.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const FR={position:"absolute",width:"100%",height:"100%",top:0,left:0},Yet=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Zet({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=rb.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:O,selectionOnDrag:w}){const k=ss(),S=p.useRef(null),{userSelectionActive:E,lib:C,connectionInProgress:N}=_i(Yet,rs),_=DS(h),j=p.useRef();Xet(S);const A=p.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||k.setState({transform:F})},[y,x]);return p.useEffect(()=>{if(S.current){j.current=XJe({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:R=>k.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:M,onMoveStart:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoom:(R,L)=>{const{onViewportChange:M,onMove:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:M,onMoveEnd:U}=k.getState();U==null||U(R,L),M==null||M(L)}});const{x:F,y:T,zoom:P}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[F,T,P],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=j.current)==null||R.destroy()}}},[]),p.useEffect(()=>{var F;(F=j.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:_,preventScrolling:m,noPanClassName:v,userSelectionActive:E,noWheelClassName:b,lib:C,onTransformChange:A,connectionInProgress:N,selectionOnDrag:w,paneClickDistance:O})},[e,t,n,i,r,s,a,l,_,m,v,E,b,C,A,N,w,O]),o.jsx("div",{className:"react-flow__renderer",ref:S,style:FR,children:g})}const Jet=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ett(){const{userSelectionActive:e,userSelectionRect:t}=_i(Jet,rs);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const aM=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ttt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ntt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jS.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=ss(),{userSelectionActive:x,elementsSelectable:O,dragging:w,connectionInProgress:k,panBy:S,autoPanSpeed:E}=_i(ttt,rs),C=O&&(e||x),N=p.useRef(null),_=p.useRef(),j=p.useRef(new Set),A=p.useRef(new Set),F=p.useRef(!1),T=p.useRef({x:0,y:0}),P=p.useRef(!1),R=se=>{if(F.current||k){F.current=!1;return}u==null||u(se),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},L=se=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){se.preventDefault();return}d==null||d(se)},M=f?se=>f(se):void 0,U=se=>{F.current&&(se.stopPropagation(),F.current=!1)},I=se=>{var st,Le;const{domNode:re,transform:ge}=y.getState();if(_.current=re==null?void 0:re.getBoundingClientRect(),!_.current)return;const W=se.target===N.current;if(!W&&!!se.target.closest(".nokey")||!e||!(a&&W||t)||se.button!==0||!se.isPrimary)return;(Le=(st=se.target)==null?void 0:st.setPointerCapture)==null||Le.call(st,se.pointerId),F.current=!1;const{x:ue,y:Oe}=_u(se.nativeEvent,_.current),ke=$x({x:ue,y:Oe},ge);y.setState({userSelectionRect:{width:0,height:0,startX:ke.x,startY:ke.y,x:ue,y:Oe}}),W||(se.stopPropagation(),se.preventDefault())};function H(se,re){const{userSelectionRect:ge}=y.getState();if(!ge)return;const{transform:W,nodeLookup:X,edgeLookup:ae,connectionLookup:ue,triggerNodeChanges:Oe,triggerEdgeChanges:ke,defaultEdgeOptions:st}=y.getState(),Le={x:ge.startX,y:ge.startY},{x:Me,y:Ie}=Wv(Le,W),qe={startX:Le.x,startY:Le.y,x:seDe.id)),A.current=new Set;const Ee=(st==null?void 0:st.selectable)??!0;for(const De of j.current){const J=ue.get(De);if(J)for(const{edgeId:he}of J.values()){const _e=ae.get(he);_e&&(_e.selectable??Ee)&&A.current.add(he)}}if(!LG(Ae,j.current)){const De=_y(X,j.current,!0);Oe(De)}if(!LG(ze,A.current)){const De=_y(ae,A.current);ke(De)}y.setState({userSelectionRect:qe,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!_.current)return;const[se,re]=aB(T.current,_.current,E);S({x:se,y:re}).then(ge=>{if(!F.current||!ge){v.current=requestAnimationFrame(K);return}const{x:W,y:X}=T.current;H(W,X),v.current=requestAnimationFrame(K)})}const Q=()=>{cancelAnimationFrame(v.current),v.current=0,P.current=!1};p.useEffect(()=>()=>Q(),[]);const q=se=>{const{userSelectionRect:re,transform:ge,resetSelectedElements:W}=y.getState();if(!_.current||!re)return;const{x:X,y:ae}=_u(se.nativeEvent,_.current);T.current={x:X,y:ae};const ue=Wv({x:re.startX,y:re.startY},ge);if(!F.current){const Oe=t?0:s;if(Math.hypot(X-ue.x,ae-ue.y)<=Oe)return;W(),l==null||l(se)}F.current=!0,P.current||(K(),P.current=!0),H(X,ae)},B=se=>{var re,ge;se.button===0&&((ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),!x&&se.target===N.current&&y.getState().userSelectionRect&&(R==null||R(se)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(se),y.setState({nodesSelectionActive:j.current.size>0})),Q())},ee=se=>{var re,ge;(ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),Q()},le=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:ta(["react-flow__pane",{draggable:le,dragging:w,selection:e}]),onClick:C?void 0:aM(R,N),onContextMenu:aM(L,N),onWheel:aM(M,N),onPointerEnter:C?void 0:h,onPointerMove:C?q:m,onPointerUp:C?B:void 0,onPointerCancel:C?ee:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?U:void 0,onPointerLeave:g,ref:N,style:FR,children:[b,o.jsx(ett,{})]})}function f6({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fu.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function mwe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=ss(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=MJe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{f6({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,a]),c}const itt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function gwe(){const e=ss();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=itt(a),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(x=rE(x,s));const{position:O,positionAbsolute:w}=P1e({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=O,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const mB=p.createContext(null),rtt=mB.Provider;mB.Consumer;const bwe=()=>p.useContext(mB),stt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),att=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:a}=i,{fromHandle:l,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===Vv.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function ott({type:e="source",position:t=sn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var P,R;const g=a||null,b=e==="target",v=ss(),y=bwe(),{connectOnClick:x,noPanClassName:O,rfId:w}=_i(stt,rs),{connectingFrom:k,connectingTo:S,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:N,clickConnectionInProcess:_,valid:j}=_i(att(y,g,e),rs);y||(R=(P=v.getState()).onError)==null||R.call(P,"010",Fu.error010());const A=L=>{const{defaultEdgeOptions:M,onConnect:U,hasDefaultEdges:I}=v.getState(),H={...M,...L};if(I){const{edges:K,setEdges:Q,onError:q}=v.getState();Q(Uet(H,K,{onError:q}))}U==null||U(H),l==null||l(H)},F=L=>{if(!y)return;const M=U1e(L.nativeEvent);if(r&&(M&&L.button===0||!M)){const U=v.getState();d6.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:b,handleId:g,nodeId:y,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...I)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...I)},updateConnection:U.updateConnection,onConnect:A,isValidConnection:n||((...I)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...I))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}M?d==null||d(L):f==null||f(L)},T=L=>{const{onClickConnectStart:M,onClickConnectEnd:U,connectionClickStartHandle:I,connectionMode:H,isValidConnection:K,lib:Q,rfId:q,nodeLookup:B,connection:ee}=v.getState();if(!y||!I&&!r)return;if(!I){M==null||M(L.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const le=F1e(L.target),se=n||K,{connection:re,isValid:ge}=d6.isValid(L.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:se,flowId:q,doc:le,lib:Q,nodeLookup:B});ge&&re&&A(re);const W=structuredClone(ee);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,U==null||U(L,W),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${g}-${e}`,className:ta(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",O,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:S,valid:j,connectionindicator:i&&(!N||C)&&(N||_?s:r)}]),onMouseDown:F,onTouchStart:F,onClick:x?T:void 0,ref:m,...h,children:c})}const fl=p.memo(hwe(ott));function ltt({data:e,isConnectable:t,sourcePosition:n=sn.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function ctt({data:e,isConnectable:t,targetPosition:n=sn.Top,sourcePosition:i=sn.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(fl,{type:"source",position:i,isConnectable:t})]})}function utt(){return null}function dtt({data:e,isConnectable:t,targetPosition:n=sn.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const eN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cK={input:ltt,default:ctt,output:dtt,group:utt};function ftt(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 htt=e=>{const{width:t,height:n,x:i,y:r}=iE(e.nodeLookup,{filter:s=>!!s.selected});return{width:Au(t)?t:null,height:Au(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function ptt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ss(),{width:r,height:s,transformString:a,userSelectionActive:l}=_i(htt,rs),c=gwe(),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(mwe({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(eN,m.key)&&(m.preventDefault(),c({direction:eN[m.key],factor:m.shiftKey?4:1}))};return o.jsx("div",{className:ta(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const uK=typeof window<"u"?window:void 0,mtt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ywe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:C,autoPanOnSelection:N,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,preventScrolling:T,onSelectionContextMenu:P,noWheelClassName:R,noPanClassName:L,disableKeyboardA11y:M,onViewportChange:U,isControlledViewport:I}){const{nodesSelectionActive:H,userSelectionActive:K}=_i(mtt,rs),Q=DS(u,{target:uK}),q=DS(b,{target:uK}),B=q||C,ee=q||w,le=d&&B!==!0,se=Q||K||le;return Ket({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(Zet,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:ee,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!Q&&B,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:R,noPanClassName:L,onViewportChange:U,isControlledViewport:I,paneClickDistance:l,selectionOnDrag:le,children:o.jsxs(ntt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!se,selectionMode:f,selectionKeyPressed:Q,paneClickDistance:l,selectionOnDrag:le,children:[e,H&&o.jsx(ptt,{onSelectionContextMenu:P,noPanClassName:L,disableKeyboardA11y:M})]})})}ywe.displayName="FlowRenderer";const gtt=p.memo(ywe),btt=e=>t=>e?sB(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 ytt(e){return _i(p.useCallback(btt(e),[e]),rs)}const vtt=e=>e.updateNodeInternals;function xtt(){const e=_i(vtt),[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 wtt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=ss(),s=p.useRef(null),a=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(s.current),a.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function Ott({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:O,internals:w,isParent:k}=_i(se=>{const re=se.nodeLookup.get(e),ge=se.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ge}},rs);let S=O.type||"default",E=(v==null?void 0:v[S])||cK[S];E===void 0&&(x==null||x("003",Fu.error003(S)),S="default",E=(v==null?void 0:v.default)||cK.default);const C=!!(O.draggable||l&&typeof O.draggable>"u"),N=!!(O.selectable||c&&typeof O.selectable>"u"),_=!!(O.connectable||u&&typeof O.connectable>"u"),j=!!(O.focusable||d&&typeof O.focusable>"u"),A=ss(),F=lB(O),T=wtt({node:O,nodeType:S,hasDimensions:F,resizeObserver:f}),P=mwe({nodeRef:T,disabled:O.hidden||!C,noDragClassName:h,handleSelector:O.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:y}),R=gwe();if(O.hidden)return null;const L=Fh(O),M=ftt(O),U=N||C||t||n||i||r,I=n?se=>n(se,{...w.userNode}):void 0,H=i?se=>i(se,{...w.userNode}):void 0,K=r?se=>r(se,{...w.userNode}):void 0,Q=s?se=>s(se,{...w.userNode}):void 0,q=a?se=>a(se,{...w.userNode}):void 0,B=se=>{const{selectNodesOnDrag:re,nodeDragThreshold:ge}=A.getState();N&&(!re||!C||ge>0)&&f6({id:e,store:A,nodeRef:T}),t&&t(se,{...w.userNode})},ee=se=>{if(!(B1e(se.nativeEvent)||g)){if(_1e.includes(se.key)&&N){const re=se.key==="Escape";f6({id:e,store:A,unselect:re,nodeRef:T})}else if(C&&O.selected&&Object.prototype.hasOwnProperty.call(eN,se.key)){se.preventDefault();const{ariaLabelConfig:re}=A.getState();A.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),R({direction:eN[se.key],factor:se.shiftKey?4:1})}}},le=()=>{var ue;if(g||!((ue=T.current)!=null&&ue.matches(":focus-visible")))return;const{transform:se,width:re,height:ge,autoPanOnNodeFocus:W,setCenter:X}=A.getState();if(!W)return;sB(new Map([[e,O]]),{x:0,y:0,width:re,height:ge},se,!0).length>0||X(O.position.x+L.width/2,O.position.y+L.height/2,{zoom:se[2]})};return o.jsx("div",{className:ta(["react-flow__node",`react-flow__node-${S}`,{[m]:C},O.className,{selected:O.selected,selectable:N,parent:k,draggable:C,dragging:P}]),ref:T,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:F?"visible":"hidden",...O.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:K,onContextMenu:Q,onClick:B,onDoubleClick:q,onKeyDown:j?ee:void 0,tabIndex:j?0:void 0,onFocus:j?le:void 0,role:O.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${owe}-${b}`,"aria-label":O.ariaLabel,...O.domAttributes,children:o.jsx(rtt,{value:e,children:o.jsx(E,{id:e,data:O.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:O.selected??!1,selectable:N,draggable:C,deletable:O.deletable??!0,isConnectable:_,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:P,dragHandle:O.dragHandle,zIndex:w.z,parentId:O.parentId,...L})})})}var Stt=p.memo(Ott);const ktt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function vwe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=_i(ktt,rs),a=ytt(e.onlyRenderVisibleElements),l=xtt();return o.jsx("div",{className:"react-flow__nodes",style:FR,children:a.map(c=>o.jsx(Stt,{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))})}vwe.displayName="NodeRenderer";const Ett=p.memo(vwe);function Ctt(e){return _i(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);s&&a&&bJe({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),rs)}const Ttt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Att=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},dK={[RS.Arrow]:Ttt,[RS.ArrowClosed]:Att};function _tt(e){const t=ss();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(dK,e)?dK[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Fu.error009(e)),null)},[e])}const Ntt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=_tt(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},xwe=({defaultColor:e,rfId:t})=>{const n=_i(s=>s.edges),i=_i(s=>s.defaultEdgeOptions),r=p.useMemo(()=>EJe(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(s=>o.jsx(Ntt,{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};xwe.displayName="MarkerDefinitions";var jtt=p.memo(xwe);function wwe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=ta(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}wwe.displayName="EdgeText";const Rtt=p.memo(wwe);function sE({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:ta(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&Au(t)&&Au(n)?o.jsx(Rtt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function fK({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===sn.Left||e===sn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function Owe({sourceX:e,sourceY:t,sourcePosition:n=sn.Bottom,targetX:i,targetY:r,targetPosition:s=sn.Top}){const[a,l]=fK({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=fK({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=Q1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function Swe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,O,w]=Owe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(sE,{id:k,path:x,labelX:O,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const Itt=Swe({isInternal:!1}),kwe=Swe({isInternal:!0});Itt.displayName="SimpleBezierEdge";kwe.displayName="SimpleBezierEdgeInternal";function Ewe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=sn.Bottom,targetPosition:g=sn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=J_({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 o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const Cwe=Ewe({isInternal:!1}),Twe=Ewe({isInternal:!0});Cwe.displayName="SmoothStepEdge";Twe.displayName="SmoothStepEdgeInternal";function Awe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(Cwe,{...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 Ptt=Awe({isInternal:!1}),_we=Awe({isInternal:!0});Ptt.displayName="StepEdge";_we.displayName="StepEdgeInternal";function Nwe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,x]=H1e({sourceX:n,sourceY:i,targetX:r,targetY:s}),O=e.isInternal?void 0:t;return o.jsx(sE,{id:O,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const Dtt=Nwe({isInternal:!1}),jwe=Nwe({isInternal:!0});Dtt.displayName="StraightEdge";jwe.displayName="StraightEdgeInternal";function Rwe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=sn.Bottom,targetPosition:l=sn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=z1e({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:x})})}const Mtt=Rwe({isInternal:!1}),Iwe=Rwe({isInternal:!0});Mtt.displayName="BezierEdge";Iwe.displayName="BezierEdgeInternal";const hK={default:Iwe,straight:jwe,step:_we,smoothstep:Twe,simplebezier:kwe},pK={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Ltt=(e,t,n)=>n===sn.Left?e-t:n===sn.Right?e+t:e,$tt=(e,t,n)=>n===sn.Top?e-t:n===sn.Bottom?e+t:e,mK="react-flow__edgeupdater";function gK({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:a,className:ta([mK,`${mK}-${l}`]),cx:Ltt(t,i,e),cy:$tt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Ftt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=ss(),b=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:C,connectionRadius:N,lib:_,onConnectStart:j,cancelConnection:A,nodeLookup:F,rfId:T,panBy:P,updateConnection:R}=g.getState(),L=k.type==="target",M=(H,K)=>{h(!1),f==null||f(H,n,k.type,K)},U=H=>u==null?void 0:u(n,H),I=(H,K)=>{h(!0),d==null||d(w,n,k.type),j==null||j(H,K)};d6.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:N,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:F,isTarget:L,edgeUpdaterType:k.type,lib:_,flowId:T,cancelConnection:A,panBy:P,isValidConnection:(...H)=>{var K,Q;return((Q=(K=g.getState()).isValidConnection)==null?void 0:Q.call(K,...H))??!0},onConnect:U,onConnectStart:I,onConnectEnd:(...H)=>{var K,Q;return(Q=(K=g.getState()).onConnectEnd)==null?void 0:Q.call(K,...H)},onReconnectEnd:M,updateConnection:R,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>m(!0),O=()=>m(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(gK,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:O,type:"source"}),(e===!0||e==="target")&&o.jsx(gK,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:O,type:"target"})]})}function Btt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let O=_i(X=>X.edgeLookup.get(e));const w=_i(X=>X.defaultEdgeOptions);O=w?{...w,...O}:O;let k=O.type||"default",S=(b==null?void 0:b[k])||hK[k];S===void 0&&(y==null||y("011",Fu.error011(k)),k="default",S=(b==null?void 0:b.default)||hK.default);const E=!!(O.focusable||t&&typeof O.focusable>"u"),C=typeof f<"u"&&(O.reconnectable||n&&typeof O.reconnectable>"u"),N=!!(O.selectable||i&&typeof O.selectable>"u"),_=p.useRef(null),[j,A]=p.useState(!1),[F,T]=p.useState(!1),P=ss(),{zIndex:R,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K}=_i(p.useCallback(X=>{const ae=X.nodeLookup.get(O.source),ue=X.nodeLookup.get(O.target);if(!ae||!ue)return{zIndex:O.zIndex,...pK};const Oe=kJe({id:e,sourceNode:ae,targetNode:ue,sourceHandle:O.sourceHandle||null,targetHandle:O.targetHandle||null,connectionMode:X.connectionMode,onError:y});return{zIndex:gJe({selected:O.selected,zIndex:O.zIndex,sourceNode:ae,targetNode:ue,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode}),...Oe||pK}},[O.source,O.target,O.sourceHandle,O.targetHandle,O.selected,O.zIndex]),rs),Q=p.useMemo(()=>O.markerStart?`url('#${c6(O.markerStart,g)}')`:void 0,[O.markerStart,g]),q=p.useMemo(()=>O.markerEnd?`url('#${c6(O.markerEnd,g)}')`:void 0,[O.markerEnd,g]);if(O.hidden||L===null||M===null||U===null||I===null)return null;const B=X=>{var ke;const{addSelectedEdges:ae,unselectNodesAndEdges:ue,multiSelectionActive:Oe}=P.getState();N&&(P.setState({nodesSelectionActive:!1}),O.selected&&Oe?(ue({nodes:[],edges:[O]}),(ke=_.current)==null||ke.blur()):ae([e])),r&&r(X,O)},ee=s?X=>{s(X,{...O})}:void 0,le=a?X=>{a(X,{...O})}:void 0,se=l?X=>{l(X,{...O})}:void 0,re=c?X=>{c(X,{...O})}:void 0,ge=u?X=>{u(X,{...O})}:void 0,W=X=>{var ae;if(!x&&_1e.includes(X.key)&&N){const{unselectNodesAndEdges:ue,addSelectedEdges:Oe}=P.getState();X.key==="Escape"?((ae=_.current)==null||ae.blur(),ue({edges:[O]})):Oe([e])}};return o.jsx("svg",{style:{zIndex:R},children:o.jsxs("g",{className:ta(["react-flow__edge",`react-flow__edge-${k}`,O.className,v,{selected:O.selected,animated:O.animated,inactive:!N&&!r,updating:j,selectable:N}]),onClick:B,onDoubleClick:ee,onContextMenu:le,onMouseEnter:se,onMouseMove:re,onMouseLeave:ge,onKeyDown:E?W:void 0,tabIndex:E?0:void 0,role:O.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":O.ariaLabel===null?void 0:O.ariaLabel||`Edge from ${O.source} to ${O.target}`,"aria-describedby":E?`${lwe}-${g}`:void 0,ref:_,...O.domAttributes,children:[!F&&o.jsx(S,{id:e,source:O.source,target:O.target,type:O.type,selected:O.selected,animated:O.animated,selectable:N,deletable:O.deletable??!0,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,data:O.data,style:O.style,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerStart:Q,markerEnd:q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth}),C&&o.jsx(Ftt,{edge:O,isReconnectable:C,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,setUpdateHover:A,setReconnecting:T})]})})}var Utt=p.memo(Btt);const Qtt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Pwe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:O}=_i(Qtt,rs),w=Ctt(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(jtt,{defaultColor:e,rfId:n}),w.map(k=>o.jsx(Utt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:O,edgeTypes:i,disableKeyboardA11y:b},k))]})}Pwe.displayName="EdgeRenderer";const ztt=p.memo(Pwe),Vtt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Htt({children:e}){const t=_i(Vtt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function qtt(e){const t=$R(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Wtt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Gtt(e){const t=_i(Wtt),n=ss();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Ktt(e){return e.connection.inProgress?{...e.connection,to:$x(e.connection.to,e.transform)}:{...e.connection}}function Xtt(e){return Ktt}function Ytt(e){const t=Xtt();return _i(t,rs)}const Ztt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Jtt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=_i(Ztt,rs);return!(s&&r&&c)?null:o.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ta(["react-flow__connection",R1e(l)]),children:o.jsx(Dwe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const Dwe=({style:e,type:t=Np.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=Ytt();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:R1e(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 Np.Bezier:[g]=z1e(b);break;case Np.SimpleBezier:[g]=Owe(b);break;case Np.Step:[g]=J_({...b,borderRadius:0});break;case Np.SmoothStep:[g]=J_(b);break;default:[g]=H1e(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};Dwe.displayName="ConnectionLine";const ent={};function bK(e=ent){p.useRef(e),ss(),p.useEffect(()=>{},[e])}function tnt(){ss(),p.useRef(!1),p.useEffect(()=>{},[])}function Mwe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,preventScrolling:P,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:M,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:Q,autoPanOnSelection:q,onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneScroll:re,onPaneContextMenu:ge,paneClickDistance:W,nodeClickDistance:X,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:ke,reconnectRadius:st,onReconnect:Le,onReconnectStart:Me,onReconnectEnd:Ie,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:ze,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J,viewport:he,onViewportChange:_e}){return bK(e),bK(t),tnt(),qtt(n),Gtt(he),o.jsx(gtt,{onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneContextMenu:ge,onPaneScroll:re,paneClickDistance:W,deleteKeyCode:C,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:_,zoomOnScroll:L,zoomOnPinch:M,zoomOnDoubleClick:K,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:Q,autoPanOnSelection:q,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,onSelectionContextMenu:f,preventScrolling:P,noDragClassName:qe,noWheelClassName:Ae,noPanClassName:ze,disableKeyboardA11y:Ee,onViewportChange:_e,isControlledViewport:!!he,children:o.jsxs(Htt,{children:[o.jsx(ztt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:Le,onReconnectStart:Me,onReconnectEnd:Ie,onlyRenderVisibleElements:N,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:ke,reconnectRadius:st,defaultMarkerColor:R,noPanClassName:ze,disableKeyboardA11y:Ee,rfId:J}),o.jsx(Jtt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(Ett,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:X,onlyRenderVisibleElements:N,noPanClassName:ze,noDragClassName:qe,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}Mwe.displayName="GraphView";const nnt=p.memo(Mwe),int=L1e(),yK=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],x=n??e??[],O=d??[0,0],w=f??NS;G1e(b,v,y);const{nodesInitialized:k}=u6(x,m,g,{nodeOrigin:O,nodeExtent:w,zIndexMode:h});let S=[0,0,1];if(a&&r&&s){const E=iE(m,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:C,y:N,zoom:_}=oB(E,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[C,N,_]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:x,nodesInitialized:k,nodeLookup: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:NS,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vv.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:O,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...j1e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:int,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:N1e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rnt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>yet((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:O,width:w,height:k,minZoom:S,maxZoom:E}=g();y&&(await cJe({nodes:v,width:w,height:k,panZoom:y,minZoom:S,maxZoom:E},x),O==null||O.resolve(!0),m({fitViewResolver:null}))}return{...yK({nodes:e,edges:t,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:w,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:E}=g(),{nodesInitialized:C,hasSelectedNodes:N}=u6(v,y,x,{nodeOrigin:O,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:S}),_=E&&N;k&&C?(b(),m({nodes:v,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_})):m({nodes:v,nodesInitialized:C,nodesSelectionActive:_})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=g();G1e(y,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=g();x(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:x}=g();x(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:O,domNode:w,nodeOrigin:k,nodeExtent:S,debug:E,fitViewQueued:C,zIndexMode:N}=g(),{changes:_,updatedInternals:j}=RJe(v,x,O,w,k,S,N);j&&(AJe(x,O,{nodeOrigin:k,nodeExtent:S,zIndexMode:N}),C?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(_==null?void 0:_.length)>0&&(E&&console.log("React Flow: trigger node changes",_),y==null||y(_)))},updateNodePositions:(v,y=!1)=>{const x=[];let O=[];const{nodeLookup:w,triggerNodeChanges:k,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:C}=g();for(const[N,_]of v){const j=w.get(N),A=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(_!=null&&_.position)),F={id:N,type:"position",position:A?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:y};if(j&&S.inProgress&&S.fromNode.id===j.id){const T=kb(j,S.fromHandle,sn.Left,!0);E({...S,from:T})}A&&j.parentId&&x.push({id:N,parentId:j.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),O.push(F)}if(x.length>0){const{parentLookup:N,nodeOrigin:_}=g(),j=pB(x,w,N,_);O.push(...j)}for(const N of C.values())O=N(O);k(O)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:O,hasDefaultNodes:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=dwe(v,O);x(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:O,hasDefaultEdges:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=fwe(v,O);x(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));w(S);return}w(_y(O,new Set([...v]),!0)),k(_y(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));k(S);return}k(_y(x,new Set([...v]))),w(_y(O,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:O,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),E=v||O,C=y||x,N=[];for(const j of E){if(!j.selected)continue;const A=w.get(j.id);A&&(A.selected=!1),N.push(Og(j.id,!1))}const _=[];for(const j of C)j.selected&&_.push(Og(j.id,!1));k(N),S(_)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=g();y==null||y.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=g();y==null||y.setScaleExtent([x,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:x,triggerEdgeChanges:O,elementsSelectable:w}=g();if(!w)return;const k=y.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]),S=v.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]);x(k),O(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:O,nodeOrigin:w,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:E}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(u6(y,x,O,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:O,panZoom:w,translateExtent:k}=g();return IJe({delta:v,panZoom:w,transform:y,translateExtent:k,width:x,height:O})},setCenter:async(v,y,x)=>{const{width:O,height:w,maxZoom:k,panZoom:S}=g();if(!S)return!1;const E=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await S.setViewport({x:O/2-v*E,y:w/2-y*E,zoom:E},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...j1e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...yK()})}},Object.is);function Lwe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>rnt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(vet,{value:g,children:o.jsx(Het,{children:m})})}function snt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(MR)?o.jsx(o.Fragment,{children:e}):o.jsx(Lwe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const ant={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ont({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onSelectionChange:F,onSelectionDragStart:T,onSelectionDrag:P,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onBeforeDelete:I,connectionMode:H,connectionLineType:K=Np.Bezier,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,deleteKeyCode:ee="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:se=!1,selectionMode:re=jS.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:W=PS()?"Meta":"Control",zoomActivationKeyCode:X=PS()?"Meta":"Control",snapToGrid:ae,snapGrid:ue,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:ke,nodesDraggable:st,autoPanOnNodeFocus:Le,nodesConnectable:Me,nodesFocusable:Ie,nodeOrigin:qe=cwe,edgesFocusable:Ae,edgesReconnectable:ze,elementsSelectable:Ee=!0,defaultViewport:De=Iet,minZoom:J=.5,maxZoom:he=2,translateExtent:_e=NS,preventScrolling:Ze=!0,nodeExtent:at,defaultMarkerColor:wt="#b1b1b7",zoomOnScroll:Se=!0,zoomOnPinch:ve=!0,panOnScroll:He=!1,panOnScrollSpeed:Je=.5,panOnScrollMode:Ce=rb.Free,zoomOnDoubleClick:Wt=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:Ot,onPaneMouseMove:jt,onPaneMouseLeave:ot,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:Et=1,nodeClickDistance:bt=0,children:Mt,onReconnect:$e,onReconnectStart:ye,onReconnectEnd:Ue,onEdgeContextMenu:Ke,onEdgeDoubleClick:ft,onEdgeMouseEnter:ut,onEdgeMouseMove:Gt,onEdgeMouseLeave:Rt,reconnectRadius:zt=10,onNodesChange:Z,onEdgesChange:Bt,noDragClassName:Qe="nodrag",noWheelClassName:tt="nowheel",noPanClassName:ht="nopan",fitView:pe,fitViewOptions:We,connectOnClick:vt,attributionPosition:vn,proOptions:Ki,defaultEdgeOptions:Fe,elevateNodesOnSelect:Pt=!0,elevateEdgesOnSelect:pn=!1,disableKeyboardA11y:Jt=!1,autoPanOnConnect:en,autoPanOnNodeDrag:Un,autoPanOnSelection:wn=!0,autoPanSpeed:oi,connectionRadius:Oi,isValidConnection:mi,onError:bn,style:qi,id:ri,nodeDragThreshold:zi,connectionDragThreshold:as,viewport:Lr,onViewportChange:_r,width:xs,height:os,colorMode:ia="light",debug:Nr,onScroll:As,ariaLabelConfig:Vs,zIndexMode:Yr="basic",...ra},sa){const ls=ri||"1",va=Let(ia),aa=p.useCallback(ws=>{ws.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),As==null||As(ws)},[As]);return o.jsx("div",{"data-testid":"rf__wrapper",...ra,onScroll:aa,style:{...qi,...ant},ref:sa,className:ta(["react-flow",r,va]),id:ri,role:"application",children:o.jsxs(snt,{nodes:e,edges:t,width:xs,height:os,fitView:pe,fitViewOptions:We,minZoom:J,maxZoom:he,nodeOrigin:qe,nodeExtent:at,zIndexMode:Yr,children:[o.jsx(Met,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:st,autoPanOnNodeFocus:Le,nodesConnectable:Me,nodesFocusable:Ie,edgesFocusable:Ae,edgesReconnectable:ze,elementsSelectable:Ee,elevateNodesOnSelect:Pt,elevateEdgesOnSelect:pn,minZoom:J,maxZoom:he,nodeExtent:at,onNodesChange:Z,onEdgesChange:Bt,snapToGrid:ae,snapGrid:ue,connectionMode:H,translateExtent:_e,connectOnClick:vt,defaultEdgeOptions:Fe,fitView:pe,fitViewOptions:We,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:P,onSelectionDragStart:T,onSelectionDragStop:R,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ht,nodeOrigin:qe,rfId:ls,autoPanOnConnect:en,autoPanOnNodeDrag:Un,autoPanSpeed:oi,onError:bn,connectionRadius:Oi,isValidConnection:mi,selectNodesOnDrag:ke,nodeDragThreshold:zi,connectionDragThreshold:as,onBeforeDelete:I,debug:Nr,ariaLabelConfig:Vs,zIndexMode:Yr}),o.jsx(nnt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:a,connectionLineType:K,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,selectionKeyCode:le,selectionOnDrag:se,selectionMode:re,deleteKeyCode:ee,multiSelectionKeyCode:W,panActivationKeyCode:ge,zoomActivationKeyCode:X,onlyRenderVisibleElements:Oe,defaultViewport:De,translateExtent:_e,minZoom:J,maxZoom:he,preventScrolling:Ze,zoomOnScroll:Se,zoomOnPinch:ve,zoomOnDoubleClick:Wt,panOnScroll:He,panOnScrollSpeed:Je,panOnScrollMode:Ce,panOnDrag:ln,autoPanOnSelection:wn,onPaneClick:cn,onPaneMouseEnter:Ot,onPaneMouseMove:jt,onPaneMouseLeave:ot,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:Et,nodeClickDistance:bt,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onReconnect:$e,onReconnectStart:ye,onReconnectEnd:Ue,onEdgeContextMenu:Ke,onEdgeDoubleClick:ft,onEdgeMouseEnter:ut,onEdgeMouseMove:Gt,onEdgeMouseLeave:Rt,reconnectRadius:zt,defaultMarkerColor:wt,noDragClassName:Qe,noWheelClassName:tt,noPanClassName:ht,rfId:ls,disableKeyboardA11y:Jt,nodeExtent:at,viewport:Lr,onViewportChange:_r}),o.jsx(Ret,{onSelectionChange:F}),Mt,o.jsx(Tet,{proOptions:Ki,position:vn}),o.jsx(Cet,{rfId:ls,disableKeyboardA11y:Jt})]})})}var lnt=hwe(ont);const cnt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function unt({children:e}){const t=_i(cnt);return t?Li.createPortal(e,t):null}function dnt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>dwe(r,s)),[]);return[t,n,i]}function fnt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>fwe(r,s)),[]);return[t,n,i]}const hnt=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||!lB(n.userNode))return!1;return!0};function pnt(e={includeHiddenNodes:!1}){return _i(hnt(e))}function mnt({dimensions:e,lineWidth:t,variant:n,className:i}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ta(["react-flow__background-pattern",n,i])})}function gnt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ta(["react-flow__background-pattern","dots",t])})}var tm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tm||(tm={}));const bnt={[tm.Dots]:1,[tm.Lines]:1,[tm.Cross]:6},ynt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $we({id:e,variant:t=tm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=_i(ynt,rs),g=i||bnt[t],b=t===tm.Dots,v=t===tm.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],O=g*h[2],w=Array.isArray(s)?s:[s,s],k=v?[O,O]:x,S=[w[0]*h[2]||1+k[0]/2,w[1]*h[2]||1+k[1]/2],E=`${m}${e||""}`;return o.jsxs("svg",{className:ta(["react-flow__background",u]),style:{...c,...FR,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:E,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?o.jsx(gnt,{radius:O/2,className:d}):o.jsx(mnt,{dimensions:k,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}$we.displayName="Background";const vnt=p.memo($we);function xnt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function wnt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ont(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Snt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function knt(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function vT({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ta(["react-flow__controls-button",t]),...n,children:e})}const Ent=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Fwe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=ss(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=_i(Ent,rs),{zoomIn:O,zoomOut:w,fitView:k}=$R(),S=()=>{O(),s==null||s()},E=()=>{w(),a==null||a()},C=()=>{k(r),l==null||l()},N=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},_=h==="horizontal"?"horizontal":"vertical";return o.jsxs(LR,{className:ta(["react-flow__controls",_,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(vT,{onClick:S,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(xnt,{})}),o.jsx(vT,{onClick:E,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(wnt,{})})]}),n&&o.jsx(vT,{className:"react-flow__controls-fitview",onClick:C,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(Ont,{})}),i&&o.jsx(vT,{className:"react-flow__controls-interactive",onClick:N,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(knt,{}):o.jsx(Snt,{})}),d]})}Fwe.displayName="Controls";const Cnt=p.memo(Fwe);function Tnt({id:e,x:t,y:n,width:i,height:r,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:ta(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Ant=p.memo(Tnt),_nt=e=>e.nodes.map(t=>t.id),oM=e=>e instanceof Function?e:()=>e;function Nnt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Ant,onClick:a}){const l=_i(_nt,rs),c=oM(t),u=oM(e),d=oM(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(Rnt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function jnt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=_i(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:O,height:w}=Fh(v);return{node:v,x:y,y:x,width:O,height:w}},rs);return!u||u.hidden||!lB(u)?null:o.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}const Rnt=p.memo(jnt);var Int=p.memo(Nnt);const Pnt=200,Dnt=150,Mnt=e=>!e.hidden,Lnt=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?M1e(iE(e.nodeLookup,{filter:Mnt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$nt="react-flow__minimap-desc";function Bwe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:O=1,offsetScale:w=5}){const k=ss(),S=p.useRef(null),{boundingRect:E,viewBB:C,rfId:N,panZoom:_,translateExtent:j,flowWidth:A,flowHeight:F,ariaLabelConfig:T}=_i(Lnt,rs),P=(e==null?void 0:e.width)??Pnt,R=(e==null?void 0:e.height)??Dnt,L=E.width/P,M=E.height/R,U=Math.max(L,M),I=U*P,H=U*R,K=w*U,Q=E.x-(I-E.width)/2-K,q=E.y-(H-E.height)/2-K,B=I+K*2,ee=H+K*2,le=`${$nt}-${N}`,se=p.useRef(0),re=p.useRef();se.current=U,p.useEffect(()=>{if(S.current&&_)return re.current=QJe({domNode:S.current,panZoom:_,getTransform:()=>k.getState().transform,getViewScale:()=>se.current}),()=>{var ae;(ae=re.current)==null||ae.destroy()}},[_]),p.useEffect(()=>{var ae;(ae=re.current)==null||ae.update({translateExtent:j,width:A,height:F,inversePan:x,pannable:b,zoomStep:O,zoomable:v})},[b,v,x,O,j,A,F]);const ge=m?ae=>{var ke;const[ue,Oe]=((ke=re.current)==null?void 0:ke.pointer(ae))||[0,0];m(ae,{x:ue,y:Oe})}:void 0,W=g?p.useCallback((ae,ue)=>{const Oe=k.getState().nodeLookup.get(ue).internals.userNode;g(ae,Oe)},[]):void 0,X=y??T["minimap.ariaLabel"];return o.jsx(LR,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ta(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:P,height:R,viewBox:`${Q} ${q} ${B} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:S,onClick:ge,children:[X&&o.jsx("title",{id:le,children:X}),o.jsx(Int,{onClick:W,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-K},${q-K}h${B+K*2}v${ee+K*2}h${-B-K*2}z + M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Bwe.displayName="MiniMap";p.memo(Bwe);const Fnt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Bnt={[Gv.Line]:"right",[Gv.Handle]:"bottom-right"};function Unt({nodeId:e,position:t,variant:n=Gv.Handle,className:i,style:r=void 0,children:s,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=bwe(),O=typeof e=="string"?e:x,w=ss(),k=p.useRef(null),S=n===Gv.Handle,E=_i(p.useCallback(Fnt(S&&m),[S,m]),rs),C=p.useRef(null),N=t??Bnt[n];p.useEffect(()=>{if(!(!k.current||!O))return C.current||(C.current=tet({domNode:k.current,nodeId:O,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,domNode:R}=w.getState();return{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,paneDomNode:R}},onChange:(j,A)=>{const{triggerNodeChanges:F,nodeLookup:T,parentLookup:P,nodeOrigin:R}=w.getState(),L=[],M={x:j.x,y:j.y},U=T.get(O);if(U&&U.expandParent&&U.parentId){const I=U.origin??R,H=j.width??U.measured.width??0,K=j.height??U.measured.height??0,Q={id:U.id,parentId:U.parentId,rect:{width:H,height:K,...$1e({x:j.x??U.position.x,y:j.y??U.position.y},{width:H,height:K},U.parentId,T,I)}},q=pB([Q],T,P,R);L.push(...q),M.x=j.x?Math.max(I[0]*H,j.x):void 0,M.y=j.y?Math.max(I[1]*K,j.y):void 0}if(M.x!==void 0&&M.y!==void 0){const I={id:O,type:"position",position:{...M}};L.push(I)}if(j.width!==void 0&&j.height!==void 0){const H={id:O,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};L.push(H)}for(const I of A){const H={...I,type:"position"};L.push(H)}F(L)},onEnd:({width:j,height:A})=>{const F={id:O,type:"dimensions",resizing:!1,dimensions:{width:j,height:A}};w.getState().triggerNodeChanges([F])}})),C.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var j;(j=C.current)==null||j.destroy()}},[N,l,c,u,d,f,b,v,y,g]);const _=N.split("-");return o.jsx("div",{className:ta(["react-flow__resize-control","nodrag",..._,n,i]),ref:k,style:{...r,scale:E,...a&&{[S?"backgroundColor":"borderColor"]:a}},children:s})}p.memo(Unt);var Uwe=Object.defineProperty,Qnt=(e,t,n)=>t in e?Uwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,znt=(e,t)=>{for(var n in t)Uwe(e,n,{get:t[n],enumerable:!0})},Vnt=(e,t,n)=>Qnt(e,t+"",n),Qwe={};znt(Qwe,{Graph:()=>au,alg:()=>gB,json:()=>Vwe,version:()=>Wnt});var Hnt=Object.defineProperty,zwe=(e,t)=>{for(var n in t)Hnt(e,n,{get:t[n],enumerable:!0})},au=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(i=>{n!==void 0?this.setNode(i,n):this.setNode(i)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(i=>{this.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let i=n;i!==void 0;i=this.parent(i))if(i===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let i=new Set(n);for(let r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,a])=>{t(s)&&n.setNode(s,a)}),Object.values(this._edgeObjs).forEach(s=>{n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,this.edge(s))});let i={},r=s=>{let a=this.parent(s);return!a||n.hasNode(a)?(i[s]=a??void 0,a??void 0):a in i?i[a]:r(a)};return this._isCompound&&n.nodes().forEach(s=>n.setParent(s,r(s))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((i,r)=>(n!==void 0?this.setEdge(i,r,n):this.setEdge(i,r),r)),this}setEdge(t,n,i,r){let s,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(s=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(s=t,a=n,l=r,arguments.length>2&&(c=i,u=!0)),s=""+s,a=""+a,l!==void 0&&(l=""+l);let d=Pw(this._isDirected,s,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(s,a,l);let f=qnt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,vK(this._preds[a],s),vK(this._sucs[s],a),this._in[a][d]=f,this._out[s][d]=f,this._edgeCount++,this}edge(t,n,i){let r=arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i);return this._edgeLabels[r]}edgeAsObj(t,n,i){let r=arguments.length===1?this.edge(t):this.edge(t,n,i);return typeof r!="object"?{label:r}:r}hasEdge(t,n,i){return(arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?lM(this._isDirected,t):Pw(this._isDirected,t,n,i),s=this._edgeObjs[r];if(s){let a=s.v,l=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],xK(this._preds[l],a),xK(this._sucs[a],l),delete this._in[l][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,i){if(!t)return;let r=Object.values(t);return i?r.filter(s=>s.v===n&&s.w===i||s.v===i&&s.w===n):r}};function vK(e,t){e[t]?e[t]++:e[t]=1}function xK(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Pw(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let a=r;r=s,s=a}return r+""+s+""+(i===void 0?"\0":i)}function qnt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let a={v:r,w:s};return i&&(a.name=i),a}function lM(e,t){return Pw(e,t.v,t.w,t.name)}var Wnt="4.0.1",Vwe={};zwe(Vwe,{read:()=>Ynt,write:()=>Gnt});function Gnt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Knt(e),edges:Xnt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Knt(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 Xnt(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 Ynt(e){let t=new au(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var gB={};zwe(gB,{CycleException:()=>nN,bellmanFord:()=>Hwe,components:()=>eit,dijkstra:()=>tN,dijkstraAll:()=>iit,findCycles:()=>rit,floydWarshall:()=>ait,isAcyclic:()=>lit,postorder:()=>uit,preorder:()=>dit,prim:()=>fit,shortestPaths:()=>hit,tarjan:()=>Wwe,topsort:()=>Gwe});var Znt=()=>1;function Hwe(e,t,n,i){return Jnt(e,String(t),n||Znt,i||function(r){return e.outEdges(r)})}function Jnt(e,t,n,i){let r={},s,a=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function tN(e,t,n,i){let r=function(s){return e.outEdges(s)};return nit(e,String(t),n||tit,i||r)}function nit(e,t,n,i){let r={},s=new qwe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(a=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function iit(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=tN(e,r,t,n),i},{})}function Wwe(e){let t=0,n=[],i={},r=[];function s(a){let l=i[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(a!==u);r.push(c)}}return e.nodes().forEach(function(a){a in i||s(a)}),r}function rit(e){return Wwe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var sit=()=>1;function ait(e,t,n){return oit(e,t||sit,n||function(i){return e.outEdges(i)})}function oit(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(a){s!==a&&(i[s][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(a){let l=a.v===s?a.w:a.v,c=t(a);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let a=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=a[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=Kwe(e,l,n==="post",a,s,i,r)}),r}function Kwe(e,t,n,i,r,s,a){return t in i||(i[t]=!0,n||(a=s(a,t)),r(t).forEach(function(l){a=Kwe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function Xwe(e,t,n){return cit(e,t,n,function(i,r){return i.push(r),i},[])}function uit(e,t){return Xwe(e,t,"post")}function dit(e,t){return Xwe(e,t,"pre")}function fit(e,t){let n=new au,i={},r=new qwe,s;function a(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(a)}return n}function hit(e,t,n,i){return pit(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function pit(e,t,n,i){if(n===void 0)return tN(e,t,n,i);let r=!1,s=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function Ywe(e){let t=new au({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function wK(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,a=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*a>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(a=-a),c=a,u=a*s/r),{x:n+c,y:i+u}}function aE(e){let t=MS(Jwe(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 git(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Cd(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function bit(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Cd(Math.min,t),i=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;i[l]||(i[l]=[]),i[l].push(a)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((a,l)=>{a===void 0&&l%s!==0?--r:a!==void 0&&r&&a.forEach(c=>e.node(c).rank+=r)})}function OK(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Fx(e,"border",r,t)}function yit(e,t=Zwe){let n=[];for(let i=0;iZwe){let n=yit(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function Jwe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Cd(Math.max,t)}function vit(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function eOe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function tOe(e,t){return t()}var xit=0;function bB(e){let t=++xit;return e+(""+t)}function MS(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function wit(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var UR="\0",Oit="3.0.0",Sit=class{constructor(){Vnt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return SK(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&SK(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,kit)),n=n._prev;return"["+e.join(", ")+"]"}};function SK(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function kit(e,t){if(e!=="_next"&&e!=="_prev")return t}var Eit=Sit,Cit=()=>1;function Tit(e,t){if(e.nodeCount()<=1)return[];let n=_it(e,t||Cit);return Ait(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function Ait(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)cM(e,t,n,l);for(;l=s.dequeue();)cM(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(cM(e,t,n,l,!0)||[]);break}}}return r}function cM(e,t,n,i,r){let s=[],a=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,h6(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,h6(t,n,d)}),e.removeNode(i.v),a}function _it(e,t){let n=new au,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=Nit(r+i+3).map(()=>new Eit),a=i+1;return n.nodes().forEach(l=>{h6(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function h6(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 Nit(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,bB("rev"))});function t(n){return i=>n.edge(i).weight}}function Rit(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):r(a.w)}),delete n[s])}return e.nodes().forEach(r),t}function Iit(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 Pit(e){e.graph().dummyChains=[],e.edges().forEach(t=>Dit(e,t))}function Dit(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function yB(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),a=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=Cd(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function Kv(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var nOe=Lit;function Lit(e){let t=new au({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,a;for(;$it(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!Kv(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function Fit(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=Kv(t,i)),rt.node(i).rank+=n)}var{preorder:Uit,postorder:Qit}=gB,zit=Xb;Xb.initLowLimValues=xB;Xb.initCutValues=vB;Xb.calcCutValue=iOe;Xb.leaveEdge=sOe;Xb.enterEdge=aOe;Xb.exchangeEdges=oOe;function Xb(e){e=mit(e),yB(e);let t=nOe(e);xB(t),vB(t,e);let n,i;for(;n=sOe(t);)i=aOe(t,e,n),oOe(t,e,n,i)}function vB(e,t){let n=Qit(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>Vit(e,t,i))}function Vit(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=iOe(e,t,n)}function iOe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),a=0;s||(r=!1,s=t.edge(i,n)),a=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(a+=f?h:-h,qit(e,n,d)){let m=e.edge(n,d).cutvalue;a+=f?-m:m}}}),a}function xB(e,t){arguments.length<2&&(t=e.nodes()[0]),rOe(e,{},1,t)}function rOe(e,t,n,i,r){let s=n,a=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=rOe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function sOe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function aOe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),a=e.node(r),l=s,c=!1;return s.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===kK(e,e.node(u.v),l)&&c!==kK(e,e.node(u.w),l)).reduce((u,d)=>Kv(t,d)!e.node(r).parent);if(!n)return;let i=Uit(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,a=t.edge(r,s),l=!1;a||(a=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?a.minlen:-a.minlen)})}function qit(e,t,n){return e.hasEdge(t,n)}function kK(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Wit=Git;function Git(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":EK(e);break;case"tight-tree":Xit(e);break;case"longest-path":Kit(e);break;case"none":break;default:EK(e)}}var Kit=yB;function Xit(e){yB(e),nOe(e)}function EK(e){zit(e)}var Yit=Zit;function Zit(e){let t=ert(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=Jit(e,t,r.v,r.w),a=s.path,l=s.lca,c=0,u=a[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function ert(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(UR).forEach(i),t}function trt(e){let t=Fx(e,"root",{},"_root"),n=nrt(e),i=Object.values(n),r=Cd(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=irt(e)+1;e.children(UR).forEach(l=>lOe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function lOe(e,t,n,i,r,s,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=OK(e,"_bt"),d=OK(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var m;lOe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,x=b!==v?1:r-((m=s[a])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function nrt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(a=>n(a,r+1)),t[i]=r}return e.children(UR).forEach(i=>n(i,1)),t}function irt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function rrt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var srt=art;function art(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,a=r.maxRank+1;sTK(e.node(t))),e.edges().forEach(t=>TK(e.edge(t)))}function TK(e){let t=e.width;e.width=e.height,e.height=t}function crt(e){e.nodes().forEach(t=>uM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(uM),Object.hasOwn(i,"y")&&uM(i)})}function uM(e){e.y=-e.y}function urt(e){e.nodes().forEach(t=>dM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(dM),Object.hasOwn(i,"x")&&dM(i)})}function dM(e){let t=e.x;e.x=e.y,e.y=t}function drt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Cd(Math.max,i),s=MS(r+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),s}function frt(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 prt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function mrt(e,t){let n={};e.forEach((r,s)=>{let a={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(a.barycenter=r.barycenter,a.weight=r.weight),n[r.v]=a}),t.edges().forEach(r=>{let s=n[r.v],a=n[r.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(a))});let i=Object.values(n).filter(r=>!r.indegree);return grt(i)}function grt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&brt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>iN(r,["vs","i","barycenter","weight"]))}function brt(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 yrt(e,t){let n=vit(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],a=0,l=0,c=0;i.sort(vrt(!!t)),c=AK(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=AK(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function AK(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 vrt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function uOe(e,t,n,i){let r=e.children(t),s=e.node(t),a=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};a&&(r=r.filter(h=>h!==a&&h!==l));let u=prt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=uOe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&wrt(h,m)}});let d=mrt(u,n);xrt(d,c);let f=yrt(d,i);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function xrt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function wrt(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 Ort(e,t,n,i){i||(i=e.nodes());let r=Srt(e),s=new au({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(a=>e.node(a));return i.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(a),s.setParent(a,c||r);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=s.edge(f,a),m=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function Srt(e){let t;for(;e.hasNode(t=bB("_root")););return t}function krt(e,t,n){let i={},r;n.forEach(s=>{let a=e.parent(s),l,c;for(;a;){if(l=e.parent(a),l?(c=i[l],i[l]=a):(c=r,r=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function dOe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,dOe);return}let n=Jwe(e),i=_K(e,MS(1,n+1),"inEdges"),r=_K(e,MS(n-1,-1,-1),"outEdges"),s=drt(e);if(NK(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Ert(u%2?i:r,u%4>=2,c),s=aE(e);let f=frt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(a)};for(let s of e.nodes()){let a=e.node(s);if(typeof a.rank=="number"&&r(a.rank,s),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&r(l,s)}return t.map(function(s){return Ort(e,s,n,i.get(s)||[])})}function Ert(e,t,n){let i=new au;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=uOe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),krt(r,i,a.vs)})}function NK(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function Crt(e,t){let n={};function i(r,s){let a=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=Art(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),x=y.order;(x{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)&&fOe(n,m,f)})}})}function r(s,a){let l=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(a,u,f,l,c),u=f,l=c}}i(a,u,a.length,c,s.length)}),a}return t.length&&t.reduce(r),n}function Art(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function fOe(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 _rt(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 Nrt(e,t,n,i){let r={},s={},a={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=a[m],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let x=(y=s[v.v])!=null?y:0,O=a.edge(v);return Math.max(b,x+(O!==void 0?O:0))},0):s[m]=0}function d(m){let g=a.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,x)=>{let O=s[x.w],w=a.edge(x);return Math.min(y,(O!==void 0?O:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return a.predecessors(m)||[]}function h(m){return a.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function Rrt(e,t,n,i){let r=new au,s=e.graph(),a=Lrt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),r}function Irt(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=$rt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let a=r-s;return a{["l","r"].forEach(a=>{let l=s+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-Cd(Math.min,u);a!=="l"&&(d=r-Cd(Math.max,u)),d&&(e[l]=BR(c,f=>f+d))})})}function Drt(e,t=void 0){let n=e.ul;return n?BR(n,(i,r)=>{var s,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((a=l[2])!=null?a:0))/2}):{}}function Mrt(e){let t=aE(e),n=Object.assign(Crt(e,t),Trt(e,t)),i={},r;["u","d"].forEach(a=>{r=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=Nrt(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=jrt(e,r,c.root,c.align,l==="r");l==="r"&&(u=BR(u,d=>-d)),i[a+l]=u})});let s=Irt(e,i);return Prt(i,s),Drt(i,e.graph().align)}function Lrt(e,t,n){return(i,r,s)=>{let a=i.node(r),l=i.node(s),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function $rt(e,t){return e.node(t).width}function Frt(e){e=Ywe(e),Brt(e),Object.entries(Mrt(e)).forEach(([t,n])=>e.node(t).x=n)}function Brt(e){let t=aE(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(a=>{let l=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function Urt(e,t={}){let n=t.debugTiming?eOe:tOe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Yrt(e));return n(" runLayout",()=>Qrt(i,n,t)),n(" updateInputGraph",()=>zrt(e,i)),i})}function Qrt(e,t,n){t(" makeSpaceForEdgeLabels",()=>Zrt(e)),t(" removeSelfEdges",()=>ost(e)),t(" acyclic",()=>jit(e)),t(" nestingGraph.run",()=>trt(e)),t(" rank",()=>Wit(Ywe(e))),t(" injectEdgeLabelProxies",()=>Jrt(e)),t(" removeEmptyRanks",()=>bit(e)),t(" nestingGraph.cleanup",()=>rrt(e)),t(" normalizeRanks",()=>git(e)),t(" assignRankMinMax",()=>est(e)),t(" removeEdgeLabelProxies",()=>tst(e)),t(" normalize.run",()=>Pit(e)),t(" parentDummyChains",()=>Yit(e)),t(" addBorderSegments",()=>srt(e)),t(" order",()=>dOe(e,n)),t(" insertSelfEdges",()=>lst(e)),t(" adjustCoordinateSystem",()=>ort(e)),t(" position",()=>Frt(e)),t(" positionSelfEdges",()=>cst(e)),t(" removeBorderNodes",()=>ast(e)),t(" normalize.undo",()=>Mit(e)),t(" fixupEdgeLabelCoords",()=>rst(e)),t(" undoCoordinateSystem",()=>lrt(e)),t(" translateGraph",()=>nst(e)),t(" assignNodeIntersects",()=>ist(e)),t(" reversePoints",()=>sst(e)),t(" acyclic.undo",()=>Iit(e))}function zrt(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 Vrt=["nodesep","edgesep","ranksep","marginx","marginy"],Hrt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},qrt=["acyclicer","ranker","rankdir","align","rankalign"],Wrt=["width","height","rank"],jK={width:0,height:0},Grt=["minlen","weight","width","height","labeloffset"],Krt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Xrt=["labelpos"];function Yrt(e){let t=new au({multigraph:!0,compound:!0}),n=hM(e.graph());return t.setGraph(Object.assign({},Hrt,fM(n,Vrt),iN(n,qrt))),e.nodes().forEach(i=>{let r=hM(e.node(i)),s=fM(r,Wrt);Object.keys(jK).forEach(l=>{s[l]===void 0&&(s[l]=jK[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=hM(e.edge(i));t.setEdge(i,Object.assign({},Krt,fM(r,Grt),iN(r,Xrt)))}),t}function Zrt(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 Jrt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Fx(e,"edge-proxy",r,"_ep")}})}function est(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 tst(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 nst(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),a=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+a,s.height=r-i+l}function ist(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,a;n.points?(s=n.points[0],a=n.points[n.points.length-1]):(n.points=[],s=r,a=i),n.points.unshift(wK(i,s)),n.points.push(wK(r,a))})}function rst(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 sst(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function ast(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function ost(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 lst(e){aE(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Fx(e,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function cst(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,a=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:a-c},{x:s+5*l/6,y:a-c},{x:s+l,y:a},{x:s+5*l/6,y:a+c},{x:s+2*l/3,y:a+c}],i.label.x=n.x,i.label.y=n.y}})}function fM(e,t){return BR(iN(e,t),Number)}function hM(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function ust(e){let t=aE(e),n=new au({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var dst={graphlib:Qwe,version:Oit,layout:Urt,debug:ust,util:{time:eOe,notime:tOe}},RK=dst;/*! For license information please see dagre.esm.js.LEGAL.txt */const Dw={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Cbe},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:E7e},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:s7e},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Nbe},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:Zj}},p6=220,m6=88,IK=96,PK=34,kO=64,pM=310,Ny=24,hOe=56,g6=40,DK=40,fst=18,hst=58,pst=!1,mst=e=>e==="sequential"||e==="parallel"||e==="loop";function b6(e,t){const n=e.agentType??"llm";return mst(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function y6(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!b6(e,t))return{width:p6,height:m6};if(i&&e.subAgents.length===0)return{width:pM,height:kO};const s=e.subAgents.map((f,h)=>y6(f,[...t,h],n,i)),a=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?hOe:Ny,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?fst+DK:r==="loop"?hst:0:DK;return u?{width:Math.max(pM,s.reduce((f,h)=>f+h.width,0)+g6*Math.max(0,s.length-1)+c*2),height:kO+Ny+l+d+Ny}:{width:Math.max(pM,a+Ny*2),height:kO+c+s.reduce((f,h)=>f+h.height,0)+g6*Math.max(0,s.length-1)+d+c}}function B1(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function gst(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function MK(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function U1(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:RS.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function LK(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function a(f,h,m,g,b){const v=f.agentType??"llm",y=B1(h);return b6(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(Dw[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=B1(h),x=y6(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:x.width,height:x.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(Dw[v].labelKey)),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:x.width,layoutHeight:x.height,compactEmptyGroup:n&&f.subAgents.length===0}});const O=f.subAgents.map((C,N)=>y6(C,[...h,N],t,n)),w=O.length&&v!=="parallel"?hOe:Ny,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=w;const E=f.subAgents.map((C,N)=>{const _=O[N],j=k?{x:S,y:kO+Ny}:{x:(x.width-_.width)/2,y:kO+S};return S+=(k?_.width:_.height)+g6,a(C,[...h,N],y,j,v)});if(v==="sequential"||v==="loop"){for(let C=0;C1&&s.push(U1(E[E.length-1],E[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=B1(h);if(b6(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(Dw[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const x=[...h,y],O=B1(x);s.push(U1(g,O,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,x))}),b},u=B1([]),d=c(e,[]);return s.push(U1("terminal-input",u)),d.forEach(f=>s.push(U1(f,"terminal-output"))),bst(r,s,t)}function bst(e,t,n){const i=new RK.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const a=s.data.kind==="terminal";i.setNode(s.id,{width:a?IK:s.data.layoutWidth??p6,height:a?PK:s.data.layoutHeight??m6})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),RK.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?IK:s.data.layoutWidth??p6,u=l?PK:s.data.layoutHeight??m6;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const QR=p.createContext(null),zR=p.createContext("horizontal");function yst({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(QR),[m,g]=p.useState(!1),[b,v,y]=J_({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(sE,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&o.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&o.jsx(unt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:x=>{x.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(Fo,{})})]})})]})}function vst({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(QR),r=p.useContext(zR),s=r==="vertical"?sn.Top:sn.Left,a=r==="vertical"?sn.Bottom:sn.Right,l=r==="vertical"?sn.Right:sn.Bottom,c=e.pattern??"llm",u=Dw[c],d=u.icon;return o.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(d,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:n(u.labelKey)})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function xst({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(QR),r=p.useContext(zR),s=r==="vertical"?sn.Top:sn.Left,a=r==="vertical"?sn.Bottom:sn.Right,l=r==="vertical"?sn.Right:sn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return o.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:o.jsx(Fo,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:o.jsx(Fo,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx(Fo,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx(Fo,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function wst({data:e}){const t=p.useContext(zR);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(fl,{type:"target",position:t==="vertical"?sn.Top:sn.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(fl,{type:"source",position:t==="vertical"?sn.Bottom:sn.Right,className:"abc-handle"})]})}const Ost={agent:vst,group:xst,terminal:wst},Sst={insertStep:yst};function kst({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>LK(e,c,a,u),[]),[f,h,m]=dnt(d.nodes),[g,b,v]=fnt(d.edges),y=pnt(),x=p.useRef(`${c}:${a?"readonly":"editable"}:${MK(e)}`),O=p.useRef(null),{fitView:w}=$R(),k=p.useMemo(()=>LK(e,c,a,u),[c,e,a,u]),[S,E]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=p.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),N=p.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=O.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&j<8){N(j+1);return}w(C)})})},[C,w]);p.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),A=F=>E(F.matches);return j.addEventListener("change",A),()=>j.removeEventListener("change",A)},[]),p.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${MK(e)}`,A=j!==x.current;x.current=j,b(k.edges),h(F=>{const T=new Map(F.map(P=>[P.id,P]));return k.nodes.map(P=>{const R=T.get(P.id);return{...P,measured:!A&&R&&R.type===P.type?R.measured:void 0,position:!A&&R?R.position:P.position,selected:P.data.kind==="agent"&&!!P.data.path&&gst(P.data.path,t)}})}),A&&N()},[k,e,N,t,b,h]),p.useEffect(()=>{N()},[S,N]),p.useEffect(()=>{y&&N()},[k,N,y]),p.useEffect(()=>{if(!a||!O.current)return;const j=new ResizeObserver(()=>N());return j.observe(O.current),N(),()=>j.disconnect()},[N,a]);const _=p.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(zR.Provider,{value:c,children:o.jsx(QR.Provider,{value:_,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":u(a?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:o.jsx("div",{ref:O,className:"abc-canvas",children:o.jsxs(lnt,{nodes:f,edges:g,nodeTypes:Ost,edgeTypes:Sst,onNodesChange:m,onEdgesChange:v,onNodeClick:(j,A)=>{!a&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:C,onInit:()=>N(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[o.jsx(vnt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(Cnt,{showInteractive:!1}),pst]})})})})})}function LS(e){return o.jsx(Lwe,{children:o.jsx(kst,{...e})})}an.hasResourceBundle("en-US","create")||an.addResourceBundle("en-US","create",wse,!0,!0);an.hasResourceBundle("zh-CN","create")||an.addResourceBundle("zh-CN","create",$ce,!0,!0);function $t(e,t={}){return an.t(e,{...t,ns:"create"})}function oE(e,t){return e.map(n=>({...n,get label(){return $t(`${t}.${n.id}.label`)},get desc(){return $t(`${t}.${n.id}.description`)}}))}function qc(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>$t(r)});return n}const pOe="https://ark.cn-beijing.volces.com/api/v3/";qc({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const pA=[qc({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:pOe}],rN=[],sN={get label(){return $t("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Est={get label(){return $t("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},mOe="https://api.vikingdb.cn-beijing.volces.com/openviking",Cst=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,Cst=[{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}],Tst=[qc({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),qc({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),qc({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],Mw=[qc({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),qc({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],nv={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function VR(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:nv.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return nv}const mOe=[qc({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),qc({key:"REGISTRY_TOP_K",required:!1,placeholder:nv.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),qc({key:"REGISTRY_REGION",required:!1,placeholder:nv.region},{comment:"traditional.catalog.env.registryRegion.comment"}),qc({key:"REGISTRY_ENDPOINT",required:!1,placeholder:nv.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],Bx=oE([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:rN},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:rN},{id:"link_reader",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",get comment(){return $t("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return $t("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"),Ast=new Set(["web_scraper","text_to_speech","vesearch"]),_st=new Set(["web_search","parallel_web_search"]),Nst=Bx.filter(e=>!Ast.has(e.id));function gOe(e="volcengine"){const t=e==="byteplus"?_st:new Set;return Nst.filter(n=>!t.has(n.id))}const iv=oE([{id:"local",env:[]},{id:"sqlite",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],"traditional.backends.shortTerm"),v6=oE([{id:"local",env:pA,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:Tst},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:pOe,get comment(){return $t("traditional.catalog.env.openVikingUrl.comment")},link:sN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:sN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return $t("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return $t("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Est,get comment(){return $t("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return $t("traditional.catalog.env.openVikingMemoryPolicy.help")},link:kst}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),nm="viking",x6=oE([{id:"viking",env:Cst},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...rN,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:pOe,get comment(){return $t("traditional.catalog.env.openVikingUrl.comment")},link:sN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:sN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return $t("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return $t("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return $t("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return $t("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),jst=oE([{id:"apmplus",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",enableFlag:"ENABLE_TLS",env:[...rN,qc({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function oc(e="volcengine"){return{name:"",description:$t("defaults.description"),instruction:$t("defaults.instruction"),dynamicAgentDelegation:!1,agentType:"llm",cloudProvider:e,maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:wh(e),modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:nm,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function Q1(e){return{id:e,get displayName(){return $t(`traditional.optimization.options.${e}.label`)},get description(){return $t(`traditional.optimization.options.${e}.description`)}}}const wB=[Q1("context_engine"),Q1("compressor"),Q1("verifier"),Q1("long_run_control"),Q1("mcp_resilience")],Rst=[{id:"quality",get displayName(){return $t("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return $t("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return $t("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],Ux=wB.map(e=>e.id);function Ist(e){return e==="byteplus"?$t("traditional.optimization.bytePlusUnavailable"):null}const bOe=["context_engine","compressor","verifier","long_run_control"],Pst=new Set(["1","true","yes","on"]),OB=[{id:"default",get displayName(){return $t("traditional.optimization.profiles.default.label")},get description(){return $t("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return $t("traditional.optimization.profiles.ops.label")},get description(){return $t("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function mA(e){var t;return((t=wB.find(n=>n.id===e))==null?void 0:t.displayName)??e}function Dst(e){var t;return((t=OB.find(n=>n.id===e))==null?void 0:t.displayName)??e}function SB(e){const t=OB.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Lg(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(Ux.map(r=>[r,n.has(r)]))}}function kB(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?SB(t):Ux.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Lg(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function mM(e){return Pst.has((e==null?void 0:e.trim().toLowerCase())??"")}function Mst(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 Lst(e){var a;const t=new Map((e==null?void 0:e.map(({key:l,value:c})=>[l,c]))??[]),n=t.get("HARNESS_SIDECAR_ENABLED");if(n===void 0)return null;const i=((a=t.get("HARNESS_PROFILE"))==null?void 0:a.trim())==="ops"?"ops":"default";if(!mM(n))return Lg([],i);const r=Mst(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Lg(Ux.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?kB(l)??l:l}if(i==="ops")return Lg(SB(i),i);const s=[...mM(t.get("HARNESS_MODEL_PROXY_ENABLED"))?bOe:[],...mM(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Lg(s,i),enabled:!0}}function $st(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function Fst(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function aN(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?Ux.filter(i=>t[i]):[]}function Bst(e){const t=new Set(aN(e));return bOe.filter(n=>t.has(n))}function Ust(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var a,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((a=r.url)==null?void 0:a.trim())??"",credentialSourceAuthTokenEnv:((l=r.authTokenEnv)==null?void 0:l.trim())??""}:{}}}),subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(r=>({...r,agent:n(r.agent)}))}}:{}});return n(e)}function Yb(e){const t=(e==null?void 0:e.trim())??"",n=t.indexOf("/");return n<=0||n===t.length-1?{modelName:t,modelProvider:""}:{modelName:t.slice(n+1),modelProvider:t.slice(0,n)}}function EB(e){return Yb(e).modelName}function yOe(e,t,n,i=!1){var c,u,d,f;const r=Yb((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],a=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&a==="llm"?"a2a":a??e.agentType;return{...e,name:((u=t==null?void 0:t.name)==null?void 0:u.trim())||((d=n==null?void 0:n.name)==null?void 0:d.trim())||e.name,description:(t==null?void 0:t.description)??e.description,instruction:i?e.instruction:(t==null?void 0:t.instruction)??e.instruction,agentType:l,modelName:r.modelName||e.modelName,modelProvider:r.modelProvider||e.modelProvider,skills:((f=t==null?void 0:t.skills)==null?void 0:f.map(h=>h.name))??e.skills,subAgents:e.subAgents.map((h,m)=>yOe(h,s[m],void 0,i))}}function Qst(e,t){const n=new Map(t.map(({key:a,value:l})=>[a,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(a=>n.has(a)))return e;const r=(a,l)=>n.has(a)?n.get(a)??"":l??"",s=a=>{var l;return{...a,...(l=a.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...a.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",a.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",a.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",a.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",a.a2aRegistry.registryEndpoint)}}:{},subAgents:a.subAgents.map(s)}};return s(e)}function w6(e,t){var c,u,d;const n=e.cloudProvider??t,i=oc(n),r=e.deployment,s=r==null?void 0:r.network,a=e.cloudEnvironment,l=e.a2aRegistry;return{...i,...e,name:e.name??i.name,description:e.description??i.description,instruction:e.instruction??i.instruction,agentType:e.agentType??i.agentType,cloudProvider:n,maxIterations:e.maxIterations??i.maxIterations,a2aUrl:e.a2aUrl??i.a2aUrl,model:e.model??void 0,modelSource:e.modelSource==="ark"||e.modelSource==="custom"?e.modelSource:void 0,modelName:e.modelName??i.modelName,modelProvider:e.modelProvider??i.modelProvider,modelApiBase:e.modelApiBase??i.modelApiBase,memory:{shortTerm:((c=e.memory)==null?void 0:c.shortTerm)??i.memory.shortTerm,longTerm:((u=e.memory)==null?void 0:u.longTerm)??i.memory.longTerm},tools:[...e.tools??[]],skills:[...e.skills??[]],knowledgebase:e.knowledgebase??i.knowledgebase,tracing:e.tracing??i.tracing,harnessSidecar:kB(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>w6(f,n)),builtinTools:[...e.builtinTools??[]],customTools:[...e.customTools??[]],mcpTools:[...e.mcpTools??[]],a2aRegistry:{...i.a2aRegistry,...l??{},enabled:(l==null?void 0:l.enabled)??!1,registrySpaceId:(l==null?void 0:l.registrySpaceId)??"",registryTopK:(l==null?void 0:l.registryTopK)??"",registryRegion:(l==null?void 0:l.registryRegion)??"",registryEndpoint:(l==null?void 0:l.registryEndpoint)??""},shortTermBackend:e.shortTermBackend??i.shortTermBackend,longTermBackend:e.longTermBackend??i.longTermBackend,longTermMemoryIndex:e.longTermMemoryIndex??i.longTermMemoryIndex,autoSaveSession:e.autoSaveSession??i.autoSaveSession,knowledgebaseBackend:e.knowledgebaseBackend??i.knowledgebaseBackend,knowledgebaseIndex:e.knowledgebaseIndex??i.knowledgebaseIndex,tracingExporters:[...e.tracingExporters??[]],selectedSkills:[...e.selectedSkills??[]],cloudEnvironment:{...i.cloudEnvironment,...a??{},cliTools:[...(a==null?void 0:a.cliTools)??[]],dockerfile:typeof(a==null?void 0:a.dockerfile)=="string"?a.dockerfile:void 0},deployment:{...i.deployment,...r??{},feishuEnabled:(r==null?void 0:r.feishuEnabled)??!1,runtimeName:(r==null?void 0:r.runtimeName)??void 0,runtimeNameCustomized:(r==null?void 0:r.runtimeNameCustomized)??((d=i.deployment)==null?void 0:d.runtimeNameCustomized),network:s?{...s,vpcId:s.vpcId??"",subnetIds:s.subnetIds??"",enableSharedInternetAccess:s.enableSharedInternetAccess??!1}:void 0,modelApiKeyId:(r==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:(r==null?void 0:r.modelApiKeyName)??"",envValues:(r==null?void 0:r.envValues)??void 0},...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(f=>({...f,agent:w6(f.agent,n)}))}}:{}}}const zst=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],Vst=["collect_resources","create_agents","handoff_to"];function Hst(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function qst(e){const t=zst.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,a=Hst(e.slice(i,s));return Vst.every(l=>a.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function Wst(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?qst(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 vOe(e,t){var l,c;const n=oc(t),i=[...e.tools??[]],r=Bx.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),a=Yb(e.model);return{...n,modelSource:void 0,name:((l=e.name)==null?void 0:l.trim())??"",description:e.description??"",instruction:e.instruction||n.instruction,agentType:e.type??"llm",modelName:a.modelName,modelProvider:a.modelProvider,tools:i.filter(u=>!s.has(u)),builtinTools:r.map(u=>u.id),skills:((c=e.skills)==null?void 0:c.map(u=>u.name))??[],subAgents:(e.children??[]).map(u=>vOe(u,t))}}function CB(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=Yb(e.model),s=e.draft?w6(e.draft,i):e.graph?vOe(e.graph,i):{...oc(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||oc(i).instruction,agentType:e.type??"llm",modelName:r.modelName,modelProvider:r.modelProvider,tools:[...e.tools??[]],skills:((u=e.skills)==null?void 0:u.map(f=>f.name))??[]},a=e.draft&&s.dynamicAgentDelegation===!0?Wst(s):s;return Ust(yOe(a,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function Gst(e,t){const n=i=>{var s;const r=((s=i.modelName)==null?void 0:s.trim())??"";return{...i,modelSource:i.agentType==="llm"||!i.agentType?t.has(r)?"ark":"custom":i.modelSource,subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(a=>({...a,agent:n(a.agent)}))}}:{}}};return n(e)}function $K({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}const Kst={coding:"studioTools.labels.coding",get_city_weather:"studioTools.labels.get_city_weather",get_location_weather:"studioTools.labels.get_location_weather",web_fetch:"studioTools.labels.web_fetch"};function xOe(e,t){const n=Bx.find(r=>r.id===e||r.toolNames.includes(e)),i=Kst[e];return i?t(i):(n==null?void 0:n.label)??e}function Xst(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Yst(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Zst({agentName:e,tools:t,selectedIds:n,loading:i,disabled:r,unavailableReason:s,onChange:a,onClose:l}){const{t:c}=Te("workspaceTools"),[u,d]=p.useState(""),f=p.useMemo(()=>new Set(n),[n]),h=p.useRef(`studio-tool-${Math.random().toString(36).slice(2)}`),m=p.useMemo(()=>{const b=u.trim().toLowerCase();return b?t.filter(v=>`${v.name} ${v.id} ${v.description}`.toLowerCase().includes(b)):t},[u,t]);p.useEffect(()=>{const b=document.body.style.overflow;document.body.style.overflow="hidden";const v=y=>{y.key==="Escape"&&l()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),document.body.style.overflow=b}},[l]);const g=b=>{const v=new Set(f);v.has(b)?v.delete(b):v.add(b),a([...v])};return Li.createPortal(o.jsxs("div",{className:"studio-tool-dialog-layer",children:[o.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("studioTools.closeDialog"),onClick:l}),o.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true","aria-labelledby":h.current,children:[o.jsxs("header",{className:"studio-tool-dialog-head",children:[o.jsx("span",{className:"studio-tool-dialog-mark",children:o.jsx($K,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:h.current,children:c("studioTools.title")}),o.jsx("p",{children:c("studioTools.description",{agentName:e})})]}),o.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("studioTools.close"),onClick:l,children:o.jsx(Xst,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(Yst,{}),o.jsx("input",{value:u,"aria-label":c("studioTools.searchAria"),placeholder:c("studioTools.searchPlaceholder"),autoFocus:!0,onChange:b=>d(b.target.value)})]}),o.jsx("div",{className:"studio-tool-picker",role:"list","aria-label":c("studioTools.availableAria"),children:i?o.jsx("div",{className:"studio-tool-empty",children:c("studioTools.loading")}):s?o.jsx("div",{className:"studio-tool-empty",children:s}):m.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("studioTools.noMatch")}):m.map(b=>{const v=f.has(b.id);return o.jsxs("article",{className:"studio-tool-option",role:"listitem",children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx($K,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:b.name||xOe(b.id,c)}),o.jsx("code",{children:b.id}),o.jsx("span",{children:b.description})]}),o.jsx("button",{type:"button",disabled:r,"aria-pressed":v,onClick:()=>g(b.id),children:c(v?"studioTools.remove":"studioTools.add")})]},b.id)})})]})]})]}),document.body)}function xn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...a}){const l=Math.min(Math.max(i,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:r})}const oN=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],wOe=[{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 基础镜像"}],TB="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",OOe={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"},SOe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],Jst={"python-3.10":"3.10.18","python-3.12":"3.12.11"},AB=[{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"}]}],eat=AB.flatMap(e=>e.options),tat=["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"],nat=["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"],iat={"ubuntu-22.04":["libasound2","libatk-bridge2.0-0","libatk1.0-0","libatspi2.0-0","libcairo2","libcups2","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0","libnspr4","libnss3","libpango-1.0-0","libwayland-client0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"],"ubuntu-24.04":["libasound2t64","libatk-bridge2.0-0t64","libatk1.0-0t64","libatspi2.0-0t64","libcairo2","libcups2t64","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0t64","libnspr4","libnss3","libpango-1.0-0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"]};function z1(e,t){for(const n of t)e.includes(n)||e.push(n)}function rat(e,t,n,i,r){const s=["ca-certificates"];r||z1(s,i?[`python${n}`,`python${n}-venv`]:tat);for(const a of t)a.id==="playwright"||a.id==="chromium"||(a.installer==="apt"&&z1(s,[a.packageName]),a.id==="opencli"&&z1(s,["curl","xz-utils"]));return e.optionIds.some(a=>a==="playwright"||a==="chromium")&&(z1(s,nat),z1(s,iat[e.operatingSystem])),s}const gM={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function oh(e){var t;return((t=SOe.find(n=>n.id===e))==null?void 0:t.label)??e}function O6(e){var t;return((t=oN.find(n=>n.id===e))==null?void 0:t.label)??e}function S6(e){var t;return((t=wOe.find(n=>n.id===e))==null?void 0:t.label)??e}function sat(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 _B(e,t="volcengine"){const n=eat.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,a=s?"python-3.12":e.language,l=a.replace("python-",""),c=Jst[a],u=oN.find(b=>b.id===e.operatingSystem)??oN[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=rat(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${TB}`,"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=${OOe[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 aat(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function oat(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function k6(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 7.25A2.25 2.25 0 0 1 7.25 5h9.5A2.25 2.25 0 0 1 19 7.25v9.5A2.25 2.25 0 0 1 16.75 19h-9.5A2.25 2.25 0 0 1 5 16.75v-9.5Z",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M8.5 9.25 11 12l-2.5 2.75M12.75 14.75h2.75",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function kOe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25A2.25 2.25 0 0 1 7 5h3l1.5 2h5.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17 19H7a2.25 2.25 0 0 1-2.25-2.25v-9.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function lat(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function FK(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function BK(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function rl(e){return`${e.environment_id}\0${e.environment_version_id}`}function EO(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function gA(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?EO(i):null;return r?[r]:[]})}function cat({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:a,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,x]=p.useState(()=>new Set(i)),[O,w]=p.useState(()=>{const A=new Set(t.filter(F=>i.includes(F.id)).flatMap(F=>F.environmentIds));return new Set(n.filter(F=>!A.has(F.environment_id)).map(rl))}),k=p.useMemo(()=>new Set(t.filter(A=>y.has(A.id)).flatMap(A=>A.environmentIds)),[y,t]),S=p.useMemo(()=>{const A=new Set(O);for(const F of t)if(y.has(F.id))for(const T of gA(F,v))A.add(rl(T));return A},[O,y,v,t]),E=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?e.filter(F=>`${F.name} ${F.description} ${oh(F.language)}`.toLocaleLowerCase().includes(A)):e},[e,u]),C=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?t.filter(F=>{const T=F.environmentIds.map(P=>{var R;return((R=v.get(P))==null?void 0:R.name)??""}).join(" ");return`${F.name} ${F.description} ${T}`.toLocaleLowerCase().includes(A)}):t},[v,u,t]);p.useEffect(()=>{const A=document.body.style.overflow,F=T=>{T.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",F),()=>{document.body.style.overflow=A,document.removeEventListener("keydown",F)}},[l,f]);const N=A=>{const F=EO(A);if(!F)return;const T=rl(F);k.has(A.id)||w(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})},_=A=>{const F=gA(A,v);F.length!==0&&(x(T=>{const P=new Set(T);return P.has(A.id)?P.delete(A.id):P.add(A.id),P}),w(T=>{const P=new Set(T);for(const R of F)P.delete(rl(R));return P}))},j=async()=>{const A=new Map(n.map(T=>[rl(T),T])),F=e.flatMap(T=>{const P=EO(T);if(!P||!S.has(rl(P)))return[];const R=A.get(rl(P));return[{...P,mount_instance_id:(R==null?void 0:R.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await a(F,[...y]),l()}catch(T){g(T instanceof Error?T.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return Li.createPortal(o.jsxs("div",{className:"studio-tool-dialog-layer",children:[o.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),o.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[o.jsxs("header",{className:"studio-tool-dialog-head",children:[o.jsx("span",{className:"studio-tool-dialog-mark",children:o.jsx(k6,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),o.jsx("p",{children:c("sessionEnvironment.description")})]}),o.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:o.jsx(aat,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(oat,{}),o.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:A=>d(A.target.value)})]}),o.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?o.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?o.jsx("div",{className:"studio-tool-empty",children:s}):E.length===0&&C.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):o.jsxs(o.Fragment,{children:[C.length>0&&o.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[o.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),C.map(A=>{const F=gA(A,v),T=y.has(A.id),P=F.length===0;return o.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${T?" is-selected":""}${P?" is-disabled":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(kOe,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("span",{children:A.description||c("sessionEnvironment.reuseAll")}),o.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:F.length})})]}),o.jsx("input",{type:"checkbox",checked:T,disabled:P,"aria-label":c("sessionEnvironment.selectWorkspace",{name:A.name}),onChange:()=>_(A)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(BK,{})})]},A.id)})]}),E.length>0&&o.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[o.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),E.map(A=>{const F=EO(A);if(!F)return null;const T=t.filter(L=>y.has(L.id)&&L.environmentIds.includes(A.id)),P=T.length>0,R=S.has(rl(F));return o.jsxs("label",{className:`studio-tool-option session-environment-option${R?" is-selected":""}${P?" is-covered":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(k6,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("span",{children:P?c("sessionEnvironment.includedByWorkspaces",{names:T.map(L=>L.name).join(c("sessionEnvironment.nameSeparator"))}):A.description||oh(A.language)}),o.jsxs("small",{children:[oh(A.language)," · ",F.environment_version_id]})]}),o.jsx("input",{type:"checkbox",checked:R,disabled:P,"aria-label":c("sessionEnvironment.selectEnvironment",{name:A.name}),onChange:()=>N(A)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(BK,{})})]},rl(F))})]})]})})]}),o.jsxs("footer",{className:"session-environment-dialog__footer",children:[o.jsx("span",{className:m?"is-error":"",role:m?"alert":void 0,children:m||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:S.size})})}),o.jsxs("div",{children:[o.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),o.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void j(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function uat({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:a="",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 N=EO(C);return N?[[rl(N),C]]:[]})),[e]),x=p.useMemo(()=>new Map(e.map(C=>[C.id,C])),[e]),O=t.filter(C=>i.includes(C.id)),w=new Set(O.flatMap(C=>C.environmentIds)),k=n.filter(C=>!w.has(C.environment_id)),S=()=>{f(!1),requestAnimationFrame(()=>{var C;return(C=v.current)==null?void 0:C.focus()})},E=async(C,N)=>{if(l){m(!0),b("");try{await l(C,N)}catch(_){b(_ instanceof Error?_.message:u("sessionEnvironment.mountFailed"))}finally{m(!1)}}};return o.jsxs("div",{className:"session-environment-select",children:[n.length>0&&o.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[O.map(C=>{const N=new Set(gA(C,x).map(_=>_.environment_id));return o.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[o.jsx("span",{className:"session-environment-item__icon",children:o.jsx(kOe,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:C.name}),o.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:N.size})})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:C.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const _=i.filter(A=>A!==C.id),j=new Set(t.filter(A=>_.includes(A.id)).flatMap(A=>A.environmentIds));E(n.filter(A=>!N.has(A.environment_id)||j.has(A.environment_id)),_)},children:o.jsx(FK,{})})]},`workspace:${C.id}`)}),k.map(C=>{const N=y.get(rl(C));return o.jsxs("div",{className:"session-environment-item",role:"listitem",children:[o.jsx("span",{className:"session-environment-item__icon",children:o.jsx(k6,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:(N==null?void 0:N.name)??C.environment_id}),o.jsx("small",{children:N?oh(N.language):C.environment_version_id})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(N==null?void 0:N.name)??C.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void E(n.filter(_=>rl(_)!==rl(C)),[...i]),children:o.jsx(FK,{})})]},rl(C))})]}),l&&o.jsxs("button",{ref:v,type:"button",className:"topo-capability-add-slot","aria-label":u("sessionEnvironment.add"),disabled:s||r||h,onClick:()=>{b(""),f(!0),c==null||c()},children:[o.jsx(lat,{}),o.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&o.jsx("p",{className:"is-error",role:"alert",children:g}),(r||a||e.length===0)&&o.jsx("p",{className:a?"is-error":void 0,role:a?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):a||u("sessionEnvironment.empty")}),d&&o.jsx(cat,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:a,onConfirm:(C,N)=>l==null?void 0:l(C,N),onClose:S})]})}function EOe(e){return 1+e.children.reduce((t,n)=>t+EOe(n),0)}function COe(e){return e.id||e.name}function dat(e,t,n){const i=COe(e);if(e.id&&e.name&&e.name!==i)return e.name;if(t&&i==="agent")return n("agentTopology.mainAgent");const r=/^agent_sub_(\d+)$/.exec(i);return r?n("agentTopology.subAgent",{index:r[1]}):e.name||i}function TOe(e,t,n=!0){return{...e,id:COe(e),name:dat(e,n,t),children:e.children.map(i=>TOe(i,t,!1))}}function AOe(e){const t=oc(),n=Yb(e.model);return{...t,name:e.name,description:e.description,instruction:e.instruction||t.instruction,agentType:e.type,modelName:n.modelName,modelProvider:n.modelProvider,tools:e.tools??[],skills:(e.skills??[]).map(i=>i.name),subAgents:e.children.map(AOe)}}function fat(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}const hat=new Set(["StudioExternalToolset"]);function pat(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function xT({title:e,count:t}){const{t:n}=Te("workspaceTools");return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":n("agentTopology.itemCount",{count:t}),children:t})]})}function mat({appName:e,info:t,loading:n,variant:i="rail",studioTools:r=[],selectedStudioToolIds:s=[],managedStudioToolIds:a=[],studioToolsLoading:l=!1,studioToolsDisabled:c=!1,studioToolsUnavailableReason:u="",onStudioToolsChange:d,environments:f=[],workspaces:h=[],selectedEnvironments:m=[],selectedEnvironmentWorkspaceIds:g=[],environmentsLoading:b=!1,environmentsDisabled:v=!1,environmentsError:y="",onEnvironmentsChange:x,onEnvironmentsRefresh:O}){const{t:w}=Te("workspaceTools"),[k,S]=p.useState(null),[E,C]=p.useState(!1),N=p.useRef(null),_=()=>{C(!1),window.requestAnimationFrame(()=>{var Q;return(Q=N.current)==null?void 0:Q.focus()})};if(p.useEffect(()=>{if(!E)return;const Q=document.body.style.overflow,q=B=>{B.key==="Escape"&&_()};return document.body.style.overflow="hidden",document.addEventListener("keydown",q),()=>{document.body.style.overflow=Q,document.removeEventListener("keydown",q)}},[E]),n&&!t)return o.jsx("aside",{className:`topo is-loading${i==="drawer"?" is-drawer":""}`,"aria-label":w("agentTopology.info"),"aria-live":"polite",children:o.jsx(xn,{as:"span",className:"topo-loading-label",duration:2.2,children:w("agentTopology.loadingInfo")})});if(!t)return null;const j=EB(t.model),A=TOe(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:j,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]},w),F=fat(t.tools).filter(Q=>!hat.has(Q)).map(Q=>({id:`base:tool:${Q}`,name:Q,label:xOe(Q,w),custom:!1,removable:!1})),T=new Set(F.map(Q=>Q.name)),P=new Set(s),R=new Set(a),L=r.filter(Q=>P.has(Q.id)&&!T.has(Q.id)).map(Q=>({id:`studio:tool:${Q.id}`,name:Q.id,label:Q.name,custom:!0,removable:!R.has(Q.id)})),M=[...F,...L],U=pat(t.skills),I=!!d,H=AOe(A),K=Q=>o.jsx(LS,{draft:H,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Q);return o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:`topo${i==="drawer"?" is-drawer":""}`,"aria-label":w("agentTopology.infoAndTopology"),children:[o.jsxs("section",{className:"topo-agent-card","aria-label":w("agentTopology.info"),children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||w("agentTopology.unnamedAgent")}),j&&o.jsx("span",{title:j,children:j})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":w("agentTopology.tools"),children:[o.jsx(xT,{title:w("agentTopology.tools"),count:M.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":w("agentTopology.toolList"),tabIndex:0,children:M.length>0?o.jsx("div",{className:"topo-tool-list",children:M.map(Q=>o.jsxs("div",{className:"topo-tool",title:Q.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:Q.label}),o.jsx("code",{children:Q.name})]}),Q.custom&&o.jsx("span",{className:"topo-custom-badge",children:w("agentTopology.studioTool")})]}),Q.custom&&Q.removable&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":w("agentTopology.removeTool",{name:Q.name}),title:w("agentTopology.remove"),disabled:c,onClick:()=>d==null?void 0:d(s.filter(q=>q!==Q.name)),children:"×"})]},Q.id))}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.notConfigured")})}),I&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":w("agentTopology.addStudioTool"),disabled:c,onClick:()=>S("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:w("agentTopology.addStudioToolHere")})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":w("agentTopology.skills"),children:[o.jsx(xT,{title:w("agentTopology.skills"),count:t.skillsPreviewSupported?U.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":w("agentTopology.skillList"),tabIndex:0,children:t.skillsPreviewSupported?U.length>0?o.jsx("div",{className:"topo-skill-list",children:U.map(Q=>o.jsxs("div",{className:"topo-skill",title:Q.description||Q.name,children:[o.jsx("div",{className:"topo-skill-title",children:o.jsx("span",{className:"topo-skill-name",children:Q.name})}),Q.description&&o.jsx("span",{className:"topo-skill-description",children:Q.description})]},`${Q.name}:${Q.description}`))}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.notConfigured")}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.previewUnsupported")})})]}),(x||m.length>0)&&o.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":w("agentTopology.sessionEnvironment"),children:[o.jsx(xT,{title:w("agentTopology.environment"),count:m.length}),o.jsx(uat,{environments:f,workspaces:h,value:m,selectedWorkspaceIds:g,loading:b,disabled:v,error:y,onChange:x,onRefresh:O})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":w("agentTopology.agentCanvas"),children:[o.jsxs("div",{className:"topo-canvas-heading",children:[o.jsx(xT,{title:w("agentTopology.topology"),count:EOe(A)}),o.jsx("button",{ref:N,type:"button",className:"topo-canvas-expand","aria-label":w("agentTopology.viewCanvasFullscreen"),title:w("agentTopology.viewFullscreen"),onClick:()=>C(!0),children:o.jsx(Ky,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-preview",role:"region","aria-label":w("agentTopology.executionCanvas"),children:K(`conversation-canvas:${e}`)})]})]}),k==="tool"&&d&&o.jsx(Zst,{agentName:t.name,tools:r.filter(Q=>!T.has(Q.id)&&!R.has(Q.id)),selectedIds:s,loading:l,disabled:c,unavailableReason:u,onChange:d,onClose:()=>S(null)})]}),E&&Li.createPortal(o.jsxs("section",{className:"topo-canvas-dialog",role:"dialog","aria-modal":"true","aria-label":w("agentTopology.fullscreenExecutionCanvas"),children:[o.jsxs("header",{className:"topo-canvas-dialog-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:w("agentTopology.executionCanvas")}),o.jsx("span",{children:t.name})]}),o.jsx("button",{type:"button","aria-label":w("agentTopology.closeFullscreenCanvas"),title:w("agentTopology.close"),onClick:_,autoFocus:!0,children:o.jsx(Ba,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-dialog-body",children:K(`conversation-canvas-fullscreen:${e}`)})]}),document.body)]})}const lE={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function UK(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),o.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function gat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),o.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function bat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),o.jsx("path",{d:"m15.25 15.25 1.85-1.85a3.4 3.4 0 0 0-4.8-4.8l-1.85 1.85"}),o.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function yat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M5 19h3.2L18.6 8.6a1.7 1.7 0 0 0 0-2.4l-.8-.8a1.7 1.7 0 0 0-2.4 0L5 15.8V19Z"}),o.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function _Oe(e){return o.jsx("svg",{...lE,...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const vat=180,QK=500,bM=10,zK=32;function xat(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function wat({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=Te("workspaceTools"),[a,l]=p.useState(e.name),[c,u]=p.useState(e.description??""),[d,f]=p.useState((e.tags??[]).join(",")),[h,m]=p.useState(""),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(null),x=p.useRef(t),O=p.useRef(i);p.useEffect(()=>{x.current=t,O.current=i},[t,i]),p.useEffect(()=>{var N,_;const S=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(N=y.current)==null||N.focus(),(_=y.current)==null||_.select();const C=j=>{if(j.key==="Escape"&&!x.current){j.preventDefault(),O.current();return}if(j.key!=="Tab")return;const A=v.current;if(!A)return;const F=Array.from(A.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(R=>R.getClientRects().length>0);if(F.length===0){j.preventDefault();return}const T=F[0],P=F[F.length-1];j.shiftKey&&document.activeElement===T?(j.preventDefault(),P.focus()):!j.shiftKey&&document.activeElement===P&&(j.preventDefault(),T.focus())};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C),document.body.style.overflow=S,E!=null&&E.isConnected&&E.focus()}},[]);const w=S=>{var N;S.preventDefault();const E=a.trim(),C=xat(d);if(!E){m(s("artifactEdit.nameRequired")),(N=y.current)==null||N.focus();return}if(C.length>bM){m(s("artifactEdit.tooManyTags",{max:bM}));return}if(C.some(_=>_.length>zK)){m(s("artifactEdit.tagTooLong",{max:zK}));return}m(""),r({name:E,description:c.trim(),tags:C})},k=h||n;return Li.createPortal(o.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!t&&i()},children:o.jsxs("section",{ref:v,className:"artifact-edit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":t||void 0,children:[o.jsxs("header",{className:"artifact-edit-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:g,children:s("artifactEdit.title")}),o.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),o.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:o.jsx(_Oe,{})})]}),o.jsxs("form",{onSubmit:w,children:[o.jsxs("div",{className:"artifact-edit-dialog__body",children:[o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.name")}),o.jsx("input",{ref:y,value:a,maxLength:vat,disabled:t,"aria-invalid":!!k||void 0,onChange:S=>{l(S.target.value),m("")}})]}),o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.description")}),o.jsx("textarea",{value:c,maxLength:QK,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:S=>u(S.target.value)}),o.jsxs("small",{children:[c.length,"/",QK]})]}),o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.tags")}),o.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:bM}),onChange:S=>{f(S.target.value),m("")}})]}),k?o.jsx("div",{className:"artifact-edit-error",role:"alert",children:k}):null]}),o.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[o.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function NOe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return o.jsxs(vr,{children:[o.jsx(vr.Trigger,{children:o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:o.jsx($Fe,{"aria-hidden":"true"})})}),o.jsxs(vr.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[o.jsx("span",{className:"sr-only",children:t}),n.map(r=>o.jsx(vr.Item,{disabled:r.disabled,onSelect:r.onSelect,children:o.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const Oat="_Alert_1tr02_1",Sat="_Content_1tr02_145",kat="_Indicator_1tr02_156",Eat="_Message_1tr02_159",Cat="_Title_1tr02_162",Tat="_Description_1tr02_168",Aat="_Actions_1tr02_173",ng={Alert:Oat,Content:Sat,Indicator:kat,Message:Eat,Title:Cat,Description:Tat,Actions:Aat},Eb=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:a,className:l,actionsClassName:c,ref:u,...d})=>{const f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=Eye({ref:f});return p.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const x=v>b/3?"bottom":"end";g(x)}},[b]),o.jsxs("div",{ref:Zk([u,f]),className:pi(ng.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[a===!1?null:o.jsx("div",{className:ng.Indicator,children:a??o.jsx(_at,{color:e})}),o.jsxs("div",{className:ng.Content,children:[o.jsxs("div",{className:ng.Message,children:[n&&o.jsx("div",{className:ng.Title,children:n}),i&&o.jsx("div",{className:ng.Description,children:i})]}),r&&o.jsx("div",{className:pi(ng.Actions,c),ref:h,children:r})]})]})},_at=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return o.jsx(wbe,{});case"success":return o.jsx(bbe,{});default:return o.jsx(ybe,{})}};function pc({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:a="warning",busy:l=!1,onCancel:c,onConfirm:u}){const{t:d}=Te("shell"),f=r??d("confirm.cancel"),h=s??d("confirm.close"),m=p.useId(),g=p.useId(),b=p.useRef(null),v=p.useRef(l),y=p.useRef(c);return p.useEffect(()=>{v.current=l,y.current=c},[l,c]),p.useEffect(()=>{var k;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=b.current)==null||k.focus();const w=S=>{S.key==="Escape"&&!v.current&&y.current()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[]),Li.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&c()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${a}`,role:"alertdialog","aria-modal":"true","aria-labelledby":m,"aria-describedby":g,"aria-busy":l||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(wbe,{})}),o.jsx("h2",{id:m,children:e})]}),o.jsx(Ht,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:c,disabled:l,"aria-label":h,children:o.jsx(DF,{})})]}),o.jsxs("div",{className:"studio-confirm-body",children:[o.jsx("p",{id:g,children:t}),n?o.jsx(Eb,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx(Ht,{ref:b,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:c,disabled:l,children:f}),o.jsx(Ht,{type:"button",className:"studio-confirm-primary",color:a==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:u,disabled:l,children:i})]})]})}),document.body)}const Nat="_Container_1a6nz_1",jat="_Input_1a6nz_229",VK={Container:Nat,Input:jat},qr=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:a="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=a==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:x,onAutofill:O,autoSelect:w,startAdornment:k,endAdornment:S,pill:E,opticallyAlign:C,ref:N,..._}=e,j=P=>{const R=t.current;if(!P.target||!(P.target instanceof Element)||!R||R.contains(P.target)||P.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;P.preventDefault(),document.activeElement!==R&&R.focus();const{left:L,top:M}=R.getBoundingClientRect(),{clientX:U,clientY:I}=P,H=I{var P;w&&((P=t.current)==null||P.select())},[w]);const T=P=>{x==null||x(P),P.animationName==="native-autofill-in"&&(O==null||O())};return o.jsxs("div",{className:pi(VK.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:j,children:[k,o.jsx("input",{..._,ref:Zk([N,t]),id:r||(b?void 0:i),className:VK.Input,type:a,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:P=>{F(!0),v==null||v(P)},onBlur:P=>{F(!1),y==null||y(P)},onAnimationStart:T,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),S]})},Rat="_SelectControl_1tyi7_1",Iat="_Clear_1tyi7_436",Pat="_DropdownIcon_1tyi7_437",Dat="_TriggerText_1tyi7_468",Mat="_IndicatorWrapper_1tyi7_476",Lat="_StartIcon_1tyi7_482",$at="_DropdownIconChevron_1tyi7_534",Fat="_LoadingIndicator_1tyi7_537",Mf={SelectControl:Rat,Clear:Iat,DropdownIcon:Pat,TriggerText:Dat,IndicatorWrapper:Mat,StartIcon:Lat,DropdownIconChevron:$at,LoadingIndicator:Fat},Bat=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:a,children:l,className:c,variant:u="outline",size:d="md",block:f,opticallyAlign:h,pill:m=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:x="dropdown",...O})=>{const w=p.useRef(null),S=!!b&&v&&!g&&!a,E=x&&x!=="none"&&!g,C=S||g||E,N=!g&&!a,_=A=>{var F;switch(A.key){case"ArrowDown":case"ArrowUp":case" ":A.stopPropagation(),A.preventDefault(),r?r():(F=w.current)==null||F.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(A)}},j=A=>{var F;A.button!==2&&(A.stopPropagation(),r?(A.preventDefault(),r()):(t==null||t(A),(F=O.onClick)==null||F.call(O,A)))};return o.jsxs("span",{ref:Zk([w,e]),className:pi(Mf.SelectControl,c),role:"button",tabIndex:a?-1:0,onPointerEnter:A=>{l7(A),i==null||i(A)},onPointerDown:N?j:void 0,onKeyDown:N?_:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":m?"":void 0,"data-size":d,"data-optically-align":h,"aria-busy":g?"true":void 0,"data-selected":v,"data-loading":g?"":void 0,"data-invalid":s?"":void 0,"data-disabled":a?"":void 0,"aria-disabled":a,...O,onClick:void 0,children:[y&&o.jsx(y,{className:Mf.StartIcon}),o.jsx("span",{className:Mf.TriggerText,children:l}),C&&o.jsxs("div",{className:Mf.IndicatorWrapper,children:[S&&o.jsx(Ht,{"aria-label":"Clear current value",className:Mf.Clear,onPointerDown:A=>{A.stopPropagation()},onClick:A=>{A.stopPropagation(),A.preventDefault(),b()},color:"secondary",variant:E?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":E?void 0:"",children:o.jsx(DF,{})}),g&&o.jsx(Hk,{className:Mf.LoadingIndicator}),E&&o.jsx(Uat,{iconType:x})]})]})},Uat=({iconType:e})=>e==="chevronDown"?o.jsx(IFe,{className:pi(Mf.DropdownIcon,Mf.DropdownIconChevron)}):o.jsx(FFe,{className:Mf.DropdownIcon}),Qat="_Menu_n4tw6_3",zat="_MenuList_n4tw6_5",Vat="_MenuInner_n4tw6_50",Hat="_OptionsList_n4tw6_64",qat="_Option_n4tw6_64",Wat="_PressableInner_n4tw6_111",Gat="_OptionInner_n4tw6_113",Kat="_OptionCheck_n4tw6_118",Xat="_OptionIndicatorSlot_n4tw6_123",Yat="_OptionGroupHeading_n4tw6_128",Zat="_OptionHardLimitHeading_n4tw6_140",Jat="_OptionsLimit_n4tw6_147",eot="_Action_n4tw6_152",tot="_ActionInner_n4tw6_218",not="_ActionsContainer_n4tw6_224",iot="_Search_n4tw6_244",rot="_SearchEmpty_n4tw6_247",Pr={Menu:Qat,MenuList:zat,MenuInner:Vat,OptionsList:Hat,Option:qat,PressableInner:Wat,OptionInner:Gat,OptionCheck:Kat,OptionIndicatorSlot:Xat,OptionGroupHeading:Yat,OptionHardLimitHeading:Zat,OptionsLimit:Jat,Action:eot,ActionInner:tot,ActionsContainer:not,Search:iot,SearchEmpty:rot},jOe=p.createContext(null),Bm=()=>{const e=p.use(jOe);if(!e)throw new Error("Select components must be wrapped in ");return e},aot=({label:e})=>o.jsx(o.Fragment,{children:e}),oot=({label:e})=>o.jsx(o.Fragment,{children:e}),lot=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return o.jsx(o.Fragment,{children:n})},Ls=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:a="outline",size:l="md",dropdownIconType:c="dropdown",loading:u=!1,clearable:d=!1,disabled:f=!1,placeholder:h="Select...",loadingPlaceholder:m="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:x="bottom",avoidCollisions:O=!0,onChange:w,optionClassName:k,OptionView:S=aot,TriggerStartIcon:E,triggerClassName:C,opticallyAlign:N,TriggerView:_,searchPlaceholder:j="",searchPredicate:A=xot,searchEmptyMessage:F="No results found.",listMaxWidth:T="auto"}=e,P=e.block??a!=="ghost",R=e.align??(P?"center":"start"),L=e.alignOffset??(R==="center"?0:-5),M=e.listMinWidth??(P?"auto":300),U=xm((ge,W)=>{if(s){if(!ge.value){w([]);return}if(W){const X=i.filter(ue=>ue!==ge.value),ae=E6(v,X);w(ae)}else{const X=E6(v,i);w(X.concat(ge))}}else w(ge)}),I=p.useRef(A);I.current=A;const H=p.useMemo(()=>y,[y.length]),K=p.useRef(y);K.current=y;const Q=p.useCallback(ge=>{var W;(W=K.current.find(X=>X.id===ge))==null||W.onSelect(ge)},[]),q=p.useMemo(()=>NB(v)?v.reduce((ge,W)=>ge+W.options.length,0):v.length,[v]),ee=`select-trigger-${p.useId()}`,le=q>15,se=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:_??lot}:{multiple:!1,value:i,TriggerView:_??oot},[s,i,_]),re=p.useMemo(()=>({...se,triggerId:ee,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:a,pill:g,size:l,dropdownIconType:c,block:P,align:R,alignOffset:L,side:x,avoidCollisions:O,listWidth:b,listMinWidth:M,listMaxWidth:T,searchPlaceholder:j,searchEmptyMessage:F,TriggerStartIcon:E,triggerClassName:C,opticallyAlign:N,optionClassName:k,OptionView:S,actions:H,onActionSelect:Q,onSelectRef:U,searchPredicateRef:I,searchable:le,disabled:f}),[se,ee,t,n,r,v,h,m,u,d,a,g,l,c,P,R,L,x,O,b,M,T,j,F,E,C,N,k,S,H,Q,U,le,f]);return o.jsx(ROe.Provider,{value:re,children:o.jsx(uot,{})})},cot=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:a,loading:l,disabled:c,clearable:u,name:d,variant:f,pill:h,size:m,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:x,triggerClassName:O,TriggerStartIcon:w,TriggerView:k,onSelectRef:S}=Bm(),{onOpenChange:E,...C}=e,N=s?r[0]:r,_=l?v:b,j=p.useMemo(()=>Oot(a,N)||{value:"",label:_},[N,a,_]),A=s?r.length>0:!!r,F=l||!A,T=p.useMemo(()=>$Oe(),[]),P=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const M=E6(a,r),U=a.flatMap(I=>"options"in I?I.options:I);return{values:M.length?M:[{value:"",label:_}],selectedAll:U.length<=r.length}},[s,a,r,_]),R=M=>{const U=M.key;if(!s&&FOe(U)){const I=T(U);M.stopPropagation();const H=BOe(a,I,N);H&&S.current(H)}},L=()=>{S.current({value:"",label:""}),E==null||E(!1)};return o.jsxs(Uat,{id:t,className:O,selected:!F,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:w,opticallyAlign:x,dropdownIconType:g,onClearClick:u?L:void 0,onInteract:E,onKeyDown:R,...C,children:[s?o.jsx(k,{...P}):o.jsx(k,{...j}),(d||n)&&o.jsx("input",{id:n,name:d,value:N,tabIndex:-1,onFocus:()=>{var M;(M=document.getElementById(t))==null||M.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},uot=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:a,listMinWidth:l,listMaxWidth:c}=Bm(),[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 Yk(u,()=>{h(!1)}),o.jsxs(pxe,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[o.jsx(mxe,{asChild:!0,children:o.jsx(cot,{onOpenChange:h})}),o.jsx(gxe,{forceMount:!0,children:o.jsx(Lx,{className:Pr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&o.jsx(bxe,{ref:f,forceMount:!0,className:Pr.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:ih,onCloseAutoFocus:ih,onEscapeKeyDown:ih,style:Wb({"select-list-width":a,"select-list-min-width":l,"select-list-max-width":c}),children:o.jsx(dot,{onOpenChange:h})},"dropdown")})})]})},IOe=p.createContext(null),Qx=()=>{const e=p.use(IOe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},dot=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Bm(),a=p.useRef(()=>e(!1)),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(""),[h,m]=p.useState(()=>{var N;return((t?n[0]:n)||((N=wT(i))==null?void 0:N.value))??""}),g=p.useMemo(()=>$Oe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),x=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),O=p.useMemo(()=>wot(i,x,s.current),[i,x,s]),w=p.useMemo(()=>wT(O),[O]),k=p.useRef(!1),S=C=>{const N=C.key,_=t?n[0]:n,j=h||(w==null?void 0:w.value)||_,A=document.activeElement===u.current,F=l.current;if(!F)return;const T=()=>{const L=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),M=Rf(h,F);M==null||M.dispatchEvent(L)},P=(L,M)=>{m(L),M.scrollIntoView({block:"nearest"})},R=()=>{const L=t?n[0]:n;if(L){const U=Rf(L,F);if(U){P(L,U);return}}const M=wT(i);if(M){const U=Rf(M.value,F);U&&P(M.value,U)}};switch(N){case"ArrowDown":{if(C.preventDefault(),!h||!Rf(h,F)){R();return}const L=Sot(h,F),M=L==null?void 0:L.getAttribute("data-option-id");L&&M&&P(M,L);return}case"ArrowUp":{if(C.preventDefault(),!h||!Rf(h,F)){R();return}const L=kot(j,F),M=L==null?void 0:L.getAttribute("data-option-id");L&&M&&P(M,L);return}case"Enter":C.preventDefault(),T();return;case" ":if(x&&A)return;C.preventDefault(),T();return}if(FOe(N)){if(A)return;const L=g(N);C.stopPropagation();const M=BOe(i,L,h);if(M){const U=Rf(M.value,F);U&&(m(M.value),U.scrollIntoView({block:"nearest"}))}}},E=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:a,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{F_(()=>{if(!l.current)return;const N=Rf(h,l.current);N==null||N.scrollIntoView({block:"center"})});const C=u.current||l.current;return C==null||C.focus({preventScroll:!0}),()=>{k.current=!1}},[]),p.useLayoutEffect(()=>{if(!k.current){k.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const C=wT(O);C&&m(C.value)},[O]),o.jsx(IOe,{value:E,children:o.jsxs("div",{id:v,className:Pr.MenuInner,onKeyDown:S,ref:l,tabIndex:0,children:[r&&o.jsx(fot,{value:d,onChange:f}),o.jsx(hot,{filteredOptions:O}),o.jsx(yot,{})]})})},fot=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Bm(),{listId:i,searchInputRef:r}=Qx(),s=a=>{t(a.target.value)};return o.jsx("div",{className:Pr.Search,children:o.jsx(qr,{startAdornment:o.jsx(XFe,{width:16,height:16,className:"fill-secondary"}),ref:r,value:e,placeholder:n,onChange:s,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-controls":i,"aria-expanded":!0})})},cE=e=>"options"in e,NB=e=>e[0]&&cE(e[0]),rv=300,hot=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Bm(),{listRef:n}=Qx();if(!e.length)return typeof t=="string"?o.jsx("p",{className:Pr.SearchEmpty,"data-text-only":!0,children:t}):o.jsx("div",{className:Pr.SearchEmpty,children:t});const i=NB(e),r=!i&&e.length>rv,s=i?e.map(a=>o.jsx(mot,{...a},a.label)):e.slice(0,rv).map(a=>o.jsx(DOe,{...a},a.value));return o.jsxs("div",{className:Pr.OptionsList,ref:n,children:[s,r&&o.jsx(POe,{numHidden:e.length-rv})]})},pot={limit:100,label:"Show all"},mot=({label:e,options:t,optionsLimit:n=pot})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=Qx(),[a,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Pr.OptionGroupHeading,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),e]}),d.map(h=>o.jsx(DOe,{...h},h.value)),c&&o.jsx(got,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&o.jsx(POe,{numHidden:t.length-rv})]})},POe=({numHidden:e})=>o.jsxs("div",{className:Pr.OptionHardLimitHeading,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),got=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=Qx(),s=e===i,a=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return o.jsx("div",{className:pi(Pr.Option,Pr.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:a,onPointerLeave:l,children:o.jsxs("div",{className:pi(Pr.PressableInner,Pr.OptionInner),children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),t]})})},bot="data-option-id",DOe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Bm(),{valueRef:a,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=Qx(),{value:d,disabled:f,tooltip:h}=e,m=a.current,g=r?i.includes(d):d===m,b=d===c,v=()=>{var O;r?s.current(e,g):(s.current(e),(O=l.current)==null||O.call(l))},y=()=>{b||u(d)},x=()=>{u(O=>O!==d?O:"")};return o.jsx("div",{className:pi(Pr.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[bot]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:x,"aria-disabled":f,"data-disabled":f?"":void 0,children:o.jsxs("div",{className:Pr.PressableInner,children:[o.jsxs("div",{className:Pr.OptionInner,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot,children:g&&o.jsx(Lv,{className:Pr.OptionCheck})}),o.jsx(n,{...e}),h&&o.jsx(go,{content:h.content,maxWidth:h.maxWidth,side:"right",children:o.jsx(vbe,{})})]}),e.description&&o.jsxs("div",{className:Pr.OptionInner,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),e.description]})]})})},yot=()=>{const{actions:e}=Bm();return e.length===0?null:o.jsx("div",{className:Pr.ActionsContainer,children:e.map(t=>o.jsx(vot,{...t},t.id))})},vot=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Bm(),{requestCloseRef:s}=Qx(),a=c=>{switch(c.key){case"Tab":break;case"Enter":case" ":c.stopPropagation(),l();break;default:c.stopPropagation()}},l=()=>{var c;r(e),(c=s.current)==null||c.call(s)};return o.jsx("div",{className:Pr.Action,onPointerUp:l,onKeyDown:a,tabIndex:0,children:o.jsxs("div",{className:pi(Pr.ActionInner,i),children:[n&&o.jsx(n,{role:"presentation"}),t]})})},xot=(e,t)=>e.label.toLowerCase().includes(t),wot=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return NB(e)?e.reduce((s,a)=>{const l=a.options.filter(r);return l.length&&s.push({...a,options:l}),s},[]):e.reduce((s,a)=>(r(a)&&s.push(a),s),[])},wT=e=>{if(!e.length)return;let t;for(const n of e)if(cE(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},Oot=(e,t)=>{let n;for(const i of e)if(cE(i)){const r=i.options.find(s=>s.value===t);if(r){n=r;break}}else if(i.value===t){n=i;break}return n},E6=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(cE(r)){const s=r.options.filter(a=>i.has(a.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},MOe=40,Rf=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),LOe=e=>e.matches("[data-option-id]:not([data-disabled])"),Sot=(e,t)=>{const n=Rf(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=Rf(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},FOe=e=>/^[a-zA-Z0-9]$/.test(e),BOe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const a=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(cE(l)){for(const c of l.options)if(a(c))if(s){r=c;break}else i=i||c}else if(a(l))if(s){r=l;break}else i=i||l;return r||i};function na(...e){return e.filter(Boolean).join(" ")}const HK=[["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 Eot(e){let t=2166136261;for(const a of e)t^=a.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=HK[n%HK.length];return{"--resource-identity-accent":i,"--resource-identity-glow":r,"--resource-identity-shadow":s,"--resource-identity-x":`${20+(n>>>7)%61}%`,"--resource-identity-y":`${18+(n>>>15)%57}%`}}function Xv({seed:e,className:t}){return o.jsx("span",{className:na("resource-card__identity-mark",t),style:Eot(e),"aria-hidden":"true"})}function Cot(e){return o.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{transform:"translate(0.875 0.875)",children:[o.jsx("path",{d:"M5.869 10.719a4.849 4.849 0 1 0 0-9.698 4.849 4.849 0 0 0 0 9.698Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Th({className:e,...t}){return o.jsx("section",{className:na("resource-page",e),...t})}function zx({title:e,description:t,className:n}){return o.jsxs("header",{className:na("resource-page__header",n),children:[o.jsx("h1",{children:e}),t?o.jsx("p",{children:t}):null]})}function Tot({className:e,...t}){return o.jsx("div",{className:na("resource-detail",e),...t})}function Aot({className:e,...t}){return o.jsx("header",{className:na("resource-detail__header",e),...t})}function _ot({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:a}=Te("ui"),l=r??a("resourceCollection.back");return o.jsxs("div",{className:"resource-detail__heading",children:[s?o.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:o.jsx(u7e,{"aria-hidden":"true"})}):null,o.jsxs("div",{className:"resource-detail__heading-copy",children:[o.jsxs("div",{className:"resource-detail__title-row",children:[o.jsx("span",{className:"resource-detail__identity",children:o.jsx(Xv,{seed:n})}),o.jsx("h1",{children:e}),i?o.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?o.jsx("p",{children:t}):null]})]})}function Not({className:e,...t}){return o.jsx("div",{className:na("resource-detail__actions",e),...t})}function jot({className:e,...t}){return o.jsx("div",{className:na("resource-detail__body",e),...t})}function uE({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:a,className:l,actionsClassName:c,bodyClassName:u,sections:d,activeSectionKey:f,navigationLabel:h,onSectionChange:m,children:g}){var O;const{t:b}=Te("ui"),v=!!(d!=null&&d.length),y=(O=d==null?void 0:d.find(w=>w.key===f))==null?void 0:O.content,x=h??b("resourceCollection.detailNavigation");return o.jsxs(Tot,{className:l,children:[o.jsxs(Aot,{children:[o.jsx(_ot,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),a?o.jsx(Not,{className:c,children:a}):null]}),o.jsx(jot,{className:na(v&&"is-split",u),children:v?o.jsxs(o.Fragment,{children:[o.jsx("nav",{className:"resource-detail__navigation","aria-label":x,children:d==null?void 0:d.map(w=>o.jsx(Ht,{type:"button",color:"secondary",variant:w.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":w.key===f?"page":void 0,disabled:w.disabled,onClick:()=>m==null?void 0:m(w.key),children:o.jsx("span",{className:"resource-detail__navigation-label",children:w.label})},w.key))}),o.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function jB({className:e,...t}){return o.jsx("dl",{className:na("resource-detail__summary",e),...t})}function UOe({title:e,description:t,actions:n,className:i}){return o.jsxs("header",{className:na("resource-detail__section-header",i),children:[o.jsxs("div",{children:[o.jsx("h2",{children:e}),t?o.jsx("p",{children:t}):null]}),n]})}function Rot({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:a,searchLabel:l,primaryAction:c,rowActions:u,scrollRef:d,onScroll:f,busy:h,footer:m,emptyLabel:g}){const{t:b}=Te("ui"),v=!!u,y=g??b("resourceCollection.noData");return o.jsxs("div",{className:"resource-data-table",children:[o.jsxs("div",{className:"resource-data-table__toolbar",children:[o.jsx("div",{className:"resource-data-table__search",children:o.jsx(qr,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:a,"aria-label":l})}),c?o.jsx(Ht,{type:"button",color:"primary",disabled:c.disabled,title:c.title,onClick:c.onClick,children:c.label}):null]}),o.jsxs("div",{ref:d,className:"resource-data-table__frame","aria-busy":h||void 0,onScroll:f,children:[o.jsxs("table",{className:"resource-data-table__table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[i.map(x=>o.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),v?o.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:o.jsx("span",{className:"sr-only",children:b("resourceCollection.actions")})}):null]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(v?1:0),children:y})}):e.map(x=>{const O=t(x),w=(n==null?void 0:n(x))??O;return o.jsxs("tr",{children:[i.map(k=>o.jsx("td",{className:k.className,children:k.render(x)},k.key)),u?o.jsx("td",{className:"resource-data-table__actions",children:o.jsx(jOe,{label:b("resourceCollection.moreActions",{label:w}),menuLabel:b("resourceCollection.actionsFor",{label:w}),items:u(x)})}):null]},O)})})]}),m]})]})}function Zb({className:e,...t}){return o.jsx("div",{className:na("resource-toolbar",e),...t})}function dE({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const a=c=>{c.disabled||n(c.id)},l=(c,u)=>{var g;if(!["ArrowLeft","ArrowRight","Home","End"].includes(c.key))return;c.preventDefault();const d=e.filter(b=>!b.disabled),f=d.findIndex(b=>b.id===u.id),h=c.key==="Home"?0:c.key==="End"?d.length-1:(f+(c.key==="ArrowRight"?1:-1)+d.length)%d.length,m=d[h];m&&(n(m.id),(g=document.getElementById(`${r}-${m.id}-tab`))==null||g.focus())};return o.jsx("nav",{className:na("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>o.jsx("button",{type:"button",id:`${r}-${c.id}-tab`,className:t===c.id?"is-active":void 0,role:"tab","aria-selected":t===c.id,"aria-controls":c.panelId,tabIndex:t===c.id?0:-1,disabled:c.disabled,onClick:()=>a(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function wm({className:e,...t}){return o.jsxs("label",{className:na("resource-search",e),children:[o.jsx(Cot,{}),o.jsx("input",{type:"search",...t})]})}const Iot=150,Pot=200;function qK(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function lN({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:a=!1}){const l=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"&&qK(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,Pot))},[h,g]),v=p.useCallback(y=>{var w;if(a||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const x=m();if(!x||x.getAttribute("data-state")==="open")return;const O=document.activeElement;O instanceof HTMLElement&&O!==x&&!((w=l.current)!=null&&w.contains(O))&&O.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const k=m();!k||k.getAttribute("data-state")==="open"||(d.current=!0,qK(k))},Iot))},[h,f,a,m]);return p.useEffect(()=>{const y=x=>{var E;if(!d.current)return;const O=m();if(!O||O.getAttribute("data-state")!=="open"){d.current=!1,h();return}const w=x.target;if(!(w instanceof Node))return;const k=O.getAttribute("aria-controls"),S=k?document.getElementById(k):null;if((E=l.current)!=null&&E.contains(w)||S!=null&&S.contains(w)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),o.jsxs("div",{ref:l,className:na("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[o.jsx("label",{className:"sr-only",htmlFor:e,children:t}),o.jsx(Ls,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:a,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const Jb=p.forwardRef(function({className:t,...n},i){return o.jsx("section",{ref:i,className:na("resource-results",t),...n})});function Ud(){const{t:e}=Te("ui");return o.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[o.jsx(Hk,{size:16}),o.jsx(xn,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function Vx({className:e,...t}){return o.jsx("div",{className:na("resource-grid",e),...t})}function RB({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...a}){return o.jsxs("article",{className:na("resource-card",r&&"is-interactive",e),...a,children:[r&&i?o.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,o.jsx("div",{className:"resource-card__content",children:s}),t||n?o.jsxs("footer",{className:"resource-card__footer",children:[t,n?o.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function C6({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return o.jsx("button",{type:"button",className:na("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function T6({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...a}){const l=t==="play"?o.jsx(GFe,{}):t==="plus"?o.jsx(wbe,{}):o.jsx(jFe,{});return o.jsx(C6,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...a,children:r??l})}function IB({leading:e,title:t,titleText:n,subtitle:i,status:r}){return o.jsxs("div",{className:"resource-card__header",children:[o.jsxs("div",{className:"resource-card__identity",children:[e,o.jsxs("div",{className:"resource-card__title-copy",children:[o.jsx("h3",{title:n,children:t}),i]})]}),r]})}function PB({children:e,title:t}){return o.jsx("p",{className:"resource-card__description",title:t,children:e})}function QOe({items:e,className:t}){return o.jsx("dl",{className:na("resource-card__metadata",t),children:e.map((n,i)=>o.jsxs("div",{className:n.className,children:[o.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),o.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function Cb({className:e,icon:t,children:n,...i}){return o.jsxs("button",{type:"button",className:na("resource-create-card",e),...i,children:[o.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),o.jsx("span",{children:n})]})}const Dot=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),Mot=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),Lot=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function zOe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function cN(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function $ot(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function Fot(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function Bot(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function Uot(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function WK(e,t,n){var i;if(/\.[A-Za-z0-9]{2,8}$/.test(e))return e;try{const r=new URL(t).pathname.split("/").filter(Boolean),a=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(a)return`${e}${a}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function Qot(e,t){const n=Uot(t),i=e==="image_generate"||e.endsWith("_image_generate"),r=["video_generate","video_task_query"].some(u=>e===u||e.endsWith(`_${u}`));if(!i&&!r)return[];const s=i?"image":"video",a=[],l=n.success_list;if(Array.isArray(l)){for(const u of l)if(!(!u||typeof u!="object"||Array.isArray(u)))for(const[d,f]of Object.entries(u))typeof f=="string"&&f.startsWith("https://")&&a.push({name:WK(d,f,s),url:f,type:s})}const c=n.video_url;if(r&&typeof c=="string"&&c.startsWith("https://")){const u=typeof n.task_id=="string"?n.task_id:void 0;a.push({name:WK(u||"generated-video",c,s),url:c,type:s,taskId:u})}return a}function GK(e,t){return new Date(cN(e,t)||Date.now()).toISOString()}function zot(e,t){var r;const n=[],i=new Set;for(const s of e)for(const a of s.sessions){const l=cN(a.lastUpdateTime,Date.now()),c=cR(a.events,t);for(const u of a.events??[])for(const d of Bot(u)){const f=(d==null?void 0:d.name)??"";for(const h of Qot(f,d==null?void 0:d.response)){const m=`${a.id}:${u.id??""}:${f}:${h.url}`;i.has(m)||(i.add(m),n.push({sourceUrl:h.url,name:h.name,mimeType:h.type==="image"?"image/png":"video/mp4",appName:s.appName,agentId:s.agentId,agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionId:a.id,sessionTitle:c,sessionUpdatedAt:GK(a.lastUpdateTime,l),createdAt:GK(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 VOe(e){const t=zOe(e);return Dot.has(t)?"image":Mot.has(t)?"video":"document"}function Vot(e){const t=VOe(e);return t==="image"?"image":t==="video"?"video":Lot.has(zOe(e))?"frame":"unavailable"}function Hot(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const a of s.sessions){const l=cN(a.lastUpdateTime,0),c=new Map;for(const u of a.events??[]){const d=$ot(u);if(!d)continue;const f=cN(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(Fot(u.filename)),f=d??u,h=d?"image":Vot(u.filename);i.push({id:`${s.appName}:${a.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:a.id,sessionTitle:cR(a.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:VOe(u.filename),createdAt:u.createdAt||l,origin:{runtimeId:s.runtimeId,region:s.region},preview:{filename:f.filename,version:f.version,mode:h}})}}return i.sort((s,a)=>a.createdAt-s.createdAt||s.name.localeCompare(a.name,n))}function HOe(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 qOe(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 yM=40;function qot(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 Wot(e,t){return e(`artifactLibrary.types.${t}`)}function OT(e){return e instanceof Error?e.message:String(e)}function WOe({artifact:e,large:t=!1}){return o.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?o.jsxs(o.Fragment,{children:[o.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?o.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:o.jsx(UK,{})}):null]}):e.type==="document"?o.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[o.jsx("span",{className:"is-title"}),o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{className:"is-short"})]}):e.type==="image"?o.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[o.jsx("span",{className:"artifact-image-sun"}),o.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),o.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):o.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[o.jsx("span",{className:"artifact-video-orbit"}),o.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),o.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),o.jsx("span",{className:"artifact-video-play",children:o.jsx(UK,{})})]})})}function Got({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:a,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return o.jsxs("tr",{className:"library-artifact-row",children:[o.jsx("td",{className:"library-artifact-file",children:o.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[o.jsx("div",{className:"library-artifact-thumbnail",children:o.jsx(WOe,{artifact:e})}),o.jsxs("div",{className:"library-artifact-row-title",children:[o.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),o.jsx("span",{className:"library-artifact-row-size",children:qOe(e.sizeBytes)||"—"})]})]})}),o.jsx("td",{className:"library-artifact-source-cell",children:l?o.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[o.jsx("span",{children:e.agentName}),o.jsx("span",{"aria-hidden":"true",children:"/"}),o.jsx("span",{children:e.sessionTitle})]}):o.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),o.jsx("td",{className:"library-artifact-time",children:HOe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),o.jsx("td",{className:"library-artifact-actions-cell",children:o.jsx("div",{className:"library-artifact-actions",children:o.jsx(jOe,{label:c("artifactLibrary.moreActions",{name:e.name}),menuLabel:c("artifactLibrary.actionMenu",{name:e.name}),placement:"bottom-end",items:[{label:c(d?"artifactLibrary.downloading":"artifactLibrary.download"),onSelect:()=>r(e),disabled:n||!!t},...s?[{label:c("artifactLibrary.edit"),onSelect:()=>s(e),disabled:n||!!t||e.canManage===!1}]:[],...a?[{label:c("artifactLibrary.delete"),onSelect:()=>a(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function Kot({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:a="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:m,toolbarFilters:g}){var wt,Se;const{t:b,i18n:v}=Te("workspaceTools"),y=v.resolvedLanguage||v.language,[x,O]=p.useState("all"),[w,k]=p.useState(""),[S,E]=p.useState(null),[C,N]=p.useState(""),[_,j]=p.useState(""),[A,F]=p.useState(""),[T,P]=p.useState(""),[R,L]=p.useState({}),[M,U]=p.useState(()=>new Set),[I,H]=p.useState(null),[K,Q]=p.useState(!1),[q,B]=p.useState(""),[ee,le]=p.useState(null),[se,re]=p.useState(!1),[ge,W]=p.useState(yM),X=p.useRef(null),ae=p.useRef(null),ue=p.useRef(0),Oe=p.useRef(null),ke=p.useRef(null),st=p.useRef(!1),Le=p.useCallback(()=>{ue.current+=1,E(null),N(""),j("")},[]),Me=p.useMemo(()=>t?[...t]:Hot(e,b("library.untitledSession"),y),[t,y,e,b]),Ie=p.useMemo(()=>Me.filter(ve=>!M.has(ve.id)).map(ve=>R[ve.id]??ve),[Me,R,M]);p.useEffect(()=>()=>{ue.current+=1},[]),p.useEffect(()=>()=>{C&&URL.revokeObjectURL(C)},[C]),p.useEffect(()=>{var Ce;if(!S)return;const ve=document.activeElement,He=document.body.style.overflow;document.body.style.overflow="hidden",(Ce=X.current)==null||Ce.focus();const Je=Wt=>{if(Wt.key==="Escape"){Wt.preventDefault(),Le();return}if(Wt.key!=="Tab")return;const ln=ae.current;if(!ln)return;const cn=Array.from(ln.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(ot=>ot.getClientRects().length>0);if(cn.length===0){Wt.preventDefault();return}const Ot=cn[0],jt=cn[cn.length-1];Wt.shiftKey&&document.activeElement===Ot?(Wt.preventDefault(),jt.focus()):!Wt.shiftKey&&document.activeElement===jt&&(Wt.preventDefault(),Ot.focus())};return document.addEventListener("keydown",Je),()=>{document.removeEventListener("keydown",Je),document.body.style.overflow=He,ve!=null&&ve.isConnected&&ve.focus()}},[Le,S]);const qe=async ve=>{const He=ue.current+1;if(ue.current=He,F(""),N(""),E(ve),ve.preview.mode!=="unavailable"){if(ve.contentUrl){N(ve.contentUrl);return}j(`preview:${ve.id}`);try{const Je=await XF(ve.appName,n,ve.sessionId,ve.preview.filename,ve.preview.version);if(ue.current!==He){URL.revokeObjectURL(Je);return}N(Je)}catch(Je){ue.current===He&&F(b("artifactLibrary.previewFailed",{name:ve.name,message:OT(Je)}))}finally{ue.current===He&&j("")}}},Ae=async ve=>{F(""),j(`download:${ve.id}`);try{d?await d(ve):await KF(ve.appName,n,ve.sessionId,ve.name,ve.version),P(b("artifactLibrary.downloadStarted",{name:ve.name}))}catch(He){F(b("artifactLibrary.downloadFailed",{name:ve.name,message:OT(He)}))}finally{j("")}},ze=async ve=>{if(!(!I||!c)){Q(!0),B("");try{const Je=await c(I,ve)??{...I,...ve,updatedAt:Date.now()};L(Ce=>({...Ce,[I.id]:Je})),P(b("artifactLibrary.updated",{name:Je.name})),H(null)}catch(He){B(OT(He))}finally{Q(!1)}}},Ee=async()=>{if(!(!ee||!u)){re(!0),F("");try{await u(ee),U(ve=>new Set([...ve,ee.id])),P(b("artifactLibrary.deleted",{name:ee.name})),(S==null?void 0:S.id)===ee.id&&Le(),le(null)}catch(ve){F(b("artifactLibrary.deleteFailed",{name:ee.name,message:OT(ve)})),le(null)}finally{re(!1)}}},De=p.useMemo(()=>{const ve=w.trim().toLocaleLowerCase();return Ie.filter(He=>{var Je;return(Je=He.origin)!=null&&Je.region&&He.origin.region!==h||x!=="all"&&He.type!==x?!1:ve?[He.name,He.sessionTitle,He.agentName].some(Ce=>Ce.toLocaleLowerCase().includes(ve)):!0})},[x,Ie,w,h]),J=p.useMemo(()=>De.slice(0,ge),[De,ge]),he=ge{st.current||(st.current=!0,W(ve=>ve+yM))},[]);p.useEffect(()=>{W(yM)},[r,x,w,De.length]),p.useEffect(()=>{st.current=!1},[ge]),p.useEffect(()=>{const ve=ke.current,He=Oe.current;if(!i||!ve||!He||!he)return;const Je=new IntersectionObserver(([Ce])=>{Ce.isIntersecting&&_e()},{root:He,rootMargin:"240px 0px",threshold:.01});return Je.observe(ve),()=>Je.disconnect()},[i,he,_e,ge]);const Ze=()=>{const ve=Oe.current;!i||!ve||!he||ve.scrollHeight-ve.scrollTop-ve.clientHeight<=240&&_e()},at=!!w.trim()||x!=="all"||Ie.some(ve=>{var He;return((He=ve.origin)==null?void 0:He.region)&&ve.origin.region!==h});return o.jsxs("div",{className:"artifact-library-page resource-collection",children:[o.jsxs(Zb,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:x,options:qot(b),onChange:O}),g,o.jsx(wm,{"aria-label":b("artifactLibrary.searchAria"),value:w,onChange:ve=>k(ve.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),a&&Ie.length>0?o.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[o.jsx("span",{children:a}),l?o.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,A?o.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[o.jsx("span",{children:A}),o.jsx("button",{type:"button",onClick:()=>F(""),children:b("artifactLibrary.close")})]}):null,o.jsx(Jb,{ref:Oe,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:Ze,children:o.jsxs("div",{className:"artifact-library-panel",children:[s&&Ie.length===0?o.jsx(Ud,{}):a&&Ie.length===0?o.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[o.jsx("p",{children:b("artifactLibrary.loadFailed")}),o.jsx("span",{children:a}),l?o.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):De.length===0?o.jsxs("div",{className:"artifact-library-empty",children:[o.jsx("p",{children:b(at?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),o.jsx("span",{children:b(at?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):o.jsx("div",{className:"artifact-library-list",children:o.jsxs("table",{className:"artifact-library-table",children:[o.jsxs("colgroup",{children:[o.jsx("col",{className:"artifact-library-table__file-column"}),o.jsx("col",{className:"artifact-library-table__source-column"}),o.jsx("col",{className:"artifact-library-table__time-column"}),o.jsx("col",{className:"artifact-library-table__actions-column"})]}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),o.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),o.jsx("tbody",{children:J.map(ve=>o.jsx(Got,{artifact:ve,pendingAction:_,disabled:!n&&!t,onPreview:He=>void qe(He),onDownload:He=>void Ae(He),onEdit:c?He=>{B(""),H(He)}:void 0,onDelete:u?le:void 0,onOpenSource:f,t:b,locale:y},ve.id))})]})}),he?o.jsx("div",{ref:ke,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),o.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:T}),S?o.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[o.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:Le}),o.jsxs("div",{ref:ae,className:"artifact-library-preview-panel",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"artifact-library-preview-title",children:S.name}),o.jsx("p",{children:b("artifactLibrary.preview.meta",{type:Wot(b,S.type),version:S.version})})]}),o.jsx("button",{ref:X,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:Le,children:o.jsx(NOe,{})})]}),o.jsxs("div",{className:"artifact-library-preview-content",children:[o.jsx("div",{className:"artifact-library-preview-canvas",children:_===`preview:${S.id}`?o.jsx(xn,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):C&&S.preview.mode==="image"?o.jsx("img",{src:C,alt:b("artifactLibrary.preview.alt",{name:S.name})}):C&&S.preview.mode==="video"?o.jsx("video",{src:C,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:S.name})}):C&&S.preview.mode==="frame"?o.jsx("iframe",{src:C,title:b("artifactLibrary.preview.alt",{name:S.name})}):o.jsxs("div",{className:"artifact-library-preview-unavailable",children:[o.jsx(WOe,{artifact:S,large:!0}),o.jsx("p",{children:b(A?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),o.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[S.description?o.jsx("p",{className:"artifact-library-preview-description",children:S.description}):null,o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.agent")}),o.jsx("dd",{title:S.agentName,children:S.agentName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.session")}),o.jsx("dd",{title:S.sessionTitle,children:S.sessionTitle})]}),(wt=S.origin)!=null&&wt.toolName?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.tool")}),o.jsx("dd",{children:S.origin.toolName})]}):null,o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),o.jsx("dd",{children:HOe(S.createdAt,y,b("artifactLibrary.unknownTime"))})]}),S.sizeBytes?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),o.jsx("dd",{children:qOe(S.sizeBytes)})]}):null]}),(Se=S.tags)!=null&&Se.length?o.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:S.tags.map(ve=>o.jsx("span",{children:ve},ve))}):null]})]}),o.jsxs("footer",{children:[o.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?o.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const ve=S;Le(),f(ve)},children:[o.jsx(yat,{}),b("artifactLibrary.preview.viewSession")]}):null,c?o.jsxs("button",{type:"button",className:"is-secondary",disabled:S.canManage===!1,onClick:()=>{const ve=S;Le(),B(""),H(ve)},children:[o.jsx(vat,{}),b("artifactLibrary.edit")]}):null]}),o.jsxs("button",{type:"button",disabled:_.startsWith("download:")||!n&&!t,onClick:()=>void Ae(S),children:[o.jsx(bat,{}),b("artifactLibrary.download")]})]})]})]}):null,I?o.jsx(Oat,{artifact:I,busy:K,error:q,onClose:()=>{K||H(null)},onSave:ve=>void ze(ve)}):null,ee?o.jsx(pc,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:ee.name}),confirmLabel:b(se?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:se,onCancel:()=>{se||le(null)},onConfirm:()=>void Ee()}):null]})}an.hasResourceBundle("en-US","workspaceTools")||an.addResourceBundle("en-US","workspaceTools",sle,!0,!0);an.hasResourceBundle("zh-CN","workspaceTools")||an.addResourceBundle("zh-CN","workspaceTools",Ofe,!0,!0);function Um(e,t={}){return an.t(e,{...t,ns:"workspaceTools"})}function Xot(e,t){if(e&&typeof e=="object"&&"detail"in e){const n=e.detail;if(typeof n=="string"&&n.trim())return n}return t}async function fE(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(Xot(n,Um("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function vM(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 GOe(e){const t=e;return{...t,createdAt:vM(t.createdAt),updatedAt:vM(t.updatedAt),sessionUpdatedAt:vM(t.sessionUpdatedAt)}}async function KOe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(GOe):[]}async function Yot(){const e=await fE(await An("/web/artifacts"),Um("artifactLibrary.api.listFailed"));return KOe(e)}async function Zot(e){if(e.length===0)return Yot();const t=await fE(await An("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Um("artifactLibrary.api.syncFailed"));return KOe(t)}async function Jot(e,t){const n=await fE(await An(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Um("artifactLibrary.api.updateFailed"));return GOe(await n.json())}async function elt(e){await fE(await An(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Um("artifactLibrary.api.deleteFailed"))}async function tlt(e){const n=await(await fE(await An(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Um("artifactLibrary.api.downloadFailed"))).blob(),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}const XOe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class HR extends Error{constructor(n,i,r={}){super(n);ki(this,"status");ki(this,"errorCode");ki(this,"requestId");ki(this,"diagnostics");ki(this,"detail");ki(this,"payload");ki(this,"rawBody");this.name="KnowledgeRequestError",this.status=i;const s=typeof r=="string"?{errorCode:r}:r;this.errorCode=s.errorCode||"",this.requestId=s.requestId||"",this.diagnostics=s.diagnostics,this.detail=s.detail,this.payload=s.payload,this.rawBody=s.rawBody||""}}class YOe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||V("knowledge.loadFailed")}`).join(` +`));ki(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const nlt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),ilt=6,KK=50,ZOe=4e3;function rlt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function slt(e){const t=rlt(e);return nlt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function alt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function Lw(e){if(alt(e))return V("knowledge.htmlHidden");const t=V("knowledge.redacted");return e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${t}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${t}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,t).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]*(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${t}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${t}`)}function A6(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return Lw(e).slice(0,ZOe);if(typeof e!="object")return;if(t>=ilt)return V("knowledge.depthTruncated");if(n.has(e))return V("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,KK).map(r=>A6(r,t+1,n));const i={};return Object.entries(e).slice(0,KK).forEach(([r,s])=>{i[r]=slt(r)?V("knowledge.redacted"):A6(s,t+1,n)}),i}function XK(e){if(e===void 0)return"";const t=A6(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,ZOe)}catch{return V("knowledge.diagnosticsUnavailable")}}function ho(e,t){if(e instanceof YOe)return e.failures.map(({region:a,error:l})=>`${a} ${ho(l,t)}`).join(` `);if(!(e instanceof HR))return(e instanceof Error?Lw(e.message):"")||t;const n=Lw(e.message)||t,i=[Number.isFinite(e.status)?V("knowledge.statusCode",{status:e.status}):"",e.errorCode?V("knowledge.errorCode",{code:Lw(e.errorCode)}):"",e.requestId?V("knowledge.requestId",{requestId:Lw(e.requestId)}):""].filter(Boolean).join(" · "),r=XK(e.diagnostics),s=XK(e.detail);return[n,i,r?V("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?V("knowledge.detail",{detail:s}):""].filter(Boolean).join(` -`)}function bA(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function alt(e){return Array.isArray(e)?e.map(t=>{const n=iu(t),i=bA(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function olt(e,t=!0){const n=iu(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=iu(i);return{message:typeof i=="string"?t?i.trim():"":bA(r.message,n.message,alt(i)),errorCode:bA(r.errorCode,n.errorCode),requestId:bA(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function iu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Di(e){return typeof e=="string"?e:""}function $S(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function DB(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),description:Di(t.description),providerType:Di(t.providerType),providerKnowledgeId:Di(t.providerKnowledgeId),projectName:Di(t.projectName),region:Di(t.region),status:Di(t.status),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),ownerId:Di(t.ownerId),ownerLabel:Di(t.ownerLabel),canManage:t.canManage===!0}}function hE(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),type:Di(t.type),sizeBytes:$S(t.sizeBytes,0),status:Di(t.status),url:Di(t.url),tosPath:Di(t.tosPath),metadata:iu(t.metadata),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),sourceMarkdown:Di(t.sourceMarkdown)}}function llt(e){const t=iu(e),n=t.attachment,i=iu(n);return{id:Di(t.id),title:Di(t.title),content:Di(t.content),attachmentUrl:Di(t.attachmentUrl)||Di(i.url)||Di(i.previewUrl),attachmentType:Di(t.attachmentType)||Di(i.type)||Di(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Gu(e,t={},n=Wo){var f;const i=Hu(Dh(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:Ol(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let a=s,l=!1;if(s)try{a=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=olt(a,l||c.startsWith("text/plain")),d=r.status===401?V("knowledge.signInRequired"):r.status===403?V("knowledge.forbidden"):r.status===404?V("knowledge.notFound"):r.status===409?V("knowledge.conflict"):V("knowledge.requestFailed",{status:r.status});throw new HR(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function e0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function clt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Gu(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=iu(n);return{items:Array.isArray(i.items)?i.items.map(DB):[],nextToken:Di(i.nextToken)}}function ult(e){return`${e.region}\0${e.id}`}async function dlt(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 clt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},a=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(V("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};a.set(ult(m),m)})}),r.length===n.length)throw new XOe(r);return{items:[...a.values()],nextTokens:s,failures:r}}function flt(e){return Gu("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},is).then(DB)}function hlt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(DB)}function plt(e,t){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"DELETE"},is)}async function mlt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=iu(i);return{items:Array.isArray(r.items)?r.items.map(hE):[],offset:$S(r.offset,0),limit:$S(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function glt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=iu(r);return{document:hE(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(llt):[],sourceMarkdown:Di(s.sourceMarkdown),offset:$S(s.offset,0),limit:$S(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function blt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${e0(t)}`,{method:"POST",body:JSON.stringify(n)},is).then(hE)}async function ylt(e,t,n){const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${e0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},is),r=iu(i);return{name:Di(r.name),url:Di(r.url),sourceMarkdown:Di(r.sourceMarkdown)}}function vlt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${e0(t)}`,{method:"POST",body:i},is).then(hE)}function xlt(e,t,n,i){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hE)}function wlt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"DELETE"},is)}function pE({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:a,auxiliaryAction:l}){return o.jsxs(RB,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:o.jsx(UOe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:o.jsxs(o.Fragment,{children:[l?o.jsx(T6,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,a?o.jsx(T6,{label:`${a.label} ${t}`,icon:a.icon,disabled:a.disabled,title:a.title,onClick:a.onClick}):null]}),children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:t}),title:t,titleText:t,status:n}),o.jsx(PB,{title:i,children:i})]})}function oHt(){}function YK(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const a=n.slice(r,i).trim();(a||!s)&&t.push(a),r=i+1,i=n.indexOf(",",r)}return t}function ZOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Olt=/[$_\p{ID_Start}]/u,Slt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,klt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Elt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Clt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JOe={};function lHt(e){return e?Olt.test(String.fromCodePoint(e)):!1}function cHt(e,t){const i=(t||JOe).jsx?klt:Slt;return e?i.test(String.fromCodePoint(e)):!1}function ZK(e,t){return(JOe.jsx?Clt:Elt).test(e)}const Tlt=/[ \t\n\f\r]/g;function Alt(e){return typeof e=="object"?e.type==="text"?JK(e.value):!1:JK(e)}function JK(e){return e.replace(Tlt,"")===""}let mE=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};mE.prototype.normal={};mE.prototype.property={};mE.prototype.space=void 0;function eSe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new mE(n,i,t)}function FS(e){return e.toLowerCase()}class El{constructor(t,n){this.attribute=n,this.property=t}}El.prototype.attribute="";El.prototype.booleanish=!1;El.prototype.boolean=!1;El.prototype.commaOrSpaceSeparated=!1;El.prototype.commaSeparated=!1;El.prototype.defined=!1;El.prototype.mustUseProperty=!1;El.prototype.number=!1;El.prototype.overloadedBoolean=!1;El.prototype.property="";El.prototype.spaceSeparated=!1;El.prototype.space=void 0;let _lt=0;const ni=t0(),Gs=t0(),_6=t0(),At=t0(),Rr=t0(),sv=t0(),Ql=t0();function t0(){return 2**++_lt}const N6=Object.freeze(Object.defineProperty({__proto__:null,boolean:ni,booleanish:Gs,commaOrSpaceSeparated:Ql,commaSeparated:sv,number:At,overloadedBoolean:_6,spaceSeparated:Rr},Symbol.toStringTag,{value:"Module"})),xM=Object.keys(N6);class MB extends El{constructor(t,n,i,r){let s=-1;if(super(t,n),eX(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Plt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(tX,Mlt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!tX.test(s)){let a=s.replace(Ilt,Dlt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=MB}return new r(i,t)}function Dlt(e){return"-"+e.toLowerCase()}function Mlt(e){return e.charAt(1).toUpperCase()}const gE=eSe([tSe,Nlt,rSe,sSe,aSe],"html"),Qm=eSe([tSe,jlt,rSe,sSe,aSe],"svg");function nX(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function oSe(e){return e.join(" ").trim()}var LB={},iX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Llt=/\n/g,$lt=/^\s*/,Flt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Blt=/^:\s*/,Ult=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Qlt=/^[;\s]*/,zlt=/^\s+|\s+$/g,Vlt=` -`,rX="/",sX="*",Tg="",Hlt="comment",qlt="declaration";function Wlt(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(Llt);b&&(n+=b.length);var v=g.lastIndexOf(Vlt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new a(g),u(),b}}function a(g){this.start=g,this.end={line:n,column:i},this.source=t.source}a.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c($lt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(rX!=e.charAt(0)||sX!=e.charAt(1))){for(var b=2;Tg!=e.charAt(b)&&(sX!=e.charAt(b)||rX!=e.charAt(b+1));)++b;if(b+=2,Tg===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:Hlt,comment:v})}}function h(){var g=s(),b=c(Flt);if(b){if(f(),!c(Blt))return l("property missing ':'");var v=c(Ult),y=g({type:qlt,property:aX(b[0].replace(iX,Tg)),value:v?aX(v[0].replace(iX,Tg)):Tg});return c(Qlt),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 aX(e){return e?e.replace(zlt,Tg):Tg}var Glt=Wlt,Klt=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(LB,"__esModule",{value:!0});LB.default=Ylt;const Xlt=Klt(Glt);function Ylt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,Xlt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:l}=s;r?t(a,l,s):l&&(n=n||{},n[a]=l)}),n}var WR={};Object.defineProperty(WR,"__esModule",{value:!0});WR.camelCase=void 0;var Zlt=/^--[a-zA-Z0-9_-]+$/,Jlt=/-([a-z])/g,ect=/^[^-]+$/,tct=/^-(webkit|moz|ms|o|khtml)-/,nct=/^-(ms)-/,ict=function(e){return!e||ect.test(e)||Zlt.test(e)},rct=function(e,t){return t.toUpperCase()},oX=function(e,t){return"".concat(t,"-")},sct=function(e,t){return t===void 0&&(t={}),ict(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(nct,oX):e=e.replace(tct,oX),e.replace(Jlt,rct))};WR.camelCase=sct;var act=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},oct=act(LB),lct=WR;function j6(e,t){var n={};return!e||typeof e!="string"||(0,oct.default)(e,function(i,r){i&&r&&(n[(0,lct.camelCase)(i,t)]=r)}),n}j6.default=j6;var cct=j6;const uct=px(cct),GR=lSe("end"),Yd=lSe("start");function lSe(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 dct(e){const t=Yd(e),n=GR(e);if(t&&n)return{start:t,end:n}}function CO(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lX(e.position):"start"in e||"end"in e?lX(e):"line"in e||"column"in e?R6(e):""}function R6(e){return cX(e&&e.line)+":"+cX(e&&e.column)}function lX(e){return R6(e&&e.start)+"-"+R6(e&&e.end)}function cX(e){return e&&typeof e=="number"?e:1}class Oo extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(a=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=CO(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Oo.prototype.file="";Oo.prototype.name="";Oo.prototype.reason="";Oo.prototype.message="";Oo.prototype.stack="";Oo.prototype.column=void 0;Oo.prototype.line=void 0;Oo.prototype.ancestors=void 0;Oo.prototype.cause=void 0;Oo.prototype.fatal=void 0;Oo.prototype.place=void 0;Oo.prototype.ruleId=void 0;Oo.prototype.source=void 0;const $B={}.hasOwnProperty,fct=new Map,hct=/[A-Z]/g,pct=new Set(["table","tbody","thead","tfoot","tr"]),mct=new Set(["td","th"]),cSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function gct(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=kct(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=Sct(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Qm:gE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=uSe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function uSe(e,t,n){if(t.type==="element")return bct(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yct(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xct(e,t,n);if(t.type==="mdxjsEsm")return vct(e,t);if(t.type==="root")return wct(e,t,n);if(t.type==="text")return Oct(e,t)}function bct(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=fSe(e,t.tagName,!1),a=Ect(e,t);let l=BB(e,t);return pct.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Alt(c):!0})),dSe(e,a,s,t),FB(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function yct(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}BS(e,t.position)}function vct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);BS(e,t.position)}function xct(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:fSe(e,t.name,!0),a=Cct(e,t),l=BB(e,t);return dSe(e,a,s,t),FB(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function wct(e,t,n){const i={};return FB(i,BB(e,t)),e.create(t,e.Fragment,i,n)}function Oct(e,t){return t.value}function dSe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function FB(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Sct(e,t,n){return i;function i(r,s,a,l){const u=Array.isArray(a.children)?n:t;return l?u(s,a,l):u(s,a)}}function kct(e,t){return n;function n(i,r,s,a){const l=Array.isArray(s.children),c=Yd(i);return t(r,s,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Ect(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&$B.call(t.properties,r)){const s=Tct(e,r,t.properties[r]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&mct.has(t.tagName)?i=l:n[a]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Cct(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else BS(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else BS(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function BB(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:fct;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(lc(e,e.length,0,t),e):t}const fX={}.hasOwnProperty;function pSe(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mo=zm(/[A-Za-z]/),bo=zm(/[\dA-Za-z]/),Mct=zm(/[#-'*+\--9=?A-Z^-~]/);function uN(e){return e!==null&&(e<32||e===127)}const I6=zm(/\d/),Lct=zm(/[\dA-Fa-f]/),$ct=zm(/[!-/:-@[-`{-~]/);function Tn(e){return e!==null&&e<-2}function Ar(e){return e!==null&&(e<0||e===32)}function wi(e){return e===-2||e===-1||e===32}const KR=zm(new RegExp("\\p{P}|\\p{S}","u")),Tb=zm(/\s/);function zm(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qx(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),r=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Ui(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return wi(c)?(e.enter(n),l(c)):t(c)}function l(c){return wi(c)&&s++a))return;const E=t.events.length;let C=E,N,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(N){_=t.events[C][1].end;break}N=!0}for(y(i),S=E;SO;){const k=n[w];t.containerState=k[1],k[0].exit.call(t,e)}n.length=O}function x(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function zct(e,t,n){return Ui(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yv(e){if(e===null||Ar(e)||Tb(e))return 1;if(KR(e))return 2}function XR(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};pX(f,-c),pX(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[i][1].end={...a.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Lc(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Lc(u,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Lc(u,XR(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Lc(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Lc(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,lc(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&wi(S)?Ui(e,x,"linePrefix",s+1)(S):x(S)}function x(S){return S===null||Tn(S)?e.check(mX,b,w)(S):(e.enter("codeFlowValue"),O(S))}function O(S){return S===null||Tn(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),O)}function w(S){return e.exit("codeFenced"),t(S)}function k(S,E,C){let N=0;return _;function _(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),j}function j(P){return S.enter("codeFencedFence"),wi(P)?Ui(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):A(P)}function A(P){return P===l?(S.enter("codeFencedFenceSequence"),F(P)):C(P)}function F(P){return P===l?(N++,S.consume(P),F):N>=a?(S.exit("codeFencedFenceSequence"),wi(P)?Ui(S,T,"whitespace")(P):T(P)):C(P)}function T(P){return P===null||Tn(P)?(S.exit("codeFencedFence"),E(P)):C(P)}}}function tut(e,t,n){const i=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const OM={name:"codeIndented",tokenize:iut},nut={partial:!0,tokenize:rut};function iut(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),Ui(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):Tn(u)?e.attempt(nut,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Tn(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function rut(e,t,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):Tn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):Ui(e,s,"linePrefix",5)(a)}function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):Tn(a)?r(a):n(a)}}const sut={name:"codeText",previous:out,resolve:aut,tokenize:lut};function aut(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&V1(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),V1(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),V1(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}function xSe(e,t,n,i,r,s,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||uN(y)?n(y):(e.enter(i),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Tn(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||Ar(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Tn(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||Tn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!wi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function OSe(e,t,n,i,r,s){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),c(a)):h===null?n(h):Tn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ui(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Tn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function TO(e,t){let n;return i;function i(r){return Tn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):wi(r)?Ui(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const gut={name:"definition",tokenize:yut},but={partial:!0,tokenize:vut};function yut(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return wSe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=Du(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 Ar(m)?TO(e,u)(m):u(m)}function u(m){return xSe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(but,f,f)(m)}function f(m){return wi(m)?Ui(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Tn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function vut(e,t,n){return i;function i(l){return Ar(l)?TO(e,r)(l):n(l)}function r(l){return OSe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return wi(l)?Ui(e,a,"whitespace")(l):a(l)}function a(l){return l===null||Tn(l)?t(l):n(l)}}const xut={name:"hardBreakEscape",tokenize:wut};function wut(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Tn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Out={name:"headingAtx",resolve:Sut,tokenize:kut};function Sut(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},lc(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function kut(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&i++<6?(e.consume(d),a):d===null||Ar(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Tn(d)?(e.exit("atxHeading"),t(d)):wi(d)?Ui(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Ar(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Eut=["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"],bX=["pre","script","style","textarea"],Cut={concrete:!0,name:"htmlFlow",resolveTo:_ut,tokenize:Nut},Tut={partial:!0,tokenize:Rut},Aut={partial:!0,tokenize:jut};function _ut(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 Nut(e,t,n){const i=this;let r,s,a,l,c;return u;function u(Q){return d(Q)}function d(Q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(Q),f}function f(Q){return Q===33?(e.consume(Q),h):Q===47?(e.consume(Q),s=!0,b):Q===63?(e.consume(Q),r=3,i.interrupt?t:I):Mo(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function h(Q){return Q===45?(e.consume(Q),r=2,m):Q===91?(e.consume(Q),r=5,l=0,g):Mo(Q)?(e.consume(Q),r=4,i.interrupt?t:I):n(Q)}function m(Q){return Q===45?(e.consume(Q),i.interrupt?t:I):n(Q)}function g(Q){const q="CDATA[";return Q===q.charCodeAt(l++)?(e.consume(Q),l===q.length?i.interrupt?t:A:g):n(Q)}function b(Q){return Mo(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function v(Q){if(Q===null||Q===47||Q===62||Ar(Q)){const q=Q===47,B=a.toLowerCase();return!q&&!s&&bX.includes(B)?(r=1,i.interrupt?t(Q):A(Q)):Eut.includes(a.toLowerCase())?(r=6,q?(e.consume(Q),y):i.interrupt?t(Q):A(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(Q):s?x(Q):O(Q))}return Q===45||bo(Q)?(e.consume(Q),a+=String.fromCharCode(Q),v):n(Q)}function y(Q){return Q===62?(e.consume(Q),i.interrupt?t:A):n(Q)}function x(Q){return wi(Q)?(e.consume(Q),x):_(Q)}function O(Q){return Q===47?(e.consume(Q),_):Q===58||Q===95||Mo(Q)?(e.consume(Q),w):wi(Q)?(e.consume(Q),O):_(Q)}function w(Q){return Q===45||Q===46||Q===58||Q===95||bo(Q)?(e.consume(Q),w):k(Q)}function k(Q){return Q===61?(e.consume(Q),S):wi(Q)?(e.consume(Q),k):O(Q)}function S(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),c=Q,E):wi(Q)?(e.consume(Q),S):C(Q)}function E(Q){return Q===c?(e.consume(Q),c=null,N):Q===null||Tn(Q)?n(Q):(e.consume(Q),E)}function C(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Ar(Q)?k(Q):(e.consume(Q),C)}function N(Q){return Q===47||Q===62||wi(Q)?O(Q):n(Q)}function _(Q){return Q===62?(e.consume(Q),j):n(Q)}function j(Q){return Q===null||Tn(Q)?A(Q):wi(Q)?(e.consume(Q),j):n(Q)}function A(Q){return Q===45&&r===2?(e.consume(Q),R):Q===60&&r===1?(e.consume(Q),L):Q===62&&r===4?(e.consume(Q),H):Q===63&&r===3?(e.consume(Q),I):Q===93&&r===5?(e.consume(Q),U):Tn(Q)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Tut,K,F)(Q)):Q===null||Tn(Q)?(e.exit("htmlFlowData"),F(Q)):(e.consume(Q),A)}function F(Q){return e.check(Aut,T,K)(Q)}function T(Q){return e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),P}function P(Q){return Q===null||Tn(Q)?F(Q):(e.enter("htmlFlowData"),A(Q))}function R(Q){return Q===45?(e.consume(Q),I):A(Q)}function L(Q){return Q===47?(e.consume(Q),a="",M):A(Q)}function M(Q){if(Q===62){const q=a.toLowerCase();return bX.includes(q)?(e.consume(Q),H):A(Q)}return Mo(Q)&&a.length<8?(e.consume(Q),a+=String.fromCharCode(Q),M):A(Q)}function U(Q){return Q===93?(e.consume(Q),I):A(Q)}function I(Q){return Q===62?(e.consume(Q),H):Q===45&&r===2?(e.consume(Q),I):A(Q)}function H(Q){return Q===null||Tn(Q)?(e.exit("htmlFlowData"),K(Q)):(e.consume(Q),H)}function K(Q){return e.exit("htmlFlow"),t(Q)}}function jut(e,t,n){const i=this;return r;function r(a){return Tn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function Rut(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(bE,t,n)}}const Iut={name:"htmlText",tokenize:Put};function Put(e,t,n){const i=this;let r,s,a;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),O):Mo(I)?(e.consume(I),C):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),s=0,g):Mo(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),m):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):Tn(I)?(a=f,L(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),m):f(I)}function m(I){return I===62?R(I):I===45?h(I):f(I)}function g(I){const H="CDATA[";return I===H.charCodeAt(s++)?(e.consume(I),s===H.length?b:g):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):Tn(I)?(a=b,L(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),y):b(I)}function y(I){return I===62?R(I):I===93?(e.consume(I),y):b(I)}function x(I){return I===null||I===62?R(I):Tn(I)?(a=x,L(I)):(e.consume(I),x)}function O(I){return I===null?n(I):I===63?(e.consume(I),w):Tn(I)?(a=O,L(I)):(e.consume(I),O)}function w(I){return I===62?R(I):O(I)}function k(I){return Mo(I)?(e.consume(I),S):n(I)}function S(I){return I===45||bo(I)?(e.consume(I),S):E(I)}function E(I){return Tn(I)?(a=E,L(I)):wi(I)?(e.consume(I),E):R(I)}function C(I){return I===45||bo(I)?(e.consume(I),C):I===47||I===62||Ar(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),R):I===58||I===95||Mo(I)?(e.consume(I),_):Tn(I)?(a=N,L(I)):wi(I)?(e.consume(I),N):R(I)}function _(I){return I===45||I===46||I===58||I===95||bo(I)?(e.consume(I),_):j(I)}function j(I){return I===61?(e.consume(I),A):Tn(I)?(a=j,L(I)):wi(I)?(e.consume(I),j):N(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,F):Tn(I)?(a=A,L(I)):wi(I)?(e.consume(I),A):(e.consume(I),T)}function F(I){return I===r?(e.consume(I),r=void 0,P):I===null?n(I):Tn(I)?(a=F,L(I)):(e.consume(I),F)}function T(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ar(I)?N(I):(e.consume(I),T)}function P(I){return I===47||I===62||Ar(I)?N(I):n(I)}function R(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function L(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(I){return wi(I)?Ui(e,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):U(I)}function U(I){return e.enter("htmlTextData"),a(I)}}const zB={name:"labelEnd",resolveAll:$ut,resolveTo:Fut,tokenize:But},Dut={tokenize:Uut},Mut={tokenize:Qut},Lut={tokenize:zut};function $ut(e){let t=-1;const n=[];for(;++t=3&&(u===null||Tn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),wi(u)?Ui(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:Jut},exit:tdt,name:"list",tokenize:Zut},Xut={partial:!0,tokenize:ndt},Yut={partial:!0,tokenize:edt};function Zut(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:I6(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(yA,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 I6(m)&&++a<10?(e.consume(m),c):(!i.interrupt||a<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(bE,i.interrupt?n:d,e.attempt(Xut,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return wi(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 Jut(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(bE,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ui(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!wi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Yut,t,a)(l))}function a(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ui(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function edt(e,t,n){const i=this;return Ui(e,r,"listItemIndent",i.containerState.size+1);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(s):n(s)}}function tdt(e){e.exit(this.containerState.type)}function ndt(e,t,n){const i=this;return Ui(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const a=i.events[i.events.length-1];return!wi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const yX={name:"setextUnderline",resolveTo:idt,tokenize:rdt};function idt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",a,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function rdt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),wi(u)?Ui(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Tn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const sdt={tokenize:adt};function adt(e){const t=this,n=e.attempt(bE,i,e.attempt(this.parser.constructs.flowInitial,r,Ui(e,e.attempt(this.parser.constructs.flow,r,e.attempt(dut,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 odt={resolveAll:kSe()},ldt=SSe("string"),cdt=SSe("text");function SSe(e){return{resolveAll:kSe(e==="text"?udt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,a,l);return a;function a(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(i):a.shift()}s>0&&a.push(e[r].slice(0,s))}return a}function Sdt(e,t){let n=-1;const i=[];let r;for(;++n{const n=iu(t),i=bA(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function llt(e,t=!0){const n=iu(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=iu(i);return{message:typeof i=="string"?t?i.trim():"":bA(r.message,n.message,olt(i)),errorCode:bA(r.errorCode,n.errorCode),requestId:bA(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function iu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Di(e){return typeof e=="string"?e:""}function $S(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function DB(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),description:Di(t.description),providerType:Di(t.providerType),providerKnowledgeId:Di(t.providerKnowledgeId),projectName:Di(t.projectName),region:Di(t.region),status:Di(t.status),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),ownerId:Di(t.ownerId),ownerLabel:Di(t.ownerLabel),canManage:t.canManage===!0}}function hE(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),type:Di(t.type),sizeBytes:$S(t.sizeBytes,0),status:Di(t.status),url:Di(t.url),tosPath:Di(t.tosPath),metadata:iu(t.metadata),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),sourceMarkdown:Di(t.sourceMarkdown)}}function clt(e){const t=iu(e),n=t.attachment,i=iu(n);return{id:Di(t.id),title:Di(t.title),content:Di(t.content),attachmentUrl:Di(t.attachmentUrl)||Di(i.url)||Di(i.previewUrl),attachmentType:Di(t.attachmentType)||Di(i.type)||Di(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Gu(e,t={},n=Wo){var f;const i=Hu(Dh(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:Ol(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let a=s,l=!1;if(s)try{a=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=llt(a,l||c.startsWith("text/plain")),d=r.status===401?V("knowledge.signInRequired"):r.status===403?V("knowledge.forbidden"):r.status===404?V("knowledge.notFound"):r.status===409?V("knowledge.conflict"):V("knowledge.requestFailed",{status:r.status});throw new HR(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function e0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function ult(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Gu(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=iu(n);return{items:Array.isArray(i.items)?i.items.map(DB):[],nextToken:Di(i.nextToken)}}function dlt(e){return`${e.region}\0${e.id}`}async function flt(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 ult({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},a=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(V("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};a.set(dlt(m),m)})}),r.length===n.length)throw new YOe(r);return{items:[...a.values()],nextTokens:s,failures:r}}function hlt(e){return Gu("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},is).then(DB)}function plt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(DB)}function mlt(e,t){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"DELETE"},is)}async function glt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=iu(i);return{items:Array.isArray(r.items)?r.items.map(hE):[],offset:$S(r.offset,0),limit:$S(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function blt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=iu(r);return{document:hE(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(clt):[],sourceMarkdown:Di(s.sourceMarkdown),offset:$S(s.offset,0),limit:$S(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function ylt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${e0(t)}`,{method:"POST",body:JSON.stringify(n)},is).then(hE)}async function vlt(e,t,n){const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${e0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},is),r=iu(i);return{name:Di(r.name),url:Di(r.url),sourceMarkdown:Di(r.sourceMarkdown)}}function xlt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${e0(t)}`,{method:"POST",body:i},is).then(hE)}function wlt(e,t,n,i){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hE)}function Olt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"DELETE"},is)}function pE({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:a,auxiliaryAction:l}){return o.jsxs(RB,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:o.jsx(QOe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:o.jsxs(o.Fragment,{children:[l?o.jsx(T6,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,a?o.jsx(T6,{label:`${a.label} ${t}`,icon:a.icon,disabled:a.disabled,title:a.title,onClick:a.onClick}):null]}),children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:t}),title:t,titleText:t,status:n}),o.jsx(PB,{title:i,children:i})]})}function oHt(){}function YK(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const a=n.slice(r,i).trim();(a||!s)&&t.push(a),r=i+1,i=n.indexOf(",",r)}return t}function JOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Slt=/[$_\p{ID_Start}]/u,klt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Elt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Clt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tlt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eSe={};function lHt(e){return e?Slt.test(String.fromCodePoint(e)):!1}function cHt(e,t){const i=(t||eSe).jsx?Elt:klt;return e?i.test(String.fromCodePoint(e)):!1}function ZK(e,t){return(eSe.jsx?Tlt:Clt).test(e)}const Alt=/[ \t\n\f\r]/g;function _lt(e){return typeof e=="object"?e.type==="text"?JK(e.value):!1:JK(e)}function JK(e){return e.replace(Alt,"")===""}let mE=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};mE.prototype.normal={};mE.prototype.property={};mE.prototype.space=void 0;function tSe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new mE(n,i,t)}function FS(e){return e.toLowerCase()}class El{constructor(t,n){this.attribute=n,this.property=t}}El.prototype.attribute="";El.prototype.booleanish=!1;El.prototype.boolean=!1;El.prototype.commaOrSpaceSeparated=!1;El.prototype.commaSeparated=!1;El.prototype.defined=!1;El.prototype.mustUseProperty=!1;El.prototype.number=!1;El.prototype.overloadedBoolean=!1;El.prototype.property="";El.prototype.spaceSeparated=!1;El.prototype.space=void 0;let Nlt=0;const ni=t0(),Gs=t0(),_6=t0(),At=t0(),Rr=t0(),sv=t0(),Ql=t0();function t0(){return 2**++Nlt}const N6=Object.freeze(Object.defineProperty({__proto__:null,boolean:ni,booleanish:Gs,commaOrSpaceSeparated:Ql,commaSeparated:sv,number:At,overloadedBoolean:_6,spaceSeparated:Rr},Symbol.toStringTag,{value:"Module"})),xM=Object.keys(N6);class MB extends El{constructor(t,n,i,r){let s=-1;if(super(t,n),eX(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Dlt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(tX,Llt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!tX.test(s)){let a=s.replace(Plt,Mlt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=MB}return new r(i,t)}function Mlt(e){return"-"+e.toLowerCase()}function Llt(e){return e.charAt(1).toUpperCase()}const gE=tSe([nSe,jlt,sSe,aSe,oSe],"html"),Qm=tSe([nSe,Rlt,sSe,aSe,oSe],"svg");function nX(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function lSe(e){return e.join(" ").trim()}var LB={},iX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$lt=/\n/g,Flt=/^\s*/,Blt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ult=/^:\s*/,Qlt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zlt=/^[;\s]*/,Vlt=/^\s+|\s+$/g,Hlt=` +`,rX="/",sX="*",Tg="",qlt="comment",Wlt="declaration";function Glt(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($lt);b&&(n+=b.length);var v=g.lastIndexOf(Hlt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new a(g),u(),b}}function a(g){this.start=g,this.end={line:n,column:i},this.source=t.source}a.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(Flt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(rX!=e.charAt(0)||sX!=e.charAt(1))){for(var b=2;Tg!=e.charAt(b)&&(sX!=e.charAt(b)||rX!=e.charAt(b+1));)++b;if(b+=2,Tg===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:qlt,comment:v})}}function h(){var g=s(),b=c(Blt);if(b){if(f(),!c(Ult))return l("property missing ':'");var v=c(Qlt),y=g({type:Wlt,property:aX(b[0].replace(iX,Tg)),value:v?aX(v[0].replace(iX,Tg)):Tg});return c(zlt),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 aX(e){return e?e.replace(Vlt,Tg):Tg}var Klt=Glt,Xlt=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(LB,"__esModule",{value:!0});LB.default=Zlt;const Ylt=Xlt(Klt);function Zlt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,Ylt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:l}=s;r?t(a,l,s):l&&(n=n||{},n[a]=l)}),n}var WR={};Object.defineProperty(WR,"__esModule",{value:!0});WR.camelCase=void 0;var Jlt=/^--[a-zA-Z0-9_-]+$/,ect=/-([a-z])/g,tct=/^[^-]+$/,nct=/^-(webkit|moz|ms|o|khtml)-/,ict=/^-(ms)-/,rct=function(e){return!e||tct.test(e)||Jlt.test(e)},sct=function(e,t){return t.toUpperCase()},oX=function(e,t){return"".concat(t,"-")},act=function(e,t){return t===void 0&&(t={}),rct(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ict,oX):e=e.replace(nct,oX),e.replace(ect,sct))};WR.camelCase=act;var oct=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lct=oct(LB),cct=WR;function j6(e,t){var n={};return!e||typeof e!="string"||(0,lct.default)(e,function(i,r){i&&r&&(n[(0,cct.camelCase)(i,t)]=r)}),n}j6.default=j6;var uct=j6;const dct=px(uct),GR=cSe("end"),Yd=cSe("start");function cSe(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 fct(e){const t=Yd(e),n=GR(e);if(t&&n)return{start:t,end:n}}function CO(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lX(e.position):"start"in e||"end"in e?lX(e):"line"in e||"column"in e?R6(e):""}function R6(e){return cX(e&&e.line)+":"+cX(e&&e.column)}function lX(e){return R6(e&&e.start)+"-"+R6(e&&e.end)}function cX(e){return e&&typeof e=="number"?e:1}class Oo extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(a=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=CO(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Oo.prototype.file="";Oo.prototype.name="";Oo.prototype.reason="";Oo.prototype.message="";Oo.prototype.stack="";Oo.prototype.column=void 0;Oo.prototype.line=void 0;Oo.prototype.ancestors=void 0;Oo.prototype.cause=void 0;Oo.prototype.fatal=void 0;Oo.prototype.place=void 0;Oo.prototype.ruleId=void 0;Oo.prototype.source=void 0;const $B={}.hasOwnProperty,hct=new Map,pct=/[A-Z]/g,mct=new Set(["table","tbody","thead","tfoot","tr"]),gct=new Set(["td","th"]),uSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bct(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=Ect(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=kct(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Qm:gE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=dSe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function dSe(e,t,n){if(t.type==="element")return yct(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vct(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wct(e,t,n);if(t.type==="mdxjsEsm")return xct(e,t);if(t.type==="root")return Oct(e,t,n);if(t.type==="text")return Sct(e,t)}function yct(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=hSe(e,t.tagName,!1),a=Cct(e,t);let l=BB(e,t);return mct.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!_lt(c):!0})),fSe(e,a,s,t),FB(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function vct(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}BS(e,t.position)}function xct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);BS(e,t.position)}function wct(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:hSe(e,t.name,!0),a=Tct(e,t),l=BB(e,t);return fSe(e,a,s,t),FB(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function Oct(e,t,n){const i={};return FB(i,BB(e,t)),e.create(t,e.Fragment,i,n)}function Sct(e,t){return t.value}function fSe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function FB(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function kct(e,t,n){return i;function i(r,s,a,l){const u=Array.isArray(a.children)?n:t;return l?u(s,a,l):u(s,a)}}function Ect(e,t){return n;function n(i,r,s,a){const l=Array.isArray(s.children),c=Yd(i);return t(r,s,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Cct(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&$B.call(t.properties,r)){const s=Act(e,r,t.properties[r]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&gct.has(t.tagName)?i=l:n[a]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Tct(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else BS(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else BS(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function BB(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:hct;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(lc(e,e.length,0,t),e):t}const fX={}.hasOwnProperty;function mSe(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mo=zm(/[A-Za-z]/),bo=zm(/[\dA-Za-z]/),Lct=zm(/[#-'*+\--9=?A-Z^-~]/);function uN(e){return e!==null&&(e<32||e===127)}const I6=zm(/\d/),$ct=zm(/[\dA-Fa-f]/),Fct=zm(/[!-/:-@[-`{-~]/);function Tn(e){return e!==null&&e<-2}function Ar(e){return e!==null&&(e<0||e===32)}function wi(e){return e===-2||e===-1||e===32}const KR=zm(new RegExp("\\p{P}|\\p{S}","u")),Tb=zm(/\s/);function zm(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qx(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),r=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Ui(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return wi(c)?(e.enter(n),l(c)):t(c)}function l(c){return wi(c)&&s++a))return;const E=t.events.length;let C=E,N,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(N){_=t.events[C][1].end;break}N=!0}for(y(i),S=E;SO;){const k=n[w];t.containerState=k[1],k[0].exit.call(t,e)}n.length=O}function x(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Vct(e,t,n){return Ui(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yv(e){if(e===null||Ar(e)||Tb(e))return 1;if(KR(e))return 2}function XR(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};pX(f,-c),pX(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[i][1].end={...a.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Lc(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Lc(u,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Lc(u,XR(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Lc(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Lc(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,lc(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&wi(S)?Ui(e,x,"linePrefix",s+1)(S):x(S)}function x(S){return S===null||Tn(S)?e.check(mX,b,w)(S):(e.enter("codeFlowValue"),O(S))}function O(S){return S===null||Tn(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),O)}function w(S){return e.exit("codeFenced"),t(S)}function k(S,E,C){let N=0;return _;function _(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),j}function j(P){return S.enter("codeFencedFence"),wi(P)?Ui(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):A(P)}function A(P){return P===l?(S.enter("codeFencedFenceSequence"),F(P)):C(P)}function F(P){return P===l?(N++,S.consume(P),F):N>=a?(S.exit("codeFencedFenceSequence"),wi(P)?Ui(S,T,"whitespace")(P):T(P)):C(P)}function T(P){return P===null||Tn(P)?(S.exit("codeFencedFence"),E(P)):C(P)}}}function nut(e,t,n){const i=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const OM={name:"codeIndented",tokenize:rut},iut={partial:!0,tokenize:sut};function rut(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),Ui(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):Tn(u)?e.attempt(iut,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Tn(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function sut(e,t,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):Tn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):Ui(e,s,"linePrefix",5)(a)}function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):Tn(a)?r(a):n(a)}}const aut={name:"codeText",previous:lut,resolve:out,tokenize:cut};function out(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&V1(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),V1(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),V1(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}function wSe(e,t,n,i,r,s,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||uN(y)?n(y):(e.enter(i),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Tn(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||Ar(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Tn(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||Tn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!wi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function SSe(e,t,n,i,r,s){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),c(a)):h===null?n(h):Tn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ui(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Tn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function TO(e,t){let n;return i;function i(r){return Tn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):wi(r)?Ui(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const but={name:"definition",tokenize:vut},yut={partial:!0,tokenize:xut};function vut(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return OSe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=Du(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 Ar(m)?TO(e,u)(m):u(m)}function u(m){return wSe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(yut,f,f)(m)}function f(m){return wi(m)?Ui(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Tn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function xut(e,t,n){return i;function i(l){return Ar(l)?TO(e,r)(l):n(l)}function r(l){return SSe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return wi(l)?Ui(e,a,"whitespace")(l):a(l)}function a(l){return l===null||Tn(l)?t(l):n(l)}}const wut={name:"hardBreakEscape",tokenize:Out};function Out(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Tn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Sut={name:"headingAtx",resolve:kut,tokenize:Eut};function kut(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},lc(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Eut(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&i++<6?(e.consume(d),a):d===null||Ar(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Tn(d)?(e.exit("atxHeading"),t(d)):wi(d)?Ui(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Ar(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Cut=["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"],bX=["pre","script","style","textarea"],Tut={concrete:!0,name:"htmlFlow",resolveTo:Nut,tokenize:jut},Aut={partial:!0,tokenize:Iut},_ut={partial:!0,tokenize:Rut};function Nut(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 jut(e,t,n){const i=this;let r,s,a,l,c;return u;function u(Q){return d(Q)}function d(Q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(Q),f}function f(Q){return Q===33?(e.consume(Q),h):Q===47?(e.consume(Q),s=!0,b):Q===63?(e.consume(Q),r=3,i.interrupt?t:I):Mo(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function h(Q){return Q===45?(e.consume(Q),r=2,m):Q===91?(e.consume(Q),r=5,l=0,g):Mo(Q)?(e.consume(Q),r=4,i.interrupt?t:I):n(Q)}function m(Q){return Q===45?(e.consume(Q),i.interrupt?t:I):n(Q)}function g(Q){const q="CDATA[";return Q===q.charCodeAt(l++)?(e.consume(Q),l===q.length?i.interrupt?t:A:g):n(Q)}function b(Q){return Mo(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function v(Q){if(Q===null||Q===47||Q===62||Ar(Q)){const q=Q===47,B=a.toLowerCase();return!q&&!s&&bX.includes(B)?(r=1,i.interrupt?t(Q):A(Q)):Cut.includes(a.toLowerCase())?(r=6,q?(e.consume(Q),y):i.interrupt?t(Q):A(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(Q):s?x(Q):O(Q))}return Q===45||bo(Q)?(e.consume(Q),a+=String.fromCharCode(Q),v):n(Q)}function y(Q){return Q===62?(e.consume(Q),i.interrupt?t:A):n(Q)}function x(Q){return wi(Q)?(e.consume(Q),x):_(Q)}function O(Q){return Q===47?(e.consume(Q),_):Q===58||Q===95||Mo(Q)?(e.consume(Q),w):wi(Q)?(e.consume(Q),O):_(Q)}function w(Q){return Q===45||Q===46||Q===58||Q===95||bo(Q)?(e.consume(Q),w):k(Q)}function k(Q){return Q===61?(e.consume(Q),S):wi(Q)?(e.consume(Q),k):O(Q)}function S(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),c=Q,E):wi(Q)?(e.consume(Q),S):C(Q)}function E(Q){return Q===c?(e.consume(Q),c=null,N):Q===null||Tn(Q)?n(Q):(e.consume(Q),E)}function C(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Ar(Q)?k(Q):(e.consume(Q),C)}function N(Q){return Q===47||Q===62||wi(Q)?O(Q):n(Q)}function _(Q){return Q===62?(e.consume(Q),j):n(Q)}function j(Q){return Q===null||Tn(Q)?A(Q):wi(Q)?(e.consume(Q),j):n(Q)}function A(Q){return Q===45&&r===2?(e.consume(Q),R):Q===60&&r===1?(e.consume(Q),L):Q===62&&r===4?(e.consume(Q),H):Q===63&&r===3?(e.consume(Q),I):Q===93&&r===5?(e.consume(Q),U):Tn(Q)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Aut,K,F)(Q)):Q===null||Tn(Q)?(e.exit("htmlFlowData"),F(Q)):(e.consume(Q),A)}function F(Q){return e.check(_ut,T,K)(Q)}function T(Q){return e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),P}function P(Q){return Q===null||Tn(Q)?F(Q):(e.enter("htmlFlowData"),A(Q))}function R(Q){return Q===45?(e.consume(Q),I):A(Q)}function L(Q){return Q===47?(e.consume(Q),a="",M):A(Q)}function M(Q){if(Q===62){const q=a.toLowerCase();return bX.includes(q)?(e.consume(Q),H):A(Q)}return Mo(Q)&&a.length<8?(e.consume(Q),a+=String.fromCharCode(Q),M):A(Q)}function U(Q){return Q===93?(e.consume(Q),I):A(Q)}function I(Q){return Q===62?(e.consume(Q),H):Q===45&&r===2?(e.consume(Q),I):A(Q)}function H(Q){return Q===null||Tn(Q)?(e.exit("htmlFlowData"),K(Q)):(e.consume(Q),H)}function K(Q){return e.exit("htmlFlow"),t(Q)}}function Rut(e,t,n){const i=this;return r;function r(a){return Tn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function Iut(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(bE,t,n)}}const Put={name:"htmlText",tokenize:Dut};function Dut(e,t,n){const i=this;let r,s,a;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),O):Mo(I)?(e.consume(I),C):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),s=0,g):Mo(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),m):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):Tn(I)?(a=f,L(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),m):f(I)}function m(I){return I===62?R(I):I===45?h(I):f(I)}function g(I){const H="CDATA[";return I===H.charCodeAt(s++)?(e.consume(I),s===H.length?b:g):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):Tn(I)?(a=b,L(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),y):b(I)}function y(I){return I===62?R(I):I===93?(e.consume(I),y):b(I)}function x(I){return I===null||I===62?R(I):Tn(I)?(a=x,L(I)):(e.consume(I),x)}function O(I){return I===null?n(I):I===63?(e.consume(I),w):Tn(I)?(a=O,L(I)):(e.consume(I),O)}function w(I){return I===62?R(I):O(I)}function k(I){return Mo(I)?(e.consume(I),S):n(I)}function S(I){return I===45||bo(I)?(e.consume(I),S):E(I)}function E(I){return Tn(I)?(a=E,L(I)):wi(I)?(e.consume(I),E):R(I)}function C(I){return I===45||bo(I)?(e.consume(I),C):I===47||I===62||Ar(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),R):I===58||I===95||Mo(I)?(e.consume(I),_):Tn(I)?(a=N,L(I)):wi(I)?(e.consume(I),N):R(I)}function _(I){return I===45||I===46||I===58||I===95||bo(I)?(e.consume(I),_):j(I)}function j(I){return I===61?(e.consume(I),A):Tn(I)?(a=j,L(I)):wi(I)?(e.consume(I),j):N(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,F):Tn(I)?(a=A,L(I)):wi(I)?(e.consume(I),A):(e.consume(I),T)}function F(I){return I===r?(e.consume(I),r=void 0,P):I===null?n(I):Tn(I)?(a=F,L(I)):(e.consume(I),F)}function T(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ar(I)?N(I):(e.consume(I),T)}function P(I){return I===47||I===62||Ar(I)?N(I):n(I)}function R(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function L(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(I){return wi(I)?Ui(e,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):U(I)}function U(I){return e.enter("htmlTextData"),a(I)}}const zB={name:"labelEnd",resolveAll:Fut,resolveTo:But,tokenize:Uut},Mut={tokenize:Qut},Lut={tokenize:zut},$ut={tokenize:Vut};function Fut(e){let t=-1;const n=[];for(;++t=3&&(u===null||Tn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),wi(u)?Ui(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:edt},exit:ndt,name:"list",tokenize:Jut},Yut={partial:!0,tokenize:idt},Zut={partial:!0,tokenize:tdt};function Jut(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:I6(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(yA,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 I6(m)&&++a<10?(e.consume(m),c):(!i.interrupt||a<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(bE,i.interrupt?n:d,e.attempt(Yut,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return wi(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 edt(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(bE,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ui(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!wi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Zut,t,a)(l))}function a(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ui(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function tdt(e,t,n){const i=this;return Ui(e,r,"listItemIndent",i.containerState.size+1);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(s):n(s)}}function ndt(e){e.exit(this.containerState.type)}function idt(e,t,n){const i=this;return Ui(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const a=i.events[i.events.length-1];return!wi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const yX={name:"setextUnderline",resolveTo:rdt,tokenize:sdt};function rdt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",a,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function sdt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),wi(u)?Ui(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Tn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const adt={tokenize:odt};function odt(e){const t=this,n=e.attempt(bE,i,e.attempt(this.parser.constructs.flowInitial,r,Ui(e,e.attempt(this.parser.constructs.flow,r,e.attempt(fut,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 ldt={resolveAll:ESe()},cdt=kSe("string"),udt=kSe("text");function kSe(e){return{resolveAll:ESe(e==="text"?ddt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,a,l);return a;function a(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(i):a.shift()}s>0&&a.push(e[r].slice(0,s))}return a}function kdt(e,t){let n=-1;const i=[];let r;for(;++n0){const wt=_e.tokenStack[_e.tokenStack.length-1];(wt[1]||xX).call(_e,void 0,wt[0])}for(he.position={start:up(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:up(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at0&&(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 Ldt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $dt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fdt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=qx(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let a,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Bdt(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 Udt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function TSe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=i:r.push({type:"text",value:i}),r}function Qdt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return TSe(e,t);const r={src:qx(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function zdt(e,t){const n={src:qx(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Vdt(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 Hdt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return TSe(e,t);const r={href:qx(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function qdt(e,t){const n={href:qx(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Wdt(e,t,n){const i=e.all(t),r=n?Gdt(n):ASe(t),s={},a=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l0){const wt=_e.tokenStack[_e.tokenStack.length-1];(wt[1]||xX).call(_e,void 0,wt[0])}for(he.position={start:up(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:up(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at0&&(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 $dt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fdt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bdt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=qx(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let a,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Udt(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 Qdt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ASe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=i:r.push({type:"text",value:i}),r}function zdt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ASe(e,t);const r={src:qx(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function Vdt(e,t){const n={src:qx(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Hdt(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 qdt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ASe(e,t);const r={href:qx(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Wdt(e,t){const n={href:qx(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Gdt(e,t,n){const i=e.all(t),r=n?Kdt(n):_Se(t),s={},a=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function Kdt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Yd(t.children[1]),c=GR(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function eft(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(SX(t.slice(r),r>0,!1)),s.join("")}function SX(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===wX||s===OX;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===wX||s===OX;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function ift(e,t){const n={type:"text",value:nft(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function rft(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const sft={blockquote:Pdt,break:Ddt,code:Mdt,delete:Ldt,emphasis:$dt,footnoteReference:Fdt,heading:Bdt,html:Udt,imageReference:Qdt,image:zdt,inlineCode:Vdt,linkReference:Hdt,link:qdt,listItem:Wdt,list:Kdt,paragraph:Xdt,root:Ydt,strong:Zdt,table:Jdt,tableCell:tft,tableRow:eft,text:ift,thematicBreak:rft,toml:ST,yaml:ST,definition:ST,footnoteDefinition:ST};function ST(){}const _Se=-1,YR=0,AO=1,dN=2,VB=3,HB=4,qB=5,WB=6,NSe=7,jSe=8,aft=typeof self=="object"?self:globalThis,kX=(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 aft[e](t)},oft=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,a]=t[r];switch(s){case YR:case _Se:return n(a,r);case AO:{const l=n([],r);for(const c of a)l.push(i(c));return l}case dN:{const l=n({},r);for(const[c,u]of a)l[i(c)]=i(u);return l}case VB:return n(new Date(a),r);case HB:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case qB:{const l=n(new Map,r);for(const[c,u]of a)l.set(i(c),i(u));return l}case WB:{const l=n(new Set,r);for(const c of a)l.add(i(c));return l}case NSe:{const{name:l,message:c}=a;return n(kX(l,c),r)}case jSe:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(kX(s,a),r)};return i},EX=e=>oft(new Map,e)(0),L0="",{toString:lft}={},{keys:cft}=Object,H1=e=>{const t=typeof e;if(t!=="object"||!e)return[YR,t];const n=lft.call(e).slice(8,-1);switch(n){case"Array":return[AO,L0];case"Object":return[dN,L0];case"Date":return[VB,L0];case"RegExp":return[HB,L0];case"Map":return[qB,L0];case"Set":return[WB,L0];case"DataView":return[AO,n]}return n.includes("Array")?[AO,n]:n.includes("Error")?[NSe,n]:[dN,n]},kT=([e,t])=>e===YR&&(t==="function"||t==="symbol"),uft=(e,t,n,i)=>{const r=(a,l)=>{const c=i.push(a)-1;return n.set(l,c),c},s=a=>{if(n.has(a))return n.get(a);let[l,c]=H1(a);switch(l){case YR:{let d=a;switch(c){case"bigint":l=jSe,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([_Se],a)}return r([l,d],a)}case AO:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(s(h));return f}case dN:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=r([l,d],a);for(const h of cft(a))(e||!kT(H1(a[h])))&&d.push([s(h),s(a[h])]);return f}case VB:return r([l,a.toISOString()],a);case HB:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case qB:{const d=[],f=r([l,d],a);for(const[h,m]of a)(e||!(kT(H1(h))||kT(H1(m))))&&d.push([s(h),s(m)]);return f}case WB:{const d=[],f=r([l,d],a);for(const h of a)(e||!kT(H1(h)))&&d.push(s(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return s},CX=(e,{json:t,lossy:n}={})=>{const i=[];return uft(!(t||n),!!t,new Map,i)(e),i},Zv=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?EX(CX(e,t)):structuredClone(e):(e,t)=>EX(CX(e,t));function dft(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 fft(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hft(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dft,i=e.options.footnoteBackLabel||fft,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,m);typeof x=="string"&&(x={type:"text",value:x}),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(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.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:{...Zv(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Kdt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function Xdt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Yd(t.children[1]),c=GR(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function tft(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(SX(t.slice(r),r>0,!1)),s.join("")}function SX(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===wX||s===OX;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===wX||s===OX;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function rft(e,t){const n={type:"text",value:ift(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sft(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const aft={blockquote:Ddt,break:Mdt,code:Ldt,delete:$dt,emphasis:Fdt,footnoteReference:Bdt,heading:Udt,html:Qdt,imageReference:zdt,image:Vdt,inlineCode:Hdt,linkReference:qdt,link:Wdt,listItem:Gdt,list:Xdt,paragraph:Ydt,root:Zdt,strong:Jdt,table:eft,tableCell:nft,tableRow:tft,text:rft,thematicBreak:sft,toml:ST,yaml:ST,definition:ST,footnoteDefinition:ST};function ST(){}const NSe=-1,YR=0,AO=1,dN=2,VB=3,HB=4,qB=5,WB=6,jSe=7,RSe=8,oft=typeof self=="object"?self:globalThis,kX=(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 oft[e](t)},lft=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,a]=t[r];switch(s){case YR:case NSe:return n(a,r);case AO:{const l=n([],r);for(const c of a)l.push(i(c));return l}case dN:{const l=n({},r);for(const[c,u]of a)l[i(c)]=i(u);return l}case VB:return n(new Date(a),r);case HB:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case qB:{const l=n(new Map,r);for(const[c,u]of a)l.set(i(c),i(u));return l}case WB:{const l=n(new Set,r);for(const c of a)l.add(i(c));return l}case jSe:{const{name:l,message:c}=a;return n(kX(l,c),r)}case RSe:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(kX(s,a),r)};return i},EX=e=>lft(new Map,e)(0),L0="",{toString:cft}={},{keys:uft}=Object,H1=e=>{const t=typeof e;if(t!=="object"||!e)return[YR,t];const n=cft.call(e).slice(8,-1);switch(n){case"Array":return[AO,L0];case"Object":return[dN,L0];case"Date":return[VB,L0];case"RegExp":return[HB,L0];case"Map":return[qB,L0];case"Set":return[WB,L0];case"DataView":return[AO,n]}return n.includes("Array")?[AO,n]:n.includes("Error")?[jSe,n]:[dN,n]},kT=([e,t])=>e===YR&&(t==="function"||t==="symbol"),dft=(e,t,n,i)=>{const r=(a,l)=>{const c=i.push(a)-1;return n.set(l,c),c},s=a=>{if(n.has(a))return n.get(a);let[l,c]=H1(a);switch(l){case YR:{let d=a;switch(c){case"bigint":l=RSe,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([NSe],a)}return r([l,d],a)}case AO:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(s(h));return f}case dN:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=r([l,d],a);for(const h of uft(a))(e||!kT(H1(a[h])))&&d.push([s(h),s(a[h])]);return f}case VB:return r([l,a.toISOString()],a);case HB:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case qB:{const d=[],f=r([l,d],a);for(const[h,m]of a)(e||!(kT(H1(h))||kT(H1(m))))&&d.push([s(h),s(m)]);return f}case WB:{const d=[],f=r([l,d],a);for(const h of a)(e||!kT(H1(h)))&&d.push(s(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return s},CX=(e,{json:t,lossy:n}={})=>{const i=[];return dft(!(t||n),!!t,new Map,i)(e),i},Zv=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?EX(CX(e,t)):structuredClone(e):(e,t)=>EX(CX(e,t));function fft(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 hft(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function pft(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||fft,i=e.options.footnoteBackLabel||hft,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,m);typeof x=="string"&&(x={type:"text",value:x}),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(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.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:{...Zv(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const yE=function(e){if(e==null)return bft;if(typeof e=="function")return ZR(e);if(typeof e=="object")return Array.isArray(e)?pft(e):mft(e);if(typeof e=="string")return gft(e);throw new Error("Expected function, string, or object as test")};function pft(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=RSe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=wft(n(c,d)),m[0]===D6))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==xft)for(b=(i?y.children.length:-1)+a,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=ISe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Oft(n(c,d)),m[0]===D6))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==wft)for(b=(i?y.children.length:-1)+a,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function TX(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function AX(e,t){const n=Sft(e,t),i=n.one(e,void 0),r=hft(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function Aft(e,t){return e&&"run"in e?async function(n,i){const r=AX(n,{file:i,...t});await e.run(r,i)}:function(n,i){return AX(n,{file:i,...e||t})}}function _X(e){if(e)throw e}var vA=Object.prototype.hasOwnProperty,PSe=Object.prototype.toString,NX=Object.defineProperty,jX=Object.getOwnPropertyDescriptor,RX=function(t){return typeof Array.isArray=="function"?Array.isArray(t):PSe.call(t)==="[object Array]"},IX=function(t){if(!t||PSe.call(t)!=="[object Object]")return!1;var n=vA.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&vA.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||vA.call(t,r)},PX=function(t,n){NX&&n.name==="__proto__"?NX(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},DX=function(t,n){if(n==="__proto__")if(vA.call(t,n)){if(jX)return jX(t,n).value}else return;return t[n]},_ft=function e(){var t,n,i,r,s,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(a,...l){n||(n=!0,t(a,...l))}function s(a){r(null,a)}}const hd={basename:Rft,dirname:Ift,extname:Pft,join:Dft,sep:"/"};function Rft(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xE(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function Ift(e){if(xE(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 Pft(e){xE(e);let t=e.length,n=-1,i=0,r=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Dft(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Lft(e,t){let n="",i=0,r=-1,s=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}}else if(n.length>0){n="",i=0,r=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function xE(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $ft={cwd:Fft};function Fft(){return"/"}function $6(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bft(e){if(typeof e=="string")e=new URL(e);else if(!$6(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 Uft(e)}function Uft(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];L6(b)&&L6(m)&&(m=kM(!0,b,m)),i[h]=[u,m,...g]}}}}const Hft=new GB().freeze();function AM(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _M(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function NM(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 LX(e){if(!L6(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $X(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ET(e){return qft(e)?e:new DSe(e)}function qft(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Wft(e){return typeof e=="string"||Gft(e)}function Gft(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Kft="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",FX=[],BX={allowDangerousHtml:!0},Xft=/^(https?|ircs?|mailto|xmpp)$/i,Yft=[{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 Zft(e){const t=Jft(e),n=eht(e);return tht(t.runSync(t.parse(n),n),e)}function Jft(e){const t=e.rehypePlugins||FX,n=e.remarkPlugins||FX,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BX}:BX;return Hft().use(Idt).use(n).use(Aft,i).use(t)}function eht(e){const t=e.children||"",n=new DSe;return typeof t=="string"&&(n.value=t),n}function tht(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||nht;for(const d of Yft)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Kft+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),vE(e,u),gct(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in wM)if(Object.hasOwn(wM,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=wM[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 nht(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||Xft.test(e.slice(0,t))?e:""}function UX(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 iht(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rht(e,t,n){const r=yE((n||{}).ignore||[]),s=sht(t);let a=-1;for(;++a0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=w+1:(g!==w&&x.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(S)?x.push(...S):S&&x.push(S),g=w+O[0].length,y=!0),!h.global)break;O=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=UX(e,"(");let s=UX(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 MSe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tb(n)||KR(n))&&(!t||n!==47)}LSe.peek=Aht;function xht(){this.buffer()}function wht(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Oht(){this.buffer()}function Sht(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function kht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Du(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Eht(e){this.exit(e)}function Cht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Du(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tht(e){this.exit(e)}function Aht(){return"["}function LSe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),a(),s+=r.move("]"),s}function _ht(){return{enter:{gfmFootnoteCallString:xht,gfmFootnoteCall:wht,gfmFootnoteDefinitionLabelString:Oht,gfmFootnoteDefinition:Sht},exit:{gfmFootnoteCallString:kht,gfmFootnoteCall:Eht,gfmFootnoteDefinitionLabelString:Cht,gfmFootnoteDefinition:Tht}}}function Nht(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:LSe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,a){const l=s.createTracker(a);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?$Se:jht))),u(),c}}function jht(e,t,n){return t===0?e:$Se(e,t,n)}function $Se(e,t,n){return(n?"":" ")+e}const Rht=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];FSe.peek=Lht;function Iht(){return{canContainEols:["delete"],enter:{strikethrough:Dht},exit:{strikethrough:Mht}}}function Pht(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Rht}],handlers:{delete:FSe}}}function Dht(e){this.enter({type:"delete",children:[]},e)}function Mht(e){this.exit(e)}function FSe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let a=r.move("~~");return a+=n.containerPhrasing(e,{...r.current(),before:a,after:"~"}),a+=r.move("~~"),s(),a}function Lht(){return"~"}function $ht(e){return e.length}function Fht(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||$ht,s=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=O)}b.push(x)}a[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=x),m[f]=x),h[f]=O}a.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Qht);return r(),a}function Qht(e,t,n){return">"+(n?"":" ")+e}function zht(e,t){return VX(e,t.inConstruct,!0)&&!VX(e,t.notInConstruct,!1)}function VX(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++ia&&(a=s):s=1,r=i+t.length,i=n.indexOf(t,r);return a}function Hht(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 qht(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 Wht(e,t,n,i){const r=qht(n),s=e.value||"",a=r==="`"?"GraveAccent":"Tilde";if(Hht(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,Ght);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(Vht(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function TX(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function AX(e,t){const n=kft(e,t),i=n.one(e,void 0),r=pft(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` +`},r),s}function _ft(e,t){return e&&"run"in e?async function(n,i){const r=AX(n,{file:i,...t});await e.run(r,i)}:function(n,i){return AX(n,{file:i,...e||t})}}function _X(e){if(e)throw e}var vA=Object.prototype.hasOwnProperty,DSe=Object.prototype.toString,NX=Object.defineProperty,jX=Object.getOwnPropertyDescriptor,RX=function(t){return typeof Array.isArray=="function"?Array.isArray(t):DSe.call(t)==="[object Array]"},IX=function(t){if(!t||DSe.call(t)!=="[object Object]")return!1;var n=vA.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&vA.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||vA.call(t,r)},PX=function(t,n){NX&&n.name==="__proto__"?NX(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},DX=function(t,n){if(n==="__proto__")if(vA.call(t,n)){if(jX)return jX(t,n).value}else return;return t[n]},Nft=function e(){var t,n,i,r,s,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(a,...l){n||(n=!0,t(a,...l))}function s(a){r(null,a)}}const hd={basename:Ift,dirname:Pft,extname:Dft,join:Mft,sep:"/"};function Ift(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xE(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function Pft(e){if(xE(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 Dft(e){xE(e);let t=e.length,n=-1,i=0,r=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Mft(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $ft(e,t){let n="",i=0,r=-1,s=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}}else if(n.length>0){n="",i=0,r=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function xE(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fft={cwd:Bft};function Bft(){return"/"}function $6(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uft(e){if(typeof e=="string")e=new URL(e);else if(!$6(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 Qft(e)}function Qft(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];L6(b)&&L6(m)&&(m=kM(!0,b,m)),i[h]=[u,m,...g]}}}}const qft=new GB().freeze();function AM(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _M(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function NM(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 LX(e){if(!L6(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $X(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ET(e){return Wft(e)?e:new MSe(e)}function Wft(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Gft(e){return typeof e=="string"||Kft(e)}function Kft(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xft="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",FX=[],BX={allowDangerousHtml:!0},Yft=/^(https?|ircs?|mailto|xmpp)$/i,Zft=[{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 Jft(e){const t=eht(e),n=tht(e);return nht(t.runSync(t.parse(n),n),e)}function eht(e){const t=e.rehypePlugins||FX,n=e.remarkPlugins||FX,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BX}:BX;return qft().use(Pdt).use(n).use(_ft,i).use(t)}function tht(e){const t=e.children||"",n=new MSe;return typeof t=="string"&&(n.value=t),n}function nht(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||iht;for(const d of Zft)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Xft+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),vE(e,u),bct(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in wM)if(Object.hasOwn(wM,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=wM[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 iht(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||Yft.test(e.slice(0,t))?e:""}function UX(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 rht(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sht(e,t,n){const r=yE((n||{}).ignore||[]),s=aht(t);let a=-1;for(;++a0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=w+1:(g!==w&&x.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(S)?x.push(...S):S&&x.push(S),g=w+O[0].length,y=!0),!h.global)break;O=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=UX(e,"(");let s=UX(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 LSe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tb(n)||KR(n))&&(!t||n!==47)}$Se.peek=_ht;function wht(){this.buffer()}function Oht(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Sht(){this.buffer()}function kht(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Eht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Du(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cht(e){this.exit(e)}function Tht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Du(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Aht(e){this.exit(e)}function _ht(){return"["}function $Se(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),a(),s+=r.move("]"),s}function Nht(){return{enter:{gfmFootnoteCallString:wht,gfmFootnoteCall:Oht,gfmFootnoteDefinitionLabelString:Sht,gfmFootnoteDefinition:kht},exit:{gfmFootnoteCallString:Eht,gfmFootnoteCall:Cht,gfmFootnoteDefinitionLabelString:Tht,gfmFootnoteDefinition:Aht}}}function jht(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$Se},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,a){const l=s.createTracker(a);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?FSe:Rht))),u(),c}}function Rht(e,t,n){return t===0?e:FSe(e,t,n)}function FSe(e,t,n){return(n?"":" ")+e}const Iht=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];BSe.peek=$ht;function Pht(){return{canContainEols:["delete"],enter:{strikethrough:Mht},exit:{strikethrough:Lht}}}function Dht(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Iht}],handlers:{delete:BSe}}}function Mht(e){this.enter({type:"delete",children:[]},e)}function Lht(e){this.exit(e)}function BSe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let a=r.move("~~");return a+=n.containerPhrasing(e,{...r.current(),before:a,after:"~"}),a+=r.move("~~"),s(),a}function $ht(){return"~"}function Fht(e){return e.length}function Bht(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||Fht,s=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=O)}b.push(x)}a[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=x),m[f]=x),h[f]=O}a.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),zht);return r(),a}function zht(e,t,n){return">"+(n?"":" ")+e}function Vht(e,t){return VX(e,t.inConstruct,!0)&&!VX(e,t.notInConstruct,!1)}function VX(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++ia&&(a=s):s=1,r=i+t.length,i=n.indexOf(t,r);return a}function qht(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 Wht(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 Ght(e,t,n,i){const r=Wht(n),s=e.value||"",a=r==="`"?"GraveAccent":"Tilde";if(qht(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,Kht);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(Hht(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),s&&(d+=l.move(s+` -`)),d+=l.move(c),u(),d}function Ght(e,t,n){return(n?"":" ")+e}function KB(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 Kht(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function Xht(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 US(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fN(e,t,n){const i=Yv(e),r=Yv(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}}USe.peek=Yht;function USe(e,t,n,i){const r=Xht(n),s=n.enter("emphasis"),a=n.createTracker(i),l=a.move(r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=fN(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=US(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=fN(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+US(f));const m=a.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function Yht(e,t,n){return n.options.emphasis||"*"}function Zht(e,t){let n=!1;return vE(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,D6}),!!((!e.depth||e.depth<3)&&UB(e)&&(t.options.setext||n))}function Jht(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(Zht(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 Kht(e,t,n){return(n?"":" ")+e}function KB(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 Xht(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function Yht(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 US(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fN(e,t,n){const i=Yv(e),r=Yv(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}}QSe.peek=Zht;function QSe(e,t,n,i){const r=Yht(n),s=n.enter("emphasis"),a=n.createTracker(i),l=a.move(r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=fN(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=US(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=fN(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+US(f));const m=a.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function Zht(e,t,n){return n.options.emphasis||"*"}function Jht(e,t){let n=!1;return vE(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,D6}),!!((!e.depth||e.depth<3)&&UB(e)&&(t.options.setext||n))}function ept(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(Jht(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=US(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}QSe.peek=ept;function QSe(e){return e.value||""}function ept(){return"<"}zSe.peek=tpt;function zSe(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function tpt(){return"!"}VSe.peek=npt;function VSe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function npt(){return"!"}HSe.peek=ipt;function HSe(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))}WSe.peek=rpt;function WSe(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let l,c;if(qSe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function rpt(e,t,n){return qSe(e,n)?"<":"["}GSe.peek=spt;function GSe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function spt(){return"["}function XB(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 apt(e){const t=XB(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 opt(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 KSe(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 lpt(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?opt(n):XB(n);const l=e.ordered?a==="."?")":".":apt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),KSe(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(a-s.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?s:s+" ".repeat(a-s.length))+f}}function dpt(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,i);return s(),r(),a}const fpt=yE(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function hpt(e,t,n,i){return(e.children.some(function(a){return fpt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function ppt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}XSe.peek=mpt;function XSe(e,t,n,i){const r=ppt(n),s=n.enter("strong"),a=n.createTracker(i),l=a.move(r+r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=fN(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=US(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=fN(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+US(f));const m=a.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function mpt(e,t,n){return n.options.strong||"*"}function gpt(e,t,n,i){return n.safe(e.value,i)}function bpt(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 ypt(e,t,n){const i=(KSe(n)+(n.options.ruleSpaces?" ":"")).repeat(bpt(n));return n.options.ruleSpaces?i.slice(0,-1):i}const YSe={blockquote:Uht,break:HX,code:Wht,definition:Kht,emphasis:USe,hardBreak:HX,heading:Jht,html:QSe,image:zSe,imageReference:VSe,inlineCode:HSe,link:WSe,linkReference:GSe,list:lpt,listItem:upt,paragraph:dpt,root:hpt,strong:XSe,text:gpt,thematicBreak:ypt};function vpt(){return{enter:{table:xpt,tableData:qX,tableHeader:qX,tableRow:Opt},exit:{codeText:Spt,table:wpt,tableData:PM,tableHeader:PM,tableRow:PM}}}function xpt(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 wpt(e){this.exit(e),this.data.inTable=void 0}function Opt(e){this.enter({type:"tableRow",children:[]},e)}function PM(e){this.exit(e)}function qX(e){this.enter({type:"tableCell",children:[]},e)}function Spt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kpt));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kpt(e,t){return t==="|"?t:e}function Ept(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=US(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}zSe.peek=tpt;function zSe(e){return e.value||""}function tpt(){return"<"}VSe.peek=npt;function VSe(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function npt(){return"!"}HSe.peek=ipt;function HSe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ipt(){return"!"}qSe.peek=rpt;function qSe(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))}GSe.peek=spt;function GSe(e,t,n,i){const r=KB(n),s=r==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let l,c;if(WSe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function spt(e,t,n){return WSe(e,n)?"<":"["}KSe.peek=apt;function KSe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function apt(){return"["}function XB(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 opt(e){const t=XB(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 lpt(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 XSe(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 cpt(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?lpt(n):XB(n);const l=e.ordered?a==="."?")":".":opt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),XSe(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(a-s.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?s:s+" ".repeat(a-s.length))+f}}function fpt(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,i);return s(),r(),a}const hpt=yE(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ppt(e,t,n,i){return(e.children.some(function(a){return hpt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function mpt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}YSe.peek=gpt;function YSe(e,t,n,i){const r=mpt(n),s=n.enter("strong"),a=n.createTracker(i),l=a.move(r+r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=fN(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=US(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=fN(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+US(f));const m=a.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function gpt(e,t,n){return n.options.strong||"*"}function bpt(e,t,n,i){return n.safe(e.value,i)}function ypt(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 vpt(e,t,n){const i=(XSe(n)+(n.options.ruleSpaces?" ":"")).repeat(ypt(n));return n.options.ruleSpaces?i.slice(0,-1):i}const ZSe={blockquote:Qht,break:HX,code:Ght,definition:Xht,emphasis:QSe,hardBreak:HX,heading:ept,html:zSe,image:VSe,imageReference:HSe,inlineCode:qSe,link:GSe,linkReference:KSe,list:cpt,listItem:dpt,paragraph:fpt,root:ppt,strong:YSe,text:bpt,thematicBreak:vpt};function xpt(){return{enter:{table:wpt,tableData:qX,tableHeader:qX,tableRow:Spt},exit:{codeText:kpt,table:Opt,tableData:PM,tableHeader:PM,tableRow:PM}}}function wpt(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 Opt(e){this.exit(e),this.data.inTable=void 0}function Spt(e){this.enter({type:"tableRow",children:[]},e)}function PM(e){this.exit(e)}function qX(e){this.enter({type:"tableCell",children:[]},e)}function kpt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ept));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ept(e,t){return t==="|"?t:e}function Cpt(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:l}};function a(m,g,b,v){return u(d(m,b,v),m.align)}function l(m,g,b,v){const y=f(m,b,v),x=u([y]);return x.slice(0,x.indexOf(` -`))}function c(m,g,b,v){const y=b.enter("tableCell"),x=b.enter("phrasing"),O=b.containerPhrasing(m,{...v,before:s,after:s});return x(),y(),O}function u(m,g){return Fht(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const x=[],O=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zpt={tokenize:Ypt,partial:!0};function Vpt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gpt,continuation:{tokenize:Kpt},exit:Xpt}},text:{91:{name:"gfmFootnoteCall",tokenize:Wpt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Hpt,resolveTo:qpt}}}}function Hpt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=Du(i.sliceSerialize({start:a.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function qpt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function Wpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!a||f===null||f===91||Ar(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(Du(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ar(f)||(a=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Gpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,a=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!l||g===null||g===91||Ar(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Du(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ar(g)||(l=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),Ui(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function Kpt(e,t,n){return e.check(bE,t,e.attempt(zpt,t,n))}function Xpt(e){e.exit("gfmFootnoteDefinition")}function Ypt(e,t,n){const i=this;return Ui(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Zpt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(a,l){let c=-1;for(;++c1?c(g):(a.consume(g),f++,m);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=Yv(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class Jpt{constructor(){this.map=[]}add(t,n,i){emt(this,t,n,i)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function emt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const T=i.events[j][1].type;if(T==="lineEnding"||T==="linePrefix")j--;else break}const A=j>-1?i.events[j][1].type:null,F=A==="tableHead"||A==="tableRow"?S:c;return F===S&&i.parser.lazy[i.now().line]?n(_):F(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(a=!0,s+=1),d(_)}function d(_){return _===null?n(_):Tn(_)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),m):n(_):wi(_)?Ui(e,d,"whitespace")(_):(s+=1,a&&(a=!1,r+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||Ar(_)?(e.exit("data"),d(_)):(e.consume(_),_===92?h:f)}function h(_){return _===92||_===124?(e.consume(_),f):f(_)}function m(_){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(_):(e.enter("tableDelimiterRow"),a=!1,wi(_)?Ui(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):g(_))}function g(_){return _===45||_===58?v(_):_===124?(a=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),b):k(_)}function b(_){return wi(_)?Ui(e,v,"whitespace")(_):v(_)}function v(_){return _===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),y):_===45?(s+=1,y(_)):_===null||Tn(_)?w(_):k(_)}function y(_){return _===45?(e.enter("tableDelimiterFiller"),x(_)):k(_)}function x(_){return _===45?(e.consume(_),x):_===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(_))}function O(_){return wi(_)?Ui(e,w,"whitespace")(_):w(_)}function w(_){return _===124?g(_):_===null||Tn(_)?!a||r!==s?k(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):k(_)}function k(_){return n(_)}function S(_){return e.enter("tableRow"),E(_)}function E(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),E):_===null||Tn(_)?(e.exit("tableRow"),t(_)):wi(_)?Ui(e,E,"whitespace")(_):(e.enter("data"),C(_))}function C(_){return _===null||_===124||Ar(_)?(e.exit("data"),E(_)):(e.consume(_),_===92?N:C)}function N(_){return _===92||_===124?(e.consume(_),C):C(_)}}function rmt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new Jpt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ny(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function GX(e,t,n,i,r){const s=[],a=ny(t.events,n);r&&(r.end=Object.assign({},a),s.push(["exit",r,t])),i.end=Object.assign({},a),s.push(["exit",i,t]),e.add(n+1,0,s)}function ny(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const smt={name:"tasklistCheck",tokenize:omt};function amt(){return{text:{91:smt}}}function omt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return Ar(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Tn(c)?t(c):wi(c)?e.check({tokenize:lmt},t,n)(c):n(c)}}function lmt(e,t,n){return Ui(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function cmt(e){return pSe([Ppt(),Vpt(),Zpt(e),nmt(),amt()])}const umt={};function dmt(e){const t=this,n=e||umt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(cmt(n)),s.push(Npt()),a.push(jpt(n))}const KX=function(e,t,n){const i=yE(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` -`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function oke(e,t,n){return e.type==="element"?vmt(e,t,n):e.type==="text"?n.whitespace==="normal"?lke(e,n):xmt(e):[]}function vmt(e,t,n){const i=cke(e,n),r=e.children||[];let s=-1,a=[];if(bmt(e))return a;let l,c;for(B6(e)||JX(e)&&KX(t,e,JX)?c=` -`:gmt(e)?(l=2,c=2):ake(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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Tmt(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=Cmt(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 JB(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...O,"set","shopt",...w,...k]},contains:[m,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function Amt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+a+"[\\*&\\s]+)+"+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 _mt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Nmt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const jmt=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_-]*/}}),Rmt=["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"],Imt=["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"],Pmt=[...Rmt,...Imt],Dmt=["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(),Mmt=["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(),Lmt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$mt=["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 Fmt(e){const t=e.regex,n=jmt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Mmt.join("|")+")"},{begin:":(:)?("+Lmt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$mt.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:Dmt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Pmt.join("|")+")\\b"}]}}function Bmt(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 Umt(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:"dke(e,t,n-1))}function zmt(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+dke("(?:<"+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,eY,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},eY,u]}}const tY="[A-Za-z$_][0-9A-Za-z$_]*",Vmt=["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"],Hmt=["true","false","null","undefined","NaN","Infinity"],fke=["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"],hke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],pke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qmt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wmt=[].concat(pke,fke,hke);function mke(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:tY,keyword:Vmt,literal:Hmt,built_in:Wmt,"variable.language":qmt},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]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...fke,...hke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...pke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function gke(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ry="[0-9](_*[0-9])*",_T=`\\.(${ry})`,NT="[0-9a-fA-F](_*[0-9a-fA-F])*",Gmt={className:"number",variants:[{begin:`(\\b(${ry})((${_T})|\\.)?|(${_T}))[eE][+-]?(${ry})[fFdD]?\\b`},{begin:`\\b(${ry})((${_T})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_T})[fFdD]?\\b`},{begin:`\\b(${ry})[fFdD]\\b`},{begin:`\\b0[xX]((${NT})\\.?|(${NT})?\\.(${NT}))[pP][+-]?(${ry})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NT})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Kmt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=Gmt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const Xmt=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_-]*/}}),Ymt=["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"],Zmt=["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"],Jmt=[...Ymt,...Zmt],egt=["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(),bke=["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(),yke=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tgt=["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(),ngt=bke.concat(yke).sort().reverse();function igt(e){const t=Xmt(e),n=ngt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(O){return{className:"string",begin:"~?"+O+".*?"+O}},u=function(O,w,k){return{className:O,begin:w,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:egt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tgt.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("+Jmt.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:":("+bke.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+yke.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,x,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function rgt(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 vke(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function sgt(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 agt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,a.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function ogt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(T,P)=>{P.data._beginMatch=T[1]||T[2]},"on:end":(T,P)=>{P.data._beginMatch!==T[1]&&P.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),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"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(T=>{const P=[];return T.forEach(R=>{P.push(R),R.toLowerCase()===R?P.push(R.toUpperCase()):P.push(R.toLowerCase())}),P})(v),built_in:x},k=T=>T.map(P=>P.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(i,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[N,a,C,e.C_BLOCK_COMMENT_MODE,g,b,S]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(j);const A=[N,C,e.C_BLOCK_COMMENT_MODE,g,b,S],F={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[F,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,j,C,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",F,a,C,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function lgt(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 cgt(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function wke(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 ugt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function dgt(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 fgt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(S)}}function hgt(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const pgt=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_-]*/}}),mgt=["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"],ggt=["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"],bgt=[...mgt,...ggt],ygt=["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(),vgt=["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(),xgt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wgt=["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 Ogt(e){const t=pgt(e),n=xgt,i=vgt,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("+bgt.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("+wgt.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:ygt.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 Sgt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function kgt(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(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 x(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:x(h),relevance:0};function w(k,{exceptions:S,when:E}={}){const C=E;return S=S||[],k.map(N=>N.match(/\|\d+$/)||S.includes(N)?N:C(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(a)},O,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Oke(e){return e?typeof e=="string"?e:e.source:null}function q1(e){return gr("(?=",e,")")}function gr(...e){return e.map(n=>Oke(n)).join("")}function Egt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Io(...e){return"("+(Egt(e).capture?"":"?:")+e.map(i=>Oke(i)).join("|")+")"}const eU=e=>gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Cgt=["Protocol","Type"].map(eU),nY=["init","self"].map(eU),Tgt=["Any","Self"],DM=["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"],iY=["false","nil","true"],Agt=["assignment","associativity","higherThan","left","lowerThan","none","right"],_gt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],rY=["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"],Ske=Io(/[/=\-+!*%<>&|^~?]/,/[\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]/),kke=Io(Ske,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),MM=gr(Ske,kke,"*"),Eke=Io(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),hN=Io(Eke,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dd=gr(Eke,hN,"*"),jT=gr(/[A-Z]/,hN,"*"),Ngt=["attached","autoclosure",gr(/convention\(/,Io("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gr(/objc\(/,dd,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],jgt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Rgt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Io(...Cgt,...nY)],className:{2:"keyword"}},s={match:gr(/\./,Io(...DM)),relevance:0},a=DM.filter(ke=>typeof ke=="string").concat(["_|0"]),l=DM.filter(ke=>typeof ke!="string").concat(Tgt).map(eU),c={variants:[{className:"keyword",match:Io(...l,...nY)}]},u={$pattern:Io(/\b\w+/,/#\w+/),keyword:a.concat(_gt),literal:iY},d=[r,s,c],f={match:gr(/\./,Io(...rY)),relevance:0},h={className:"built_in",match:gr(/\b/,Io(...rY),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:MM},{match:`\\.(\\.|${kke})+`}]},v=[g,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(ke="")=>({className:"subst",variants:[{match:gr(/\\/,ke,/[0\\tnr"']/)},{match:gr(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(ke="")=>({className:"subst",match:gr(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(ke="")=>({className:"subst",label:"interpol",begin:gr(/\\/,ke,/\(/),end:/\)/}),E=(ke="")=>({begin:gr(ke,/"""/),end:gr(/"""/,ke),contains:[w(ke),k(ke),S(ke)]}),C=(ke="")=>({begin:gr(ke,/"/),end:gr(/"/,ke),contains:[w(ke),S(ke)]}),N={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},A=ke=>{const st=gr(ke,/\//),Le=gr(/\//,ke);return{begin:st,end:Le,contains:[..._,{scope:"comment",begin:`#(?!.*${Le})`,end:/$/}]}},F={scope:"regexp",variants:[A("###"),A("##"),A("#"),j]},T={match:gr(/`/,dd,/`/)},P={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${hN}+`},L=[T,P,R],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jgt,contains:[...v,O,N]}]}},U={scope:"keyword",match:gr(/@/,Io(...Ngt),q1(Io(/\(/,/\s+/)))},I={scope:"meta",match:gr(/@/,dd)},H=[M,U,I],K={match:q1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,hN,"+")},{className:"type",match:jT,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gr(/\s+&\s+/,q1(jT)),relevance:0}]},Q={begin://,keywords:u,contains:[...i,...d,...H,g,K]};K.contains.push(Q);const q={match:gr(dd,/\s*:/),keywords:"_|0",relevance:0},B={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,F,...d,...m,...v,O,N,...L,...H,K]},ee={begin://,keywords:"repeat each",contains:[...i,K]},le={begin:Io(q1(gr(dd,/\s*:/)),q1(gr(dd,/\s+/,dd,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dd}]},se={begin:/\(/,end:/\)/,keywords:u,contains:[le,...i,...d,...v,O,N,...H,K,B],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Io(T.match,dd,MM)],className:{1:"keyword",3:"title.function"},contains:[ee,se,t],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ee,se,t],illegal:/\[|%/},W={match:[/operator/,/\s+/,MM],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,jT],className:{1:"keyword",3:"title"},contains:[K],keywords:[...Agt,...iY],end:/}/},ae={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Oe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dd,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ee,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jT},...d],relevance:0}]};for(const ke of N.variants){const st=ke.contains.find(Me=>Me.label==="interpol");st.keywords=u;const Le=[...d,...m,...v,O,N,...L];st.contains=[...Le,{begin:/\(/,end:/\)/,contains:["self",...Le]}]}return{name:"Swift",keywords:u,contains:[...i,re,ge,ae,ue,Oe,W,X,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},F,...d,...m,...v,O,N,...L,...H,K,B]}}const pN="[A-Za-z$_][0-9A-Za-z$_]*",Cke=["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"],Tke=["true","false","null","undefined","NaN","Infinity"],Ake=["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"],_ke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jke=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rke=[].concat(Nke,Ake,_ke);function Igt(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:pN,keyword:Cke,literal:Tke,built_in:Rke,"variable.language":jke},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]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ake,..._ke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...Nke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function Ike(e){const t=e.regex,n=Igt(e),i=pN,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:pN,keyword:Cke.concat(c),literal:Tke,built_in:Rke.concat(r),"variable.language":jke},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const x=b.contains.findIndex(O=>O.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,a,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Pgt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Dgt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function Mgt(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Pke(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,a],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Lgt={arduino:Tmt,bash:JB,c:Amt,cpp:_mt,csharp:Nmt,css:Fmt,diff:Bmt,go:Umt,graphql:Qmt,ini:uke,java:zmt,javascript:mke,json:gke,kotlin:Kmt,less:igt,lua:rgt,makefile:vke,markdown:xke,objectivec:sgt,perl:agt,php:ogt,"php-template":lgt,plaintext:cgt,python:wke,"python-repl":ugt,r:dgt,ruby:fgt,rust:hgt,scss:Ogt,shell:Sgt,sql:kgt,swift:Rgt,typescript:Ike,vbnet:Pgt,wasm:Dgt,xml:Mgt,yaml:Pke};function Dke(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)&&Dke(n)}),e}let sY=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Mke(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Bp(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const $gt="",aY=e=>!!e.scope,Fgt=(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 Bgt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Mke(t)}openNode(t){if(!aY(t))return;const n=Fgt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){aY(t)&&(this.buffer+=$gt)}value(){return this.buffer}span(t){this.buffer+=``}}const oY=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class tU{constructor(){this.rootNode=oY(),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=oY({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=>{tU._collapse(n)}))}}class Ugt extends tU{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 Bgt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function QS(e){return e?typeof e=="string"?e:e.source:null}function Lke(e){return i0("(?=",e,")")}function Qgt(e){return i0("(?:",e,")*")}function zgt(e){return i0("(?:",e,")?")}function i0(...e){return e.map(n=>QS(n)).join("")}function Vgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function nU(...e){return"("+(Vgt(e).capture?"":"?:")+e.map(i=>QS(i)).join("|")+")"}function $ke(e){return new RegExp(e.toString()+"|").exec("").length-1}function Hgt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const qgt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function iU(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=QS(i),a="";for(;s.length>0;){const l=qgt.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(i=>`(${i})`).join(t)}const Wgt=/\b\B/,Fke="[a-zA-Z]\\w*",rU="[a-zA-Z_]\\w*",Bke="\\b\\d+(\\.\\d+)?",Uke="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Qke="\\b(0b[01]+)",Ggt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Kgt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=i0(t,/.*\b/,e.binary,/\b.*/)),Bp({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},zS={begin:"\\\\[\\s\\S]",relevance:0},Xgt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[zS]},Ygt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[zS]},Zgt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},JR=function(e,t,n={}){const i=Bp({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=nU("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:i0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Jgt=JR("//","$"),ebt=JR("/\\*","\\*/"),tbt=JR("#","$"),nbt={scope:"number",begin:Bke,relevance:0},ibt={scope:"number",begin:Uke,relevance:0},rbt={scope:"number",begin:Qke,relevance:0},sbt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[zS,{begin:/\[/,end:/\]/,relevance:0,contains:[zS]}]},abt={scope:"title",begin:Fke,relevance:0},obt={scope:"title",begin:rU,relevance:0},lbt={begin:"\\.\\s*"+rU,relevance:0},cbt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var RT=Object.freeze({__proto__:null,APOS_STRING_MODE:Xgt,BACKSLASH_ESCAPE:zS,BINARY_NUMBER_MODE:rbt,BINARY_NUMBER_RE:Qke,COMMENT:JR,C_BLOCK_COMMENT_MODE:ebt,C_LINE_COMMENT_MODE:Jgt,C_NUMBER_MODE:ibt,C_NUMBER_RE:Uke,END_SAME_AS_BEGIN:cbt,HASH_COMMENT_MODE:tbt,IDENT_RE:Fke,MATCH_NOTHING_RE:Wgt,METHOD_GUARD:lbt,NUMBER_MODE:nbt,NUMBER_RE:Bke,PHRASAL_WORDS_MODE:Zgt,QUOTE_STRING_MODE:Ygt,REGEXP_MODE:sbt,RE_STARTERS_RE:Ggt,SHEBANG:Kgt,TITLE_MODE:abt,UNDERSCORE_IDENT_RE:rU,UNDERSCORE_TITLE_MODE:obt});function ubt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function dbt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function fbt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ubt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function hbt(e,t){Array.isArray(e.illegal)&&(e.illegal=nU(...e.illegal))}function pbt(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 mbt(e,t){e.relevance===void 0&&(e.relevance=1)}const gbt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=i0(n.beforeMatch,Lke(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},bbt=["of","and","for","in","not","or","if","then","parent","list","value"],ybt="keyword";function zke(e,t,n=ybt){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,zke(e[s],t,s))}),i;function r(s,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");i[c[0]]=[s,vbt(c[0],c[1])]})}}function vbt(e,t){return t?Number(t):xbt(e)?0:1}function xbt(e){return bbt.includes(e.toLowerCase())}const lY={},sb=e=>{console.error(e)},cY=(e,...t)=>{console.log(`WARN: ${e}`,...t)},$0=(e,t)=>{lY[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),lY[`${e}/${t}`]=!0)},mN=new Error;function Vke(e,t,{key:n}){let i=0;const r=e[n],s={},a={};for(let l=1;l<=t.length;l++)a[l+i]=r[l],s[l+i]=!0,i+=$ke(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function wbt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sb("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mN;if(typeof e.beginScope!="object"||e.beginScope===null)throw sb("beginScope must be object"),mN;Vke(e,e.begin,{key:"beginScope"}),e.begin=iU(e.begin,{joinWith:""})}}function Obt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sb("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mN;if(typeof e.endScope!="object"||e.endScope===null)throw sb("endScope must be object"),mN;Vke(e,e.end,{key:"endScope"}),e.end=iU(e.end,{joinWith:""})}}function Sbt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function kbt(e){Sbt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),wbt(e),Obt(e)}function Ebt(e){function t(a,l){return new RegExp(QS(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=$ke(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(iU(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(a){const l=new i;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function s(a,l){const c=a;if(a.isCompiled)return c;[dbt,pbt,kbt,gbt].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[fbt,hbt,mbt].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=zke(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=QS(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Cbt(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,c)}),a.starts&&s(a.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Bp(e.classNameAliases||{}),s(e)}function Hke(e){return e?e.endsWithParent||Hke(e.starts):!1}function Cbt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Bp(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Hke(e)?Bp(e,{starts:e.starts?Bp(e.starts):null}):Object.isFrozen(e)?Bp(e):e}var Tbt="11.11.1";class Abt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const LM=Mke,uY=Bp,dY=Symbol("nomatch"),_bt=7,qke=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Ugt};function c(R){return l.noHighlightRe.test(R)}function u(R){let L=R.className+" ";L+=R.parentNode?R.parentNode.className:"";const M=l.languageDetectRe.exec(L);if(M){const U=C(M[1]);return U||(cY(s.replace("{}",M[1])),cY("Falling back to no-highlight mode for this block.",R)),U?M[1]:"no-highlight"}return L.split(/\s+/).find(U=>c(U)||C(U))}function d(R,L,M){let U="",I="";typeof L=="object"?(U=R,M=L.ignoreIllegals,I=L.language):($0("10.7.0","highlight(lang, code, ...args) has been deprecated."),$0("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),I=R,U=L),M===void 0&&(M=!0);const H={code:U,language:I};T("before:highlight",H);const K=H.result?H.result:f(H.language,H.code,M);return K.code=H.code,T("after:highlight",K),K}function f(R,L,M,U){const I=Object.create(null);function H(J,he){return J.keywords[he]}function K(){if(!Le.keywords){Ie.addText(qe);return}let J=0;Le.keywordPatternRe.lastIndex=0;let he=Le.keywordPatternRe.exec(qe),_e="";for(;he;){_e+=qe.substring(J,he.index);const Ze=Oe.case_insensitive?he[0].toLowerCase():he[0],at=H(Le,Ze);if(at){const[wt,Se]=at;if(Ie.addText(_e),_e="",I[Ze]=(I[Ze]||0)+1,I[Ze]<=_bt&&(Ae+=Se),wt.startsWith("_"))_e+=he[0];else{const ve=Oe.classNameAliases[wt]||wt;B(he[0],ve)}}else _e+=he[0];J=Le.keywordPatternRe.lastIndex,he=Le.keywordPatternRe.exec(qe)}_e+=qe.substring(J),Ie.addText(_e)}function Q(){if(qe==="")return;let J=null;if(typeof Le.subLanguage=="string"){if(!t[Le.subLanguage]){Ie.addText(qe);return}J=f(Le.subLanguage,qe,!0,Me[Le.subLanguage]),Me[Le.subLanguage]=J._top}else J=m(qe,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(Ae+=J.relevance),Ie.__addSublanguage(J._emitter,J.language)}function q(){Le.subLanguage!=null?Q():K(),qe=""}function B(J,he){J!==""&&(Ie.startScope(he),Ie.addText(J),Ie.endScope())}function ee(J,he){let _e=1;const Ze=he.length-1;for(;_e<=Ze;){if(!J._emit[_e]){_e++;continue}const at=Oe.classNameAliases[J[_e]]||J[_e],wt=he[_e];at?B(wt,at):(qe=wt,K(),qe=""),_e++}}function le(J,he){return J.scope&&typeof J.scope=="string"&&Ie.openNode(Oe.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(B(qe,Oe.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),qe=""):J.beginScope._multi&&(ee(J.beginScope,he),qe="")),Le=Object.create(J,{parent:{value:Le}}),Le}function se(J,he,_e){let Ze=Hgt(J.endRe,_e);if(Ze){if(J["on:end"]){const at=new sY(J);J["on:end"](he,at),at.isMatchIgnored&&(Ze=!1)}if(Ze){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return se(J.parent,he,_e)}function re(J){return Le.matcher.regexIndex===0?(qe+=J[0],1):(De=!0,0)}function ge(J){const he=J[0],_e=J.rule,Ze=new sY(_e),at=[_e.__beforeBegin,_e["on:begin"]];for(const wt of at)if(wt&&(wt(J,Ze),Ze.isMatchIgnored))return re(he);return _e.skip?qe+=he:(_e.excludeBegin&&(qe+=he),q(),!_e.returnBegin&&!_e.excludeBegin&&(qe=he)),le(_e,J),_e.returnBegin?0:he.length}function W(J){const he=J[0],_e=L.substring(J.index),Ze=se(Le,J,_e);if(!Ze)return dY;const at=Le;Le.endScope&&Le.endScope._wrap?(q(),B(he,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(q(),ee(Le.endScope,J)):at.skip?qe+=he:(at.returnEnd||at.excludeEnd||(qe+=he),q(),at.excludeEnd&&(qe=he));do Le.scope&&Ie.closeNode(),!Le.skip&&!Le.subLanguage&&(Ae+=Le.relevance),Le=Le.parent;while(Le!==Ze.parent);return Ze.starts&&le(Ze.starts,J),at.returnEnd?0:he.length}function X(){const J=[];for(let he=Le;he!==Oe;he=he.parent)he.scope&&J.unshift(he.scope);J.forEach(he=>Ie.openNode(he))}let ae={};function ue(J,he){const _e=he&&he[0];if(qe+=J,_e==null)return q(),0;if(ae.type==="begin"&&he.type==="end"&&ae.index===he.index&&_e===""){if(qe+=L.slice(he.index,he.index+1),!r){const Ze=new Error(`0 width match regex (${R})`);throw Ze.languageName=R,Ze.badRule=ae.rule,Ze}return 1}if(ae=he,he.type==="begin")return ge(he);if(he.type==="illegal"&&!M){const Ze=new Error('Illegal lexeme "'+_e+'" for mode "'+(Le.scope||"")+'"');throw Ze.mode=Le,Ze}else if(he.type==="end"){const Ze=W(he);if(Ze!==dY)return Ze}if(he.type==="illegal"&&_e==="")return qe+=` -`,1;if(Ee>1e5&&Ee>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=_e,_e.length}const Oe=C(R);if(!Oe)throw sb(s.replace("{}",R)),new Error('Unknown language: "'+R+'"');const ke=Ebt(Oe);let st="",Le=U||ke;const Me={},Ie=new l.__emitter(l);X();let qe="",Ae=0,ze=0,Ee=0,De=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(L,Ie);else{for(Le.matcher.considerAll();;){Ee++,De?De=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=ze;const J=Le.matcher.exec(L);if(!J)break;const he=L.substring(ze,J.index),_e=ue(he,J);ze=J.index+_e}ue(L.substring(ze))}return Ie.finalize(),st=Ie.toHTML(),{language:R,value:st,relevance:Ae,illegal:!1,_emitter:Ie,_top:Le}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:R,value:LM(L),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ze,context:L.slice(ze-100,ze+100),mode:J.mode,resultSoFar:st},_emitter:Ie};if(r)return{language:R,value:LM(L),illegal:!1,relevance:0,errorRaised:J,_emitter:Ie,_top:Le};throw J}}function h(R){const L={value:LM(R),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return L._emitter.addText(R),L}function m(R,L){L=L||l.languages||Object.keys(t);const M=h(R),U=L.filter(C).filter(_).map(q=>f(q,R,!1));U.unshift(M);const I=U.sort((q,B)=>{if(q.relevance!==B.relevance)return B.relevance-q.relevance;if(q.language&&B.language){if(C(q.language).supersetOf===B.language)return 1;if(C(B.language).supersetOf===q.language)return-1}return 0}),[H,K]=I,Q=H;return Q.secondBest=K,Q}function g(R,L,M){const U=L&&n[L]||M;R.classList.add("hljs"),R.classList.add(`language-${U}`)}function b(R){let L=null;const M=u(R);if(c(M))return;if(T("before:highlightElement",{el:R,language:M}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R)),l.throwUnescapedHTML))throw new Abt("One of your code blocks includes unescaped HTML.",R.innerHTML);L=R;const U=L.textContent,I=M?d(U,{language:M,ignoreIllegals:!0}):m(U);R.innerHTML=I.value,R.dataset.highlighted="yes",g(R,M,I.language),R.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(R.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),T("after:highlightElement",{el:R,result:I,text:U})}function v(R){l=uY(l,R)}const y=()=>{w(),$0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),$0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function w(){function R(){w()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",R,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(R,L){let M=null;try{M=L(e)}catch(U){if(sb("Language definition for '{}' could not be registered.".replace("{}",R)),r)sb(U);else throw U;M=a}M.name||(M.name=R),t[R]=M,M.rawDefinition=L.bind(null,e),M.aliases&&N(M.aliases,{languageName:R})}function S(R){delete t[R];for(const L of Object.keys(n))n[L]===R&&delete n[L]}function E(){return Object.keys(t)}function C(R){return R=(R||"").toLowerCase(),t[R]||t[n[R]]}function N(R,{languageName:L}){typeof R=="string"&&(R=[R]),R.forEach(M=>{n[M.toLowerCase()]=L})}function _(R){const L=C(R);return L&&!L.disableAutodetect}function j(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=L=>{R["before:highlightBlock"](Object.assign({block:L.el},L))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=L=>{R["after:highlightBlock"](Object.assign({block:L.el},L))})}function A(R){j(R),i.push(R)}function F(R){const L=i.indexOf(R);L!==-1&&i.splice(L,1)}function T(R,L){const M=R;i.forEach(function(U){U[M]&&U[M](L)})}function P(R){return $0("10.7.0","highlightBlock will be removed entirely in v12.0"),$0("10.7.0","Please use highlightElement now."),b(R)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:w,highlightElement:b,highlightBlock:P,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:S,listLanguages:E,getLanguage:C,registerAliases:N,autoDetection:_,inherit:uY,addPlugin:A,removePlugin:F}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Tbt,e.regex={concat:i0,lookahead:Lke,either:nU,optional:zgt,anyNumberOfTimes:Qgt};for(const R in RT)typeof RT[R]=="object"&&Dke(RT[R]);return Object.assign(e,RT),e},Jv=qke({});Jv.newInstance=()=>qke({});var Nbt=Jv;Jv.HighlightJS=Jv;Jv.default=Jv;const xo=px(Nbt),fY={},jbt="hljs-";function Rbt(e){const t=xo.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:a,registered:l};function n(c,u,d){const f=d||fY,h=typeof f.prefix=="string"?f.prefix:jbt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Ibt,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||fY).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class Ibt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Pbt={};function hY(e){const t=e||Pbt,n=t.aliases,i=t.detect||!1,r=t.languages||Lgt,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=Rbt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){vE(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=Dbt(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=ymt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const O=x;if(b&&/Unknown language/.test(O.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:O,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Dbt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=gY(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function o0t(e){return e>=56320&&e<=57343}function l0t(e,t){return(e-55296)*1024+9216+t}function Zke(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Jke(e){return e>=64976&&e<=65007||a0t.has(e)}var et;(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"})(et||(et={}));const c0t=65536;class u0t{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=c0t,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,a=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(o0t(n))return this.pos++,this._addGap(),l0t(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,oe.EOF;return this._err(et.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,Yke(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){Zke(t)?this._err(et.controlCharacterInInputStream):Jke(t)&&this._err(et.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 d0t=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))),f0t=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 h0t(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=f0t.get(e))!==null&&t!==void 0?t:e}var Da;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Da||(Da={}));const p0t=32;var Up;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Up||(Up={}));function Q6(e){return e>=Da.ZERO&&e<=Da.NINE}function m0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_F||e>=Da.LOWER_A&&e<=Da.LOWER_F}function g0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_Z||e>=Da.LOWER_A&&e<=Da.LOWER_Z||Q6(e)}function b0t(e){return e===Da.EQUALS||g0t(e)}var Ta;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ta||(Ta={}));var Uf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Uf||(Uf={}));class y0t{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ta.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Uf.Strict}startEntity(t){this.decodeMode=t,this.state=Ta.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ta.EntityStart:return t.charCodeAt(n)===Da.NUM?(this.state=Ta.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ta.NamedEntity,this.stateNamedEntity(t,n));case Ta.NumericStart:return this.stateNumericStart(t,n);case Ta.NumericDecimal:return this.stateNumericDecimal(t,n);case Ta.NumericHex:return this.stateNumericHex(t,n);case Ta.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|p0t)===Da.LOWER_X?(this.state=Ta.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ta.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(a===Da.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Uf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Up.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Up.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ta.NamedEntity:return this.result!==0&&(this.decodeMode!==Uf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ta.NumericDecimal:return this.emitNumericEntity(0,2);case Ta.NumericHex:return this.emitNumericEntity(0,3);case Ta.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ta.EntityStart:return 0}}}function v0t(e,t,n,i){const r=(t&Up.BRANCH_LENGTH)>>7,s=t&Up.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let a=n,l=a+r-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var yt;(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/"})(yt||(yt={}));var ab;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ab||(ab={}));var $c;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($c||($c={}));var Be;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Be||(Be={}));var D;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(D||(D={}));const x0t=new Map([[Be.A,D.A],[Be.ADDRESS,D.ADDRESS],[Be.ANNOTATION_XML,D.ANNOTATION_XML],[Be.APPLET,D.APPLET],[Be.AREA,D.AREA],[Be.ARTICLE,D.ARTICLE],[Be.ASIDE,D.ASIDE],[Be.B,D.B],[Be.BASE,D.BASE],[Be.BASEFONT,D.BASEFONT],[Be.BGSOUND,D.BGSOUND],[Be.BIG,D.BIG],[Be.BLOCKQUOTE,D.BLOCKQUOTE],[Be.BODY,D.BODY],[Be.BR,D.BR],[Be.BUTTON,D.BUTTON],[Be.CAPTION,D.CAPTION],[Be.CENTER,D.CENTER],[Be.CODE,D.CODE],[Be.COL,D.COL],[Be.COLGROUP,D.COLGROUP],[Be.DD,D.DD],[Be.DESC,D.DESC],[Be.DETAILS,D.DETAILS],[Be.DIALOG,D.DIALOG],[Be.DIR,D.DIR],[Be.DIV,D.DIV],[Be.DL,D.DL],[Be.DT,D.DT],[Be.EM,D.EM],[Be.EMBED,D.EMBED],[Be.FIELDSET,D.FIELDSET],[Be.FIGCAPTION,D.FIGCAPTION],[Be.FIGURE,D.FIGURE],[Be.FONT,D.FONT],[Be.FOOTER,D.FOOTER],[Be.FOREIGN_OBJECT,D.FOREIGN_OBJECT],[Be.FORM,D.FORM],[Be.FRAME,D.FRAME],[Be.FRAMESET,D.FRAMESET],[Be.H1,D.H1],[Be.H2,D.H2],[Be.H3,D.H3],[Be.H4,D.H4],[Be.H5,D.H5],[Be.H6,D.H6],[Be.HEAD,D.HEAD],[Be.HEADER,D.HEADER],[Be.HGROUP,D.HGROUP],[Be.HR,D.HR],[Be.HTML,D.HTML],[Be.I,D.I],[Be.IMG,D.IMG],[Be.IMAGE,D.IMAGE],[Be.INPUT,D.INPUT],[Be.IFRAME,D.IFRAME],[Be.KEYGEN,D.KEYGEN],[Be.LABEL,D.LABEL],[Be.LI,D.LI],[Be.LINK,D.LINK],[Be.LISTING,D.LISTING],[Be.MAIN,D.MAIN],[Be.MALIGNMARK,D.MALIGNMARK],[Be.MARQUEE,D.MARQUEE],[Be.MATH,D.MATH],[Be.MENU,D.MENU],[Be.META,D.META],[Be.MGLYPH,D.MGLYPH],[Be.MI,D.MI],[Be.MO,D.MO],[Be.MN,D.MN],[Be.MS,D.MS],[Be.MTEXT,D.MTEXT],[Be.NAV,D.NAV],[Be.NOBR,D.NOBR],[Be.NOFRAMES,D.NOFRAMES],[Be.NOEMBED,D.NOEMBED],[Be.NOSCRIPT,D.NOSCRIPT],[Be.OBJECT,D.OBJECT],[Be.OL,D.OL],[Be.OPTGROUP,D.OPTGROUP],[Be.OPTION,D.OPTION],[Be.P,D.P],[Be.PARAM,D.PARAM],[Be.PLAINTEXT,D.PLAINTEXT],[Be.PRE,D.PRE],[Be.RB,D.RB],[Be.RP,D.RP],[Be.RT,D.RT],[Be.RTC,D.RTC],[Be.RUBY,D.RUBY],[Be.S,D.S],[Be.SCRIPT,D.SCRIPT],[Be.SEARCH,D.SEARCH],[Be.SECTION,D.SECTION],[Be.SELECT,D.SELECT],[Be.SOURCE,D.SOURCE],[Be.SMALL,D.SMALL],[Be.SPAN,D.SPAN],[Be.STRIKE,D.STRIKE],[Be.STRONG,D.STRONG],[Be.STYLE,D.STYLE],[Be.SUB,D.SUB],[Be.SUMMARY,D.SUMMARY],[Be.SUP,D.SUP],[Be.TABLE,D.TABLE],[Be.TBODY,D.TBODY],[Be.TEMPLATE,D.TEMPLATE],[Be.TEXTAREA,D.TEXTAREA],[Be.TFOOT,D.TFOOT],[Be.TD,D.TD],[Be.TH,D.TH],[Be.THEAD,D.THEAD],[Be.TITLE,D.TITLE],[Be.TR,D.TR],[Be.TRACK,D.TRACK],[Be.TT,D.TT],[Be.U,D.U],[Be.UL,D.UL],[Be.SVG,D.SVG],[Be.VAR,D.VAR],[Be.WBR,D.WBR],[Be.XMP,D.XMP]]);function Gx(e){var t;return(t=x0t.get(e))!==null&&t!==void 0?t:D.UNKNOWN}const xt=D,w0t={[yt.HTML]:new Set([xt.ADDRESS,xt.APPLET,xt.AREA,xt.ARTICLE,xt.ASIDE,xt.BASE,xt.BASEFONT,xt.BGSOUND,xt.BLOCKQUOTE,xt.BODY,xt.BR,xt.BUTTON,xt.CAPTION,xt.CENTER,xt.COL,xt.COLGROUP,xt.DD,xt.DETAILS,xt.DIR,xt.DIV,xt.DL,xt.DT,xt.EMBED,xt.FIELDSET,xt.FIGCAPTION,xt.FIGURE,xt.FOOTER,xt.FORM,xt.FRAME,xt.FRAMESET,xt.H1,xt.H2,xt.H3,xt.H4,xt.H5,xt.H6,xt.HEAD,xt.HEADER,xt.HGROUP,xt.HR,xt.HTML,xt.IFRAME,xt.IMG,xt.INPUT,xt.LI,xt.LINK,xt.LISTING,xt.MAIN,xt.MARQUEE,xt.MENU,xt.META,xt.NAV,xt.NOEMBED,xt.NOFRAMES,xt.NOSCRIPT,xt.OBJECT,xt.OL,xt.P,xt.PARAM,xt.PLAINTEXT,xt.PRE,xt.SCRIPT,xt.SECTION,xt.SELECT,xt.SOURCE,xt.STYLE,xt.SUMMARY,xt.TABLE,xt.TBODY,xt.TD,xt.TEMPLATE,xt.TEXTAREA,xt.TFOOT,xt.TH,xt.THEAD,xt.TITLE,xt.TR,xt.TRACK,xt.UL,xt.WBR,xt.XMP]),[yt.MATHML]:new Set([xt.MI,xt.MO,xt.MN,xt.MS,xt.MTEXT,xt.ANNOTATION_XML]),[yt.SVG]:new Set([xt.TITLE,xt.FOREIGN_OBJECT,xt.DESC]),[yt.XLINK]:new Set,[yt.XML]:new Set,[yt.XMLNS]:new Set},z6=new Set([xt.H1,xt.H2,xt.H3,xt.H4,xt.H5,xt.H6]);Be.STYLE,Be.SCRIPT,Be.XMP,Be.IFRAME,Be.NOEMBED,Be.NOFRAMES,Be.PLAINTEXT;var de;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(de||(de={}));const $s={DATA:de.DATA,RCDATA:de.RCDATA,RAWTEXT:de.RAWTEXT,SCRIPT_DATA:de.SCRIPT_DATA,PLAINTEXT:de.PLAINTEXT,CDATA_SECTION:de.CDATA_SECTION};function O0t(e){return e>=oe.DIGIT_0&&e<=oe.DIGIT_9}function $w(e){return e>=oe.LATIN_CAPITAL_A&&e<=oe.LATIN_CAPITAL_Z}function S0t(e){return e>=oe.LATIN_SMALL_A&&e<=oe.LATIN_SMALL_Z}function gp(e){return S0t(e)||$w(e)}function yY(e){return gp(e)||O0t(e)}function IT(e){return e+32}function tEe(e){return e===oe.SPACE||e===oe.LINE_FEED||e===oe.TABULATION||e===oe.FORM_FEED}function vY(e){return tEe(e)||e===oe.SOLIDUS||e===oe.GREATER_THAN_SIGN}function k0t(e){return e===oe.NULL?et.nullCharacterReference:e>1114111?et.characterReferenceOutsideUnicodeRange:Yke(e)?et.surrogateCharacterReference:Jke(e)?et.noncharacterCharacterReference:Zke(e)||e===oe.CARRIAGE_RETURN?et.controlCharacterReference:null}class E0t{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=de.DATA,this.returnState=de.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new u0t(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new y0t(d0t,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(et.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(et.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=k0t(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(et.endTagWithAttributes),t.selfClosing&&this._err(et.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case di.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case di.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case di.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:di.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=tEe(t)?di.WHITESPACE_CHARACTER:t===oe.NULL?di.NULL_CHARACTER:di.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(di.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=de.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Uf.Attribute:Uf.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===de.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case de.DATA:{this._stateData(t);break}case de.RCDATA:{this._stateRcdata(t);break}case de.RAWTEXT:{this._stateRawtext(t);break}case de.SCRIPT_DATA:{this._stateScriptData(t);break}case de.PLAINTEXT:{this._statePlaintext(t);break}case de.TAG_OPEN:{this._stateTagOpen(t);break}case de.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case de.TAG_NAME:{this._stateTagName(t);break}case de.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case de.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case de.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case de.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case de.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case de.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case de.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case de.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case de.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case de.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case de.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case de.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case de.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case de.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case de.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case de.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case de.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case de.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case de.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case de.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case de.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case de.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case de.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case de.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case de.BOGUS_COMMENT:{this._stateBogusComment(t);break}case de.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case de.COMMENT_START:{this._stateCommentStart(t);break}case de.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case de.COMMENT:{this._stateComment(t);break}case de.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case de.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case de.COMMENT_END:{this._stateCommentEnd(t);break}case de.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case de.DOCTYPE:{this._stateDoctype(t);break}case de.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case de.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case de.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case de.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case de.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case de.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case de.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case de.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case de.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case de.CDATA_SECTION:{this._stateCdataSection(t);break}case de.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case de.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case de.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case de.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.TAG_OPEN;break}case oe.AMPERSAND:{this._startCharacterReference();break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitCodePoint(t);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case oe.AMPERSAND:{this._startCharacterReference();break}case oe.LESS_THAN_SIGN:{this.state=de.RCDATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.RAWTEXT_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.SCRIPT_DATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gp(t))this._createStartTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.EXCLAMATION_MARK:{this.state=de.MARKUP_DECLARATION_OPEN;break}case oe.SOLIDUS:{this.state=de.END_TAG_OPEN;break}case oe.QUESTION_MARK:{this._err(et.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=de.BOGUS_COMMENT,this._stateBogusComment(t);break}case oe.EOF:{this._err(et.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(et.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=de.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gp(t))this._createEndTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.GREATER_THAN_SIGN:{this._err(et.missingEndTagName),this.state=de.DATA;break}case oe.EOF:{this._err(et.eofBeforeTagName),this._emitChars("");break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(et.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===oe.SOLIDUS?this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gp(t)?(this._emitChars("<"),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=de.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gp(t)?(this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(et.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===oe.SOLIDUS?(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(el.SCRIPT,!1)&&vY(this.preprocessor.peek(el.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==yt.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(N0t,yt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(_0t,yt.HTML)}clearBackToTableRowContext(){this.clearBackTo(A0t,yt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===D.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===D.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case yt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case yt.SVG:{if(OY.has(r))return!1;break}case yt.MATHML:{if(wY.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,gN)}hasInListItemScope(t){return this.hasInDynamicScope(t,C0t)}hasInButtonScope(t){return this.hasInDynamicScope(t,T0t)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case yt.HTML:{if(z6.has(n))return!0;if(gN.has(n))return!1;break}case yt.SVG:{if(OY.has(n))return!1;break}case yt.MATHML:{if(wY.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===yt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===yt.HTML)switch(this.tagIDs[t]){case D.TBODY:case D.THEAD:case D.TFOOT:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===yt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.OPTION:case D.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nEe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&xY.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&xY.has(this.currentTagId);)this.pop()}}const $M=3;var md;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(md||(md={}));const SY={type:md.Marker};class I0t{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let s=0;for(let a=0;ar.get(c.name)===c.value)&&(s+=1,s>=$M&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(SY)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:md.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:md.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(SY);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===md.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===md.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===md.Element&&n.element===t)}}const bp={createDocument(){return{nodeName:"#document",mode:$c.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};bp.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(bp.isTextNode(n)){n.value+=t;return}}bp.appendChild(e,bp.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&bp.isTextNode(i)?i.value+=t:bp.insertBefore(e,bp.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function F0t(e){return e.name===iEe&&e.publicId===null&&(e.systemId===null||e.systemId===P0t)}function B0t(e){if(e.name!==iEe)return $c.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===D0t)return $c.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),L0t.has(n))return $c.QUIRKS;let i=t===null?M0t:rEe;if(kY(n,i))return $c.QUIRKS;if(i=t===null?sEe:$0t,kY(n,i))return $c.LIMITED_QUIRKS}return $c.NO_QUIRKS}const EY={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},U0t="definitionurl",Q0t="definitionURL",z0t=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])),V0t=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:yt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:yt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:yt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:yt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:yt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:yt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:yt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:yt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:yt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:yt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:yt.XMLNS}]]),H0t=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])),q0t=new Set([D.B,D.BIG,D.BLOCKQUOTE,D.BODY,D.BR,D.CENTER,D.CODE,D.DD,D.DIV,D.DL,D.DT,D.EM,D.EMBED,D.H1,D.H2,D.H3,D.H4,D.H5,D.H6,D.HEAD,D.HR,D.I,D.IMG,D.LI,D.LISTING,D.MENU,D.META,D.NOBR,D.OL,D.P,D.PRE,D.RUBY,D.S,D.SMALL,D.SPAN,D.STRONG,D.STRIKE,D.SUB,D.SUP,D.TABLE,D.TT,D.U,D.UL,D.VAR]);function W0t(e){const t=e.tagID;return t===D.FONT&&e.attrs.some(({name:i})=>i===ab.COLOR||i===ab.SIZE||i===ab.FACE)||q0t.has(t)}function aEe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===yt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,yt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=me.TEXT}switchToPlaintextParsing(){this.insertionMode=me.TEXT,this.originalInsertionMode=me.IN_BODY,this.tokenizer.state=$s.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Be.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==yt.HTML))switch(this.fragmentContextID){case D.TITLE:case D.TEXTAREA:{this.tokenizer.state=$s.RCDATA;break}case D.STYLE:case D.XMP:case D.IFRAME:case D.NOEMBED:case D.NOFRAMES:case D.NOSCRIPT:{this.tokenizer.state=$s.RAWTEXT;break}case D.SCRIPT:{this.tokenizer.state=$s.SCRIPT_DATA;break}case D.PLAINTEXT:{this.tokenizer.state=$s.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,yt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,yt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Be.HTML,yt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,D.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,a=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===di.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===D.SVG&&this.treeAdapter.getTagName(n)===Be.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===yt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===D.MGLYPH||t.tagID===D.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,yt.HTML)}_processToken(t){switch(t.type){case di.CHARACTER:{this.onCharacter(t);break}case di.NULL_CHARACTER:{this.onNullCharacter(t);break}case di.COMMENT:{this.onComment(t);break}case di.DOCTYPE:{this.onDoctype(t);break}case di.START_TAG:{this._processStartTag(t);break}case di.END_TAG:{this.onEndTag(t);break}case di.EOF:{this.onEof(t);break}case di.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return Y0t(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===md.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=me.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(D.P),this.openElements.popUntilTagNamePopped(D.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case D.TR:{this.insertionMode=me.IN_ROW;return}case D.TBODY:case D.THEAD:case D.TFOOT:{this.insertionMode=me.IN_TABLE_BODY;return}case D.CAPTION:{this.insertionMode=me.IN_CAPTION;return}case D.COLGROUP:{this.insertionMode=me.IN_COLUMN_GROUP;return}case D.TABLE:{this.insertionMode=me.IN_TABLE;return}case D.BODY:{this.insertionMode=me.IN_BODY;return}case D.FRAMESET:{this.insertionMode=me.IN_FRAMESET;return}case D.SELECT:{this._resetInsertionModeForSelect(t);return}case D.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case D.HTML:{this.insertionMode=this.headElement?me.AFTER_HEAD:me.BEFORE_HEAD;return}case D.TD:case D.TH:{if(t>0){this.insertionMode=me.IN_CELL;return}break}case D.HEAD:{if(t>0){this.insertionMode=me.IN_HEAD;return}break}}this.insertionMode=me.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===D.TEMPLATE)break;if(i===D.TABLE){this.insertionMode=me.IN_SELECT_IN_TABLE;return}}this.insertionMode=me.IN_SELECT}_isElementCausesFosterParenting(t){return lEe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case D.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===yt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case D.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return w0t[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){jvt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:{uEe(this,t);break}case me.TEXT:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_TABLE_TEXT:{gEe(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Nvt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.TEXT:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){V6(this,t);return}switch(this.insertionMode){case me.INITIAL:case me.BEFORE_HTML:case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_TEMPLATE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{V6(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.AFTER_BODY:{lyt(this,t);break}case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{cyt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case me.INITIAL:{uyt(this,t);break}case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:{this._err(t,et.misplacedDoctype);break}case me.IN_TABLE_TEXT:{G1(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,et.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Rvt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{dyt(this,t);break}case me.BEFORE_HEAD:{hyt(this,t);break}case me.IN_HEAD:{Ku(this,t);break}case me.IN_HEAD_NO_SCRIPT:{gyt(this,t);break}case me.AFTER_HEAD:{yyt(this,t);break}case me.IN_BODY:{So(this,t);break}case me.IN_TABLE:{ex(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{pvt(this,t);break}case me.IN_COLUMN_GROUP:{uU(this,t);break}case me.IN_TABLE_BODY:{nI(this,t);break}case me.IN_ROW:{iI(this,t);break}case me.IN_CELL:{bvt(this,t);break}case me.IN_SELECT:{vEe(this,t);break}case me.IN_SELECT_IN_TABLE:{vvt(this,t);break}case me.IN_TEMPLATE:{wvt(this,t);break}case me.AFTER_BODY:{Svt(this,t);break}case me.IN_FRAMESET:{kvt(this,t);break}case me.AFTER_FRAMESET:{Cvt(this,t);break}case me.AFTER_AFTER_BODY:{Avt(this,t);break}case me.AFTER_AFTER_FRAMESET:{_vt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Ivt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{fyt(this,t);break}case me.BEFORE_HEAD:{pyt(this,t);break}case me.IN_HEAD:{myt(this,t);break}case me.IN_HEAD_NO_SCRIPT:{byt(this,t);break}case me.AFTER_HEAD:{vyt(this,t);break}case me.IN_BODY:{tI(this,t);break}case me.TEXT:{rvt(this,t);break}case me.IN_TABLE:{VS(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{mvt(this,t);break}case me.IN_COLUMN_GROUP:{gvt(this,t);break}case me.IN_TABLE_BODY:{H6(this,t);break}case me.IN_ROW:{yEe(this,t);break}case me.IN_CELL:{yvt(this,t);break}case me.IN_SELECT:{xEe(this,t);break}case me.IN_SELECT_IN_TABLE:{xvt(this,t);break}case me.IN_TEMPLATE:{Ovt(this,t);break}case me.AFTER_BODY:{OEe(this,t);break}case me.IN_FRAMESET:{Evt(this,t);break}case me.AFTER_FRAMESET:{Tvt(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onEof(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{pEe(this,t);break}case me.TEXT:{svt(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_TEMPLATE:{wEe(this,t);break}case me.AFTER_BODY:case me.IN_FRAMESET:case me.AFTER_FRAMESET:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{cU(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===oe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.TEXT:case me.IN_COLUMN_GROUP:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{this._insertCharacters(t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:case me.AFTER_BODY:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{cEe(this,t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_TABLE_TEXT:{mEe(this,t);break}}}};function nyt(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):hEe(e,t),n}function iyt(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 ryt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,a=r;a!==n;s++,a=r){r=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&s>=eyt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=syt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function syt(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 ayt(e,t,n){const i=e.treeAdapter.getTagName(t),r=Gx(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===D.TEMPLATE&&s===yt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function oyt(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 lU(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function uyt(e,t){e._setDocumentType(t);const n=t.forceQuirks?$c.QUIRKS:B0t(t);F0t(t)||e._err(t,et.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=me.BEFORE_HTML}function W1(e,t){e._err(t,et.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$c.QUIRKS),e.insertionMode=me.BEFORE_HTML,e._processToken(t)}function dyt(e,t){t.tagID===D.HTML?(e._insertElement(t,yt.HTML),e.insertionMode=me.BEFORE_HEAD):_O(e,t)}function fyt(e,t){const n=t.tagID;(n===D.HTML||n===D.HEAD||n===D.BODY||n===D.BR)&&_O(e,t)}function _O(e,t){e._insertFakeRootElement(),e.insertionMode=me.BEFORE_HEAD,e._processToken(t)}function hyt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.HEAD:{e._insertElement(t,yt.HTML),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD;break}default:NO(e,t)}}function pyt(e,t){const n=t.tagID;n===D.HEAD||n===D.BODY||n===D.HTML||n===D.BR?NO(e,t):e._err(t,et.endTagWithoutMatchingOpenElement)}function NO(e,t){e._insertFakeElement(Be.HEAD,D.HEAD),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD,e._processToken(t)}function Ku(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:{e._appendElement(t,yt.HTML),t.ackSelfClosing=!0;break}case D.TITLE:{e._switchToTextParsing(t,$s.RCDATA);break}case D.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$s.RAWTEXT):(e._insertElement(t,yt.HTML),e.insertionMode=me.IN_HEAD_NO_SCRIPT);break}case D.NOFRAMES:case D.STYLE:{e._switchToTextParsing(t,$s.RAWTEXT);break}case D.SCRIPT:{e._switchToTextParsing(t,$s.SCRIPT_DATA);break}case D.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=me.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(me.IN_TEMPLATE);break}case D.HEAD:{e._err(t,et.misplacedStartTagForHeadElement);break}default:jO(e,t)}}function myt(e,t){switch(t.tagID){case D.HEAD:{e.openElements.pop(),e.insertionMode=me.AFTER_HEAD;break}case D.BODY:case D.BR:case D.HTML:{jO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function r0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==D.TEMPLATE&&e._err(t,et.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,et.endTagWithoutMatchingOpenElement)}function jO(e,t){e.openElements.pop(),e.insertionMode=me.AFTER_HEAD,e._processToken(t)}function gyt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BASEFONT:case D.BGSOUND:case D.HEAD:case D.LINK:case D.META:case D.NOFRAMES:case D.STYLE:{Ku(e,t);break}case D.NOSCRIPT:{e._err(t,et.nestedNoscriptInHead);break}default:RO(e,t)}}function byt(e,t){switch(t.tagID){case D.NOSCRIPT:{e.openElements.pop(),e.insertionMode=me.IN_HEAD;break}case D.BR:{RO(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function RO(e,t){const n=t.type===di.EOF?et.openElementsLeftAfterEof:et.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=me.IN_HEAD,e._processToken(t)}function yyt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BODY:{e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_BODY;break}case D.FRAMESET:{e._insertElement(t,yt.HTML),e.insertionMode=me.IN_FRAMESET;break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{e._err(t,et.abandonedHeadElementChild),e.openElements.push(e.headElement,D.HEAD),Ku(e,t),e.openElements.remove(e.headElement);break}case D.HEAD:{e._err(t,et.misplacedStartTagForHeadElement);break}default:IO(e,t)}}function vyt(e,t){switch(t.tagID){case D.BODY:case D.HTML:case D.BR:{IO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function IO(e,t){e._insertFakeElement(Be.BODY,D.BODY),e.insertionMode=me.IN_BODY,eI(e,t)}function eI(e,t){switch(t.type){case di.CHARACTER:{uEe(e,t);break}case di.WHITESPACE_CHARACTER:{cEe(e,t);break}case di.COMMENT:{V6(e,t);break}case di.START_TAG:{So(e,t);break}case di.END_TAG:{tI(e,t);break}case di.EOF:{pEe(e,t);break}}}function cEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function uEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function xyt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function wyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Oyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_FRAMESET)}function Syt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML)}function kyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&z6.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,yt.HTML)}function Eyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Cyt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),n||(e.formElement=e.openElements.current))}function Tyt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===D.LI&&r===D.LI||(n===D.DD||n===D.DT)&&(r===D.DD||r===D.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==D.ADDRESS&&r!==D.DIV&&r!==D.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML)}function Ayt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.tokenizer.state=$s.PLAINTEXT}function _yt(e,t){e.openElements.hasInScope(D.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(D.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.framesetOk=!1}function Nyt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Be.A);n&&(lU(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ryt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(D.NOBR)&&(lU(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Iyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Pyt(e,t){e.treeAdapter.getDocumentMode(e.document)!==$c.QUIRKS&&e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_TABLE}function dEe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,yt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fEe(e){const t=eEe(e,ab.TYPE);return t!=null&&t.toLowerCase()===Z0t}function Dyt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,yt.HTML),fEe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Myt(e,t){e._appendElement(t,yt.HTML),t.ackSelfClosing=!0}function Lyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._appendElement(t,yt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function $yt(e,t){t.tagName=Be.IMG,t.tagID=D.IMG,dEe(e,t)}function Fyt(e,t){e._insertElement(t,yt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$s.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=me.TEXT}function Byt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function Uyt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function AY(e,t){e._switchToTextParsing(t,$s.RAWTEXT)}function Qyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===me.IN_TABLE||e.insertionMode===me.IN_CAPTION||e.insertionMode===me.IN_TABLE_BODY||e.insertionMode===me.IN_ROW||e.insertionMode===me.IN_CELL?me.IN_SELECT_IN_TABLE:me.IN_SELECT}function zyt(e,t){e.openElements.currentTagId===D.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML)}function Vyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,yt.HTML)}function Hyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(D.RTC),e._insertElement(t,yt.HTML)}function qyt(e,t){e._reconstructActiveFormattingElements(),aEe(t),oU(t),t.selfClosing?e._appendElement(t,yt.MATHML):e._insertElement(t,yt.MATHML),t.ackSelfClosing=!0}function Wyt(e,t){e._reconstructActiveFormattingElements(),oEe(t),oU(t),t.selfClosing?e._appendElement(t,yt.SVG):e._insertElement(t,yt.SVG),t.ackSelfClosing=!0}function _Y(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML)}function So(e,t){switch(t.tagID){case D.I:case D.S:case D.B:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.SMALL:case D.STRIKE:case D.STRONG:{jyt(e,t);break}case D.A:{Nyt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{kyt(e,t);break}case D.P:case D.DL:case D.OL:case D.UL:case D.DIV:case D.DIR:case D.NAV:case D.MAIN:case D.MENU:case D.ASIDE:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.DETAILS:case D.ADDRESS:case D.ARTICLE:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Syt(e,t);break}case D.LI:case D.DD:case D.DT:{Tyt(e,t);break}case D.BR:case D.IMG:case D.WBR:case D.AREA:case D.EMBED:case D.KEYGEN:{dEe(e,t);break}case D.HR:{Lyt(e,t);break}case D.RB:case D.RTC:{Vyt(e,t);break}case D.RT:case D.RP:{Hyt(e,t);break}case D.PRE:case D.LISTING:{Eyt(e,t);break}case D.XMP:{Byt(e,t);break}case D.SVG:{Wyt(e,t);break}case D.HTML:{xyt(e,t);break}case D.BASE:case D.LINK:case D.META:case D.STYLE:case D.TITLE:case D.SCRIPT:case D.BGSOUND:case D.BASEFONT:case D.TEMPLATE:{Ku(e,t);break}case D.BODY:{wyt(e,t);break}case D.FORM:{Cyt(e,t);break}case D.NOBR:{Ryt(e,t);break}case D.MATH:{qyt(e,t);break}case D.TABLE:{Pyt(e,t);break}case D.INPUT:{Dyt(e,t);break}case D.PARAM:case D.TRACK:case D.SOURCE:{Myt(e,t);break}case D.IMAGE:{$yt(e,t);break}case D.BUTTON:{_yt(e,t);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{Iyt(e,t);break}case D.IFRAME:{Uyt(e,t);break}case D.SELECT:{Qyt(e,t);break}case D.OPTION:case D.OPTGROUP:{zyt(e,t);break}case D.NOEMBED:case D.NOFRAMES:{AY(e,t);break}case D.FRAMESET:{Oyt(e,t);break}case D.TEXTAREA:{Fyt(e,t);break}case D.NOSCRIPT:{e.options.scriptingEnabled?AY(e,t):_Y(e,t);break}case D.PLAINTEXT:{Ayt(e,t);break}case D.COL:case D.TH:case D.TD:case D.TR:case D.HEAD:case D.FRAME:case D.TBODY:case D.TFOOT:case D.THEAD:case D.CAPTION:case D.COLGROUP:break;default:_Y(e,t)}}function Gyt(e,t){if(e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Kyt(e,t){e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,OEe(e,t))}function Xyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Yyt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(D.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(D.FORM):n&&e.openElements.remove(n))}function Zyt(e){e.openElements.hasInButtonScope(D.P)||e._insertFakeElement(Be.P,D.P),e._closePElement()}function Jyt(e){e.openElements.hasInListItemScope(D.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(D.LI),e.openElements.popUntilTagNamePopped(D.LI))}function evt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function tvt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function nvt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function ivt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Be.BR,D.BR),e.openElements.pop(),e.framesetOk=!1}function hEe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],a=e.openElements.tagIDs[r];if(i===a&&(i!==D.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,a))break}}function tI(e,t){switch(t.tagID){case D.A:case D.B:case D.I:case D.S:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.NOBR:case D.SMALL:case D.STRIKE:case D.STRONG:{lU(e,t);break}case D.P:{Zyt(e);break}case D.DL:case D.UL:case D.OL:case D.DIR:case D.DIV:case D.NAV:case D.PRE:case D.MAIN:case D.MENU:case D.ASIDE:case D.BUTTON:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.ADDRESS:case D.ARTICLE:case D.DETAILS:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.LISTING:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Xyt(e,t);break}case D.LI:{Jyt(e);break}case D.DD:case D.DT:{evt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{tvt(e);break}case D.BR:{ivt(e);break}case D.BODY:{Gyt(e,t);break}case D.HTML:{Kyt(e,t);break}case D.FORM:{Yyt(e);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{nvt(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:hEe(e,t)}}function pEe(e,t){e.tmplInsertionModeStack.length>0?wEe(e,t):cU(e,t)}function rvt(e,t){var n;t.tagID===D.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function svt(e,t){e._err(t,et.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function FM(e,t){if(e.openElements.currentTagId!==void 0&&lEe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=me.IN_TABLE_TEXT,t.type){case di.CHARACTER:{gEe(e,t);break}case di.WHITESPACE_CHARACTER:{mEe(e,t);break}}else wE(e,t)}function avt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_CAPTION}function ovt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_COLUMN_GROUP}function lvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.COLGROUP,D.COLGROUP),e.insertionMode=me.IN_COLUMN_GROUP,uU(e,t)}function cvt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_TABLE_BODY}function uvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.TBODY,D.TBODY),e.insertionMode=me.IN_TABLE_BODY,nI(e,t)}function dvt(e,t){e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function fvt(e,t){fEe(t)?e._appendElement(t,yt.HTML):wE(e,t),t.ackSelfClosing=!0}function hvt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,yt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ex(e,t){switch(t.tagID){case D.TD:case D.TH:case D.TR:{uvt(e,t);break}case D.STYLE:case D.SCRIPT:case D.TEMPLATE:{Ku(e,t);break}case D.COL:{lvt(e,t);break}case D.FORM:{hvt(e,t);break}case D.TABLE:{dvt(e,t);break}case D.TBODY:case D.TFOOT:case D.THEAD:{cvt(e,t);break}case D.INPUT:{fvt(e,t);break}case D.CAPTION:{avt(e,t);break}case D.COLGROUP:{ovt(e,t);break}default:wE(e,t)}}function VS(e,t){switch(t.tagID){case D.TABLE:{e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}case D.BODY:case D.CAPTION:case D.COL:case D.COLGROUP:case D.HTML:case D.TBODY:case D.TD:case D.TFOOT:case D.TH:case D.THEAD:case D.TR:break;default:wE(e,t)}}function wE(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eI(e,t),e.fosterParentingEnabled=n}function mEe(e,t){e.pendingCharacterTokens.push(t)}function gEe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function G1(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===D.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===D.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===D.OPTGROUP&&e.openElements.pop();break}case D.OPTION:{e.openElements.currentTagId===D.OPTION&&e.openElements.pop();break}case D.SELECT:{e.openElements.hasInSelectScope(D.SELECT)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}}}function vvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e._processStartTag(t)):vEe(e,t)}function xvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e.onEndTag(t)):xEe(e,t)}function wvt(e,t){switch(t.tagID){case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{Ku(e,t);break}case D.CAPTION:case D.COLGROUP:case D.TBODY:case D.TFOOT:case D.THEAD:{e.tmplInsertionModeStack[0]=me.IN_TABLE,e.insertionMode=me.IN_TABLE,ex(e,t);break}case D.COL:{e.tmplInsertionModeStack[0]=me.IN_COLUMN_GROUP,e.insertionMode=me.IN_COLUMN_GROUP,uU(e,t);break}case D.TR:{e.tmplInsertionModeStack[0]=me.IN_TABLE_BODY,e.insertionMode=me.IN_TABLE_BODY,nI(e,t);break}case D.TD:case D.TH:{e.tmplInsertionModeStack[0]=me.IN_ROW,e.insertionMode=me.IN_ROW,iI(e,t);break}default:e.tmplInsertionModeStack[0]=me.IN_BODY,e.insertionMode=me.IN_BODY,So(e,t)}}function Ovt(e,t){t.tagID===D.TEMPLATE&&r0(e,t)}function wEe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):cU(e,t)}function Svt(e,t){t.tagID===D.HTML?So(e,t):yN(e,t)}function OEe(e,t){var n;if(t.tagID===D.HTML){if(e.fragmentContext||(e.insertionMode=me.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===D.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else yN(e,t)}function yN(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function kvt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.FRAMESET:{e._insertElement(t,yt.HTML);break}case D.FRAME:{e._appendElement(t,yt.HTML),t.ackSelfClosing=!0;break}case D.NOFRAMES:{Ku(e,t);break}}}function Evt(e,t){t.tagID===D.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==D.FRAMESET&&(e.insertionMode=me.AFTER_FRAMESET))}function Cvt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function Tvt(e,t){t.tagID===D.HTML&&(e.insertionMode=me.AFTER_AFTER_FRAMESET)}function Avt(e,t){t.tagID===D.HTML?So(e,t):wA(e,t)}function wA(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function _vt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function Nvt(e,t){t.chars=Zr,e._insertCharacters(t)}function jvt(e,t){e._insertCharacters(t),e.framesetOk=!1}function SEe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==yt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Rvt(e,t){if(W0t(t))SEe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===yt.MATHML?aEe(t):i===yt.SVG&&(G0t(t),oEe(t)),oU(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function Ivt(e,t){if(t.tagID===D.P||t.tagID===D.BR){SEe(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)===yt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Be.AREA,Be.BASE,Be.BASEFONT,Be.BGSOUND,Be.BR,Be.COL,Be.EMBED,Be.FRAME,Be.HR,Be.IMG,Be.INPUT,Be.KEYGEN,Be.LINK,Be.META,Be.PARAM,Be.SOURCE,Be.TRACK,Be.WBR;const Pvt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Dvt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),NY={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function kEe(e,t){const n=Hvt(e),i=BSe("type",{handlers:{root:Mvt,element:Lvt,text:$vt,comment:CEe,doctype:Fvt,raw:Uvt},unknown:Qvt}),r={parser:n?new TY(NY):TY.getFragmentParser(void 0,NY),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),Kx(r,Yd());const s=n?r.parser.document:r.parser.getFragment(),a=qbt(s,{file:r.options.file});return r.stitches&&vE(a,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function EEe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:di.CHARACTER,chars:e.value,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Fvt(e,t){const n={type:di.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Bvt(e,t){t.stitches=!0;const n=qvt(e);if("children"in e&&"children"in n){const i=kEe({type:"root",children:e.children},t.options);n.children=i.children}CEe({type:"comment",value:{stitch:n}},t)}function CEe(e,t){const n=e.value,i={type:di.COMMENT,data:n,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function Uvt(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,TEe(t,Yd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Pvt,"<$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 Qvt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Bvt(n,t);else{let i="";throw Dvt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function Kx(e,t){TEe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$s.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function TEe(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 zvt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,Yd(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:$g.html;r===$g.html&&n==="svg"&&(r=$g.svg);const s=Ybt({...e,children:[]},{space:r===$g.svg?"svg":"html"}),a={type:di.START_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:OE(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Vvt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&s0t.includes(n)||t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,GR(e));const i={type:di.END_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:OE(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$s.RCDATA||t.parser.tokenizer.state===$s.RAWTEXT||t.parser.tokenizer.state===$s.SCRIPT_DATA)&&(t.parser.tokenizer.state=$s.DATA)}function Hvt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function OE(e){const t=Yd(e)||{line:void 0,column:void 0,offset:void 0},n=GR(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function qvt(e){return"children"in e?Zv({...e,children:[]}):Zv(e)}function Wvt(e){return function(t,n){return kEe(t,{...e,file:n})}}const Gvt="modulepreload",Kvt=function(e){return"/"+e},jY={},Md=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Kvt(c),c in jY)return;jY[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":Gvt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Xvt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Yvt=/[\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]/,Zvt=/[\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]/,BM={Space_Separator:Xvt,ID_Start:Yvt,ID_Continue:Zvt},Is={isSpaceSeparator(e){return typeof e=="string"&&BM.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||BM.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==="‍"||BM.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 q6,Lo,Qf,vN,Om,Mu,Aa,dU,PO;var Jvt=function(t,n){q6=String(t),Lo="start",Qf=[],vN=0,Om=1,Mu=0,Aa=void 0,dU=void 0,PO=void 0;do Aa=ext(),ixt[Lo]();while(Aa.type!=="eof");return typeof n=="function"?W6({"":PO},"",n):PO};function W6(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Vpt={tokenize:Zpt,partial:!0};function Hpt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Kpt,continuation:{tokenize:Xpt},exit:Ypt}},text:{91:{name:"gfmFootnoteCall",tokenize:Gpt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qpt,resolveTo:Wpt}}}}function qpt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=Du(i.sliceSerialize({start:a.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Wpt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function Gpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!a||f===null||f===91||Ar(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(Du(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ar(f)||(a=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Kpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,a=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!l||g===null||g===91||Ar(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Du(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ar(g)||(l=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),Ui(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function Xpt(e,t,n){return e.check(bE,t,e.attempt(Vpt,t,n))}function Ypt(e){e.exit("gfmFootnoteDefinition")}function Zpt(e,t,n){const i=this;return Ui(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Jpt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(a,l){let c=-1;for(;++c1?c(g):(a.consume(g),f++,m);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=Yv(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class emt{constructor(){this.map=[]}add(t,n,i){tmt(this,t,n,i)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function tmt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const T=i.events[j][1].type;if(T==="lineEnding"||T==="linePrefix")j--;else break}const A=j>-1?i.events[j][1].type:null,F=A==="tableHead"||A==="tableRow"?S:c;return F===S&&i.parser.lazy[i.now().line]?n(_):F(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(a=!0,s+=1),d(_)}function d(_){return _===null?n(_):Tn(_)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),m):n(_):wi(_)?Ui(e,d,"whitespace")(_):(s+=1,a&&(a=!1,r+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||Ar(_)?(e.exit("data"),d(_)):(e.consume(_),_===92?h:f)}function h(_){return _===92||_===124?(e.consume(_),f):f(_)}function m(_){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(_):(e.enter("tableDelimiterRow"),a=!1,wi(_)?Ui(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):g(_))}function g(_){return _===45||_===58?v(_):_===124?(a=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),b):k(_)}function b(_){return wi(_)?Ui(e,v,"whitespace")(_):v(_)}function v(_){return _===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),y):_===45?(s+=1,y(_)):_===null||Tn(_)?w(_):k(_)}function y(_){return _===45?(e.enter("tableDelimiterFiller"),x(_)):k(_)}function x(_){return _===45?(e.consume(_),x):_===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(_))}function O(_){return wi(_)?Ui(e,w,"whitespace")(_):w(_)}function w(_){return _===124?g(_):_===null||Tn(_)?!a||r!==s?k(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):k(_)}function k(_){return n(_)}function S(_){return e.enter("tableRow"),E(_)}function E(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),E):_===null||Tn(_)?(e.exit("tableRow"),t(_)):wi(_)?Ui(e,E,"whitespace")(_):(e.enter("data"),C(_))}function C(_){return _===null||_===124||Ar(_)?(e.exit("data"),E(_)):(e.consume(_),_===92?N:C)}function N(_){return _===92||_===124?(e.consume(_),C):C(_)}}function smt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new emt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ny(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function GX(e,t,n,i,r){const s=[],a=ny(t.events,n);r&&(r.end=Object.assign({},a),s.push(["exit",r,t])),i.end=Object.assign({},a),s.push(["exit",i,t]),e.add(n+1,0,s)}function ny(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const amt={name:"tasklistCheck",tokenize:lmt};function omt(){return{text:{91:amt}}}function lmt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return Ar(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Tn(c)?t(c):wi(c)?e.check({tokenize:cmt},t,n)(c):n(c)}}function cmt(e,t,n){return Ui(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function umt(e){return mSe([Dpt(),Hpt(),Jpt(e),imt(),omt()])}const dmt={};function fmt(e){const t=this,n=e||dmt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(umt(n)),s.push(jpt()),a.push(Rpt(n))}const KX=function(e,t,n){const i=yE(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function lke(e,t,n){return e.type==="element"?xmt(e,t,n):e.type==="text"?n.whitespace==="normal"?cke(e,n):wmt(e):[]}function xmt(e,t,n){const i=uke(e,n),r=e.children||[];let s=-1,a=[];if(ymt(e))return a;let l,c;for(B6(e)||JX(e)&&KX(t,e,JX)?c=` +`:bmt(e)?(l=2,c=2):oke(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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Amt(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=Tmt(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 JB(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...O,"set","shopt",...w,...k]},contains:[m,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function _mt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+a+"[\\*&\\s]+)+"+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 Nmt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function jmt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const Rmt=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_-]*/}}),Imt=["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"],Pmt=["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"],Dmt=[...Imt,...Pmt],Mmt=["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(),Lmt=["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(),$mt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Fmt=["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 Bmt(e){const t=e.regex,n=Rmt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Lmt.join("|")+")"},{begin:":(:)?("+$mt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Fmt.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:Mmt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Dmt.join("|")+")\\b"}]}}function Umt(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 Qmt(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:"fke(e,t,n-1))}function Vmt(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+fke("(?:<"+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,eY,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},eY,u]}}const tY="[A-Za-z$_][0-9A-Za-z$_]*",Hmt=["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"],qmt=["true","false","null","undefined","NaN","Infinity"],hke=["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"],pke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wmt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gmt=[].concat(mke,hke,pke);function gke(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:tY,keyword:Hmt,literal:qmt,built_in:Gmt,"variable.language":Wmt},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]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...hke,...pke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...mke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function bke(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ry="[0-9](_*[0-9])*",_T=`\\.(${ry})`,NT="[0-9a-fA-F](_*[0-9a-fA-F])*",Kmt={className:"number",variants:[{begin:`(\\b(${ry})((${_T})|\\.)?|(${_T}))[eE][+-]?(${ry})[fFdD]?\\b`},{begin:`\\b(${ry})((${_T})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_T})[fFdD]?\\b`},{begin:`\\b(${ry})[fFdD]\\b`},{begin:`\\b0[xX]((${NT})\\.?|(${NT})?\\.(${NT}))[pP][+-]?(${ry})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NT})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Xmt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=Kmt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const Ymt=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_-]*/}}),Zmt=["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"],Jmt=["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"],egt=[...Zmt,...Jmt],tgt=["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(),yke=["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(),vke=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ngt=["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(),igt=yke.concat(vke).sort().reverse();function rgt(e){const t=Ymt(e),n=igt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(O){return{className:"string",begin:"~?"+O+".*?"+O}},u=function(O,w,k){return{className:O,begin:w,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:tgt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ngt.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("+egt.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:":("+yke.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+vke.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,x,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function sgt(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 xke(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function agt(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 ogt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,a.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function lgt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(T,P)=>{P.data._beginMatch=T[1]||T[2]},"on:end":(T,P)=>{P.data._beginMatch!==T[1]&&P.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),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"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(T=>{const P=[];return T.forEach(R=>{P.push(R),R.toLowerCase()===R?P.push(R.toUpperCase()):P.push(R.toLowerCase())}),P})(v),built_in:x},k=T=>T.map(P=>P.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(i,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[N,a,C,e.C_BLOCK_COMMENT_MODE,g,b,S]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(j);const A=[N,C,e.C_BLOCK_COMMENT_MODE,g,b,S],F={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[F,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,j,C,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",F,a,C,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function cgt(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 ugt(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Oke(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 dgt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function fgt(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 hgt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(S)}}function pgt(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const mgt=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_-]*/}}),ggt=["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"],bgt=["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"],ygt=[...ggt,...bgt],vgt=["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(),xgt=["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(),wgt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ogt=["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 Sgt(e){const t=mgt(e),n=wgt,i=xgt,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("+ygt.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("+Ogt.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:vgt.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 kgt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Egt(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(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 x(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:x(h),relevance:0};function w(k,{exceptions:S,when:E}={}){const C=E;return S=S||[],k.map(N=>N.match(/\|\d+$/)||S.includes(N)?N:C(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(a)},O,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Ske(e){return e?typeof e=="string"?e:e.source:null}function q1(e){return gr("(?=",e,")")}function gr(...e){return e.map(n=>Ske(n)).join("")}function Cgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Io(...e){return"("+(Cgt(e).capture?"":"?:")+e.map(i=>Ske(i)).join("|")+")"}const eU=e=>gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Tgt=["Protocol","Type"].map(eU),nY=["init","self"].map(eU),Agt=["Any","Self"],DM=["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"],iY=["false","nil","true"],_gt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ngt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],rY=["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"],kke=Io(/[/=\-+!*%<>&|^~?]/,/[\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]/),Eke=Io(kke,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),MM=gr(kke,Eke,"*"),Cke=Io(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),hN=Io(Cke,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dd=gr(Cke,hN,"*"),jT=gr(/[A-Z]/,hN,"*"),jgt=["attached","autoclosure",gr(/convention\(/,Io("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gr(/objc\(/,dd,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Rgt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Igt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Io(...Tgt,...nY)],className:{2:"keyword"}},s={match:gr(/\./,Io(...DM)),relevance:0},a=DM.filter(ke=>typeof ke=="string").concat(["_|0"]),l=DM.filter(ke=>typeof ke!="string").concat(Agt).map(eU),c={variants:[{className:"keyword",match:Io(...l,...nY)}]},u={$pattern:Io(/\b\w+/,/#\w+/),keyword:a.concat(Ngt),literal:iY},d=[r,s,c],f={match:gr(/\./,Io(...rY)),relevance:0},h={className:"built_in",match:gr(/\b/,Io(...rY),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:MM},{match:`\\.(\\.|${Eke})+`}]},v=[g,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(ke="")=>({className:"subst",variants:[{match:gr(/\\/,ke,/[0\\tnr"']/)},{match:gr(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(ke="")=>({className:"subst",match:gr(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(ke="")=>({className:"subst",label:"interpol",begin:gr(/\\/,ke,/\(/),end:/\)/}),E=(ke="")=>({begin:gr(ke,/"""/),end:gr(/"""/,ke),contains:[w(ke),k(ke),S(ke)]}),C=(ke="")=>({begin:gr(ke,/"/),end:gr(/"/,ke),contains:[w(ke),S(ke)]}),N={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},A=ke=>{const st=gr(ke,/\//),Le=gr(/\//,ke);return{begin:st,end:Le,contains:[..._,{scope:"comment",begin:`#(?!.*${Le})`,end:/$/}]}},F={scope:"regexp",variants:[A("###"),A("##"),A("#"),j]},T={match:gr(/`/,dd,/`/)},P={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${hN}+`},L=[T,P,R],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Rgt,contains:[...v,O,N]}]}},U={scope:"keyword",match:gr(/@/,Io(...jgt),q1(Io(/\(/,/\s+/)))},I={scope:"meta",match:gr(/@/,dd)},H=[M,U,I],K={match:q1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,hN,"+")},{className:"type",match:jT,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gr(/\s+&\s+/,q1(jT)),relevance:0}]},Q={begin://,keywords:u,contains:[...i,...d,...H,g,K]};K.contains.push(Q);const q={match:gr(dd,/\s*:/),keywords:"_|0",relevance:0},B={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,F,...d,...m,...v,O,N,...L,...H,K]},ee={begin://,keywords:"repeat each",contains:[...i,K]},le={begin:Io(q1(gr(dd,/\s*:/)),q1(gr(dd,/\s+/,dd,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dd}]},se={begin:/\(/,end:/\)/,keywords:u,contains:[le,...i,...d,...v,O,N,...H,K,B],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Io(T.match,dd,MM)],className:{1:"keyword",3:"title.function"},contains:[ee,se,t],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ee,se,t],illegal:/\[|%/},W={match:[/operator/,/\s+/,MM],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,jT],className:{1:"keyword",3:"title"},contains:[K],keywords:[..._gt,...iY],end:/}/},ae={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Oe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dd,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ee,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jT},...d],relevance:0}]};for(const ke of N.variants){const st=ke.contains.find(Me=>Me.label==="interpol");st.keywords=u;const Le=[...d,...m,...v,O,N,...L];st.contains=[...Le,{begin:/\(/,end:/\)/,contains:["self",...Le]}]}return{name:"Swift",keywords:u,contains:[...i,re,ge,ae,ue,Oe,W,X,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},F,...d,...m,...v,O,N,...L,...H,K,B]}}const pN="[A-Za-z$_][0-9A-Za-z$_]*",Tke=["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"],Ake=["true","false","null","undefined","NaN","Infinity"],_ke=["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"],Nke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Rke=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ike=[].concat(jke,_ke,Nke);function Pgt(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:pN,keyword:Tke,literal:Ake,built_in:Ike,"variable.language":Rke},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]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._ke,...Nke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...jke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function Pke(e){const t=e.regex,n=Pgt(e),i=pN,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:pN,keyword:Tke.concat(c),literal:Ake,built_in:Ike.concat(r),"variable.language":Rke},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const x=b.contains.findIndex(O=>O.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,a,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Dgt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Mgt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function Lgt(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Dke(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,a],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const $gt={arduino:Amt,bash:JB,c:_mt,cpp:Nmt,csharp:jmt,css:Bmt,diff:Umt,go:Qmt,graphql:zmt,ini:dke,java:Vmt,javascript:gke,json:bke,kotlin:Xmt,less:rgt,lua:sgt,makefile:xke,markdown:wke,objectivec:agt,perl:ogt,php:lgt,"php-template":cgt,plaintext:ugt,python:Oke,"python-repl":dgt,r:fgt,ruby:hgt,rust:pgt,scss:Sgt,shell:kgt,sql:Egt,swift:Igt,typescript:Pke,vbnet:Dgt,wasm:Mgt,xml:Lgt,yaml:Dke};function Mke(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)&&Mke(n)}),e}let sY=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Lke(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Bp(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Fgt="",aY=e=>!!e.scope,Bgt=(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 Ugt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Lke(t)}openNode(t){if(!aY(t))return;const n=Bgt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){aY(t)&&(this.buffer+=Fgt)}value(){return this.buffer}span(t){this.buffer+=``}}const oY=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class tU{constructor(){this.rootNode=oY(),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=oY({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=>{tU._collapse(n)}))}}class Qgt extends tU{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 Ugt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function QS(e){return e?typeof e=="string"?e:e.source:null}function $ke(e){return i0("(?=",e,")")}function zgt(e){return i0("(?:",e,")*")}function Vgt(e){return i0("(?:",e,")?")}function i0(...e){return e.map(n=>QS(n)).join("")}function Hgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function nU(...e){return"("+(Hgt(e).capture?"":"?:")+e.map(i=>QS(i)).join("|")+")"}function Fke(e){return new RegExp(e.toString()+"|").exec("").length-1}function qgt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Wgt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function iU(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=QS(i),a="";for(;s.length>0;){const l=Wgt.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(i=>`(${i})`).join(t)}const Ggt=/\b\B/,Bke="[a-zA-Z]\\w*",rU="[a-zA-Z_]\\w*",Uke="\\b\\d+(\\.\\d+)?",Qke="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",zke="\\b(0b[01]+)",Kgt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Xgt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=i0(t,/.*\b/,e.binary,/\b.*/)),Bp({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},zS={begin:"\\\\[\\s\\S]",relevance:0},Ygt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[zS]},Zgt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[zS]},Jgt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},JR=function(e,t,n={}){const i=Bp({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=nU("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:i0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},ebt=JR("//","$"),tbt=JR("/\\*","\\*/"),nbt=JR("#","$"),ibt={scope:"number",begin:Uke,relevance:0},rbt={scope:"number",begin:Qke,relevance:0},sbt={scope:"number",begin:zke,relevance:0},abt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[zS,{begin:/\[/,end:/\]/,relevance:0,contains:[zS]}]},obt={scope:"title",begin:Bke,relevance:0},lbt={scope:"title",begin:rU,relevance:0},cbt={begin:"\\.\\s*"+rU,relevance:0},ubt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var RT=Object.freeze({__proto__:null,APOS_STRING_MODE:Ygt,BACKSLASH_ESCAPE:zS,BINARY_NUMBER_MODE:sbt,BINARY_NUMBER_RE:zke,COMMENT:JR,C_BLOCK_COMMENT_MODE:tbt,C_LINE_COMMENT_MODE:ebt,C_NUMBER_MODE:rbt,C_NUMBER_RE:Qke,END_SAME_AS_BEGIN:ubt,HASH_COMMENT_MODE:nbt,IDENT_RE:Bke,MATCH_NOTHING_RE:Ggt,METHOD_GUARD:cbt,NUMBER_MODE:ibt,NUMBER_RE:Uke,PHRASAL_WORDS_MODE:Jgt,QUOTE_STRING_MODE:Zgt,REGEXP_MODE:abt,RE_STARTERS_RE:Kgt,SHEBANG:Xgt,TITLE_MODE:obt,UNDERSCORE_IDENT_RE:rU,UNDERSCORE_TITLE_MODE:lbt});function dbt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fbt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function hbt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=dbt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function pbt(e,t){Array.isArray(e.illegal)&&(e.illegal=nU(...e.illegal))}function mbt(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 gbt(e,t){e.relevance===void 0&&(e.relevance=1)}const bbt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=i0(n.beforeMatch,$ke(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ybt=["of","and","for","in","not","or","if","then","parent","list","value"],vbt="keyword";function Vke(e,t,n=vbt){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,Vke(e[s],t,s))}),i;function r(s,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");i[c[0]]=[s,xbt(c[0],c[1])]})}}function xbt(e,t){return t?Number(t):wbt(e)?0:1}function wbt(e){return ybt.includes(e.toLowerCase())}const lY={},sb=e=>{console.error(e)},cY=(e,...t)=>{console.log(`WARN: ${e}`,...t)},$0=(e,t)=>{lY[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),lY[`${e}/${t}`]=!0)},mN=new Error;function Hke(e,t,{key:n}){let i=0;const r=e[n],s={},a={};for(let l=1;l<=t.length;l++)a[l+i]=r[l],s[l+i]=!0,i+=Fke(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function Obt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sb("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mN;if(typeof e.beginScope!="object"||e.beginScope===null)throw sb("beginScope must be object"),mN;Hke(e,e.begin,{key:"beginScope"}),e.begin=iU(e.begin,{joinWith:""})}}function Sbt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sb("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mN;if(typeof e.endScope!="object"||e.endScope===null)throw sb("endScope must be object"),mN;Hke(e,e.end,{key:"endScope"}),e.end=iU(e.end,{joinWith:""})}}function kbt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ebt(e){kbt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Obt(e),Sbt(e)}function Cbt(e){function t(a,l){return new RegExp(QS(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=Fke(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(iU(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(a){const l=new i;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function s(a,l){const c=a;if(a.isCompiled)return c;[fbt,mbt,Ebt,bbt].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[hbt,pbt,gbt].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=Vke(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=QS(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Tbt(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,c)}),a.starts&&s(a.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Bp(e.classNameAliases||{}),s(e)}function qke(e){return e?e.endsWithParent||qke(e.starts):!1}function Tbt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Bp(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qke(e)?Bp(e,{starts:e.starts?Bp(e.starts):null}):Object.isFrozen(e)?Bp(e):e}var Abt="11.11.1";class _bt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const LM=Lke,uY=Bp,dY=Symbol("nomatch"),Nbt=7,Wke=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qgt};function c(R){return l.noHighlightRe.test(R)}function u(R){let L=R.className+" ";L+=R.parentNode?R.parentNode.className:"";const M=l.languageDetectRe.exec(L);if(M){const U=C(M[1]);return U||(cY(s.replace("{}",M[1])),cY("Falling back to no-highlight mode for this block.",R)),U?M[1]:"no-highlight"}return L.split(/\s+/).find(U=>c(U)||C(U))}function d(R,L,M){let U="",I="";typeof L=="object"?(U=R,M=L.ignoreIllegals,I=L.language):($0("10.7.0","highlight(lang, code, ...args) has been deprecated."),$0("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),I=R,U=L),M===void 0&&(M=!0);const H={code:U,language:I};T("before:highlight",H);const K=H.result?H.result:f(H.language,H.code,M);return K.code=H.code,T("after:highlight",K),K}function f(R,L,M,U){const I=Object.create(null);function H(J,he){return J.keywords[he]}function K(){if(!Le.keywords){Ie.addText(qe);return}let J=0;Le.keywordPatternRe.lastIndex=0;let he=Le.keywordPatternRe.exec(qe),_e="";for(;he;){_e+=qe.substring(J,he.index);const Ze=Oe.case_insensitive?he[0].toLowerCase():he[0],at=H(Le,Ze);if(at){const[wt,Se]=at;if(Ie.addText(_e),_e="",I[Ze]=(I[Ze]||0)+1,I[Ze]<=Nbt&&(Ae+=Se),wt.startsWith("_"))_e+=he[0];else{const ve=Oe.classNameAliases[wt]||wt;B(he[0],ve)}}else _e+=he[0];J=Le.keywordPatternRe.lastIndex,he=Le.keywordPatternRe.exec(qe)}_e+=qe.substring(J),Ie.addText(_e)}function Q(){if(qe==="")return;let J=null;if(typeof Le.subLanguage=="string"){if(!t[Le.subLanguage]){Ie.addText(qe);return}J=f(Le.subLanguage,qe,!0,Me[Le.subLanguage]),Me[Le.subLanguage]=J._top}else J=m(qe,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(Ae+=J.relevance),Ie.__addSublanguage(J._emitter,J.language)}function q(){Le.subLanguage!=null?Q():K(),qe=""}function B(J,he){J!==""&&(Ie.startScope(he),Ie.addText(J),Ie.endScope())}function ee(J,he){let _e=1;const Ze=he.length-1;for(;_e<=Ze;){if(!J._emit[_e]){_e++;continue}const at=Oe.classNameAliases[J[_e]]||J[_e],wt=he[_e];at?B(wt,at):(qe=wt,K(),qe=""),_e++}}function le(J,he){return J.scope&&typeof J.scope=="string"&&Ie.openNode(Oe.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(B(qe,Oe.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),qe=""):J.beginScope._multi&&(ee(J.beginScope,he),qe="")),Le=Object.create(J,{parent:{value:Le}}),Le}function se(J,he,_e){let Ze=qgt(J.endRe,_e);if(Ze){if(J["on:end"]){const at=new sY(J);J["on:end"](he,at),at.isMatchIgnored&&(Ze=!1)}if(Ze){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return se(J.parent,he,_e)}function re(J){return Le.matcher.regexIndex===0?(qe+=J[0],1):(De=!0,0)}function ge(J){const he=J[0],_e=J.rule,Ze=new sY(_e),at=[_e.__beforeBegin,_e["on:begin"]];for(const wt of at)if(wt&&(wt(J,Ze),Ze.isMatchIgnored))return re(he);return _e.skip?qe+=he:(_e.excludeBegin&&(qe+=he),q(),!_e.returnBegin&&!_e.excludeBegin&&(qe=he)),le(_e,J),_e.returnBegin?0:he.length}function W(J){const he=J[0],_e=L.substring(J.index),Ze=se(Le,J,_e);if(!Ze)return dY;const at=Le;Le.endScope&&Le.endScope._wrap?(q(),B(he,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(q(),ee(Le.endScope,J)):at.skip?qe+=he:(at.returnEnd||at.excludeEnd||(qe+=he),q(),at.excludeEnd&&(qe=he));do Le.scope&&Ie.closeNode(),!Le.skip&&!Le.subLanguage&&(Ae+=Le.relevance),Le=Le.parent;while(Le!==Ze.parent);return Ze.starts&&le(Ze.starts,J),at.returnEnd?0:he.length}function X(){const J=[];for(let he=Le;he!==Oe;he=he.parent)he.scope&&J.unshift(he.scope);J.forEach(he=>Ie.openNode(he))}let ae={};function ue(J,he){const _e=he&&he[0];if(qe+=J,_e==null)return q(),0;if(ae.type==="begin"&&he.type==="end"&&ae.index===he.index&&_e===""){if(qe+=L.slice(he.index,he.index+1),!r){const Ze=new Error(`0 width match regex (${R})`);throw Ze.languageName=R,Ze.badRule=ae.rule,Ze}return 1}if(ae=he,he.type==="begin")return ge(he);if(he.type==="illegal"&&!M){const Ze=new Error('Illegal lexeme "'+_e+'" for mode "'+(Le.scope||"")+'"');throw Ze.mode=Le,Ze}else if(he.type==="end"){const Ze=W(he);if(Ze!==dY)return Ze}if(he.type==="illegal"&&_e==="")return qe+=` +`,1;if(Ee>1e5&&Ee>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=_e,_e.length}const Oe=C(R);if(!Oe)throw sb(s.replace("{}",R)),new Error('Unknown language: "'+R+'"');const ke=Cbt(Oe);let st="",Le=U||ke;const Me={},Ie=new l.__emitter(l);X();let qe="",Ae=0,ze=0,Ee=0,De=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(L,Ie);else{for(Le.matcher.considerAll();;){Ee++,De?De=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=ze;const J=Le.matcher.exec(L);if(!J)break;const he=L.substring(ze,J.index),_e=ue(he,J);ze=J.index+_e}ue(L.substring(ze))}return Ie.finalize(),st=Ie.toHTML(),{language:R,value:st,relevance:Ae,illegal:!1,_emitter:Ie,_top:Le}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:R,value:LM(L),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ze,context:L.slice(ze-100,ze+100),mode:J.mode,resultSoFar:st},_emitter:Ie};if(r)return{language:R,value:LM(L),illegal:!1,relevance:0,errorRaised:J,_emitter:Ie,_top:Le};throw J}}function h(R){const L={value:LM(R),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return L._emitter.addText(R),L}function m(R,L){L=L||l.languages||Object.keys(t);const M=h(R),U=L.filter(C).filter(_).map(q=>f(q,R,!1));U.unshift(M);const I=U.sort((q,B)=>{if(q.relevance!==B.relevance)return B.relevance-q.relevance;if(q.language&&B.language){if(C(q.language).supersetOf===B.language)return 1;if(C(B.language).supersetOf===q.language)return-1}return 0}),[H,K]=I,Q=H;return Q.secondBest=K,Q}function g(R,L,M){const U=L&&n[L]||M;R.classList.add("hljs"),R.classList.add(`language-${U}`)}function b(R){let L=null;const M=u(R);if(c(M))return;if(T("before:highlightElement",{el:R,language:M}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R)),l.throwUnescapedHTML))throw new _bt("One of your code blocks includes unescaped HTML.",R.innerHTML);L=R;const U=L.textContent,I=M?d(U,{language:M,ignoreIllegals:!0}):m(U);R.innerHTML=I.value,R.dataset.highlighted="yes",g(R,M,I.language),R.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(R.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),T("after:highlightElement",{el:R,result:I,text:U})}function v(R){l=uY(l,R)}const y=()=>{w(),$0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),$0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function w(){function R(){w()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",R,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(R,L){let M=null;try{M=L(e)}catch(U){if(sb("Language definition for '{}' could not be registered.".replace("{}",R)),r)sb(U);else throw U;M=a}M.name||(M.name=R),t[R]=M,M.rawDefinition=L.bind(null,e),M.aliases&&N(M.aliases,{languageName:R})}function S(R){delete t[R];for(const L of Object.keys(n))n[L]===R&&delete n[L]}function E(){return Object.keys(t)}function C(R){return R=(R||"").toLowerCase(),t[R]||t[n[R]]}function N(R,{languageName:L}){typeof R=="string"&&(R=[R]),R.forEach(M=>{n[M.toLowerCase()]=L})}function _(R){const L=C(R);return L&&!L.disableAutodetect}function j(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=L=>{R["before:highlightBlock"](Object.assign({block:L.el},L))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=L=>{R["after:highlightBlock"](Object.assign({block:L.el},L))})}function A(R){j(R),i.push(R)}function F(R){const L=i.indexOf(R);L!==-1&&i.splice(L,1)}function T(R,L){const M=R;i.forEach(function(U){U[M]&&U[M](L)})}function P(R){return $0("10.7.0","highlightBlock will be removed entirely in v12.0"),$0("10.7.0","Please use highlightElement now."),b(R)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:w,highlightElement:b,highlightBlock:P,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:S,listLanguages:E,getLanguage:C,registerAliases:N,autoDetection:_,inherit:uY,addPlugin:A,removePlugin:F}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Abt,e.regex={concat:i0,lookahead:$ke,either:nU,optional:Vgt,anyNumberOfTimes:zgt};for(const R in RT)typeof RT[R]=="object"&&Mke(RT[R]);return Object.assign(e,RT),e},Jv=Wke({});Jv.newInstance=()=>Wke({});var jbt=Jv;Jv.HighlightJS=Jv;Jv.default=Jv;const xo=px(jbt),fY={},Rbt="hljs-";function Ibt(e){const t=xo.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:a,registered:l};function n(c,u,d){const f=d||fY,h=typeof f.prefix=="string"?f.prefix:Rbt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Pbt,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||fY).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class Pbt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Dbt={};function hY(e){const t=e||Dbt,n=t.aliases,i=t.detect||!1,r=t.languages||$gt,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=Ibt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){vE(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=Mbt(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=vmt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const O=x;if(b&&/Unknown language/.test(O.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:O,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Mbt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=gY(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function l0t(e){return e>=56320&&e<=57343}function c0t(e,t){return(e-55296)*1024+9216+t}function Jke(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function eEe(e){return e>=64976&&e<=65007||o0t.has(e)}var et;(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"})(et||(et={}));const u0t=65536;class d0t{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=u0t,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,a=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(l0t(n))return this.pos++,this._addGap(),c0t(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,oe.EOF;return this._err(et.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,Zke(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){Jke(t)?this._err(et.controlCharacterInInputStream):eEe(t)&&this._err(et.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 f0t=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))),h0t=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 p0t(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=h0t.get(e))!==null&&t!==void 0?t:e}var Da;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Da||(Da={}));const m0t=32;var Up;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Up||(Up={}));function Q6(e){return e>=Da.ZERO&&e<=Da.NINE}function g0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_F||e>=Da.LOWER_A&&e<=Da.LOWER_F}function b0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_Z||e>=Da.LOWER_A&&e<=Da.LOWER_Z||Q6(e)}function y0t(e){return e===Da.EQUALS||b0t(e)}var Ta;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ta||(Ta={}));var Uf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Uf||(Uf={}));class v0t{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ta.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Uf.Strict}startEntity(t){this.decodeMode=t,this.state=Ta.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ta.EntityStart:return t.charCodeAt(n)===Da.NUM?(this.state=Ta.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ta.NamedEntity,this.stateNamedEntity(t,n));case Ta.NumericStart:return this.stateNumericStart(t,n);case Ta.NumericDecimal:return this.stateNumericDecimal(t,n);case Ta.NumericHex:return this.stateNumericHex(t,n);case Ta.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|m0t)===Da.LOWER_X?(this.state=Ta.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ta.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(a===Da.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Uf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Up.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Up.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ta.NamedEntity:return this.result!==0&&(this.decodeMode!==Uf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ta.NumericDecimal:return this.emitNumericEntity(0,2);case Ta.NumericHex:return this.emitNumericEntity(0,3);case Ta.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ta.EntityStart:return 0}}}function x0t(e,t,n,i){const r=(t&Up.BRANCH_LENGTH)>>7,s=t&Up.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let a=n,l=a+r-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var yt;(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/"})(yt||(yt={}));var ab;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ab||(ab={}));var $c;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($c||($c={}));var Be;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Be||(Be={}));var D;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(D||(D={}));const w0t=new Map([[Be.A,D.A],[Be.ADDRESS,D.ADDRESS],[Be.ANNOTATION_XML,D.ANNOTATION_XML],[Be.APPLET,D.APPLET],[Be.AREA,D.AREA],[Be.ARTICLE,D.ARTICLE],[Be.ASIDE,D.ASIDE],[Be.B,D.B],[Be.BASE,D.BASE],[Be.BASEFONT,D.BASEFONT],[Be.BGSOUND,D.BGSOUND],[Be.BIG,D.BIG],[Be.BLOCKQUOTE,D.BLOCKQUOTE],[Be.BODY,D.BODY],[Be.BR,D.BR],[Be.BUTTON,D.BUTTON],[Be.CAPTION,D.CAPTION],[Be.CENTER,D.CENTER],[Be.CODE,D.CODE],[Be.COL,D.COL],[Be.COLGROUP,D.COLGROUP],[Be.DD,D.DD],[Be.DESC,D.DESC],[Be.DETAILS,D.DETAILS],[Be.DIALOG,D.DIALOG],[Be.DIR,D.DIR],[Be.DIV,D.DIV],[Be.DL,D.DL],[Be.DT,D.DT],[Be.EM,D.EM],[Be.EMBED,D.EMBED],[Be.FIELDSET,D.FIELDSET],[Be.FIGCAPTION,D.FIGCAPTION],[Be.FIGURE,D.FIGURE],[Be.FONT,D.FONT],[Be.FOOTER,D.FOOTER],[Be.FOREIGN_OBJECT,D.FOREIGN_OBJECT],[Be.FORM,D.FORM],[Be.FRAME,D.FRAME],[Be.FRAMESET,D.FRAMESET],[Be.H1,D.H1],[Be.H2,D.H2],[Be.H3,D.H3],[Be.H4,D.H4],[Be.H5,D.H5],[Be.H6,D.H6],[Be.HEAD,D.HEAD],[Be.HEADER,D.HEADER],[Be.HGROUP,D.HGROUP],[Be.HR,D.HR],[Be.HTML,D.HTML],[Be.I,D.I],[Be.IMG,D.IMG],[Be.IMAGE,D.IMAGE],[Be.INPUT,D.INPUT],[Be.IFRAME,D.IFRAME],[Be.KEYGEN,D.KEYGEN],[Be.LABEL,D.LABEL],[Be.LI,D.LI],[Be.LINK,D.LINK],[Be.LISTING,D.LISTING],[Be.MAIN,D.MAIN],[Be.MALIGNMARK,D.MALIGNMARK],[Be.MARQUEE,D.MARQUEE],[Be.MATH,D.MATH],[Be.MENU,D.MENU],[Be.META,D.META],[Be.MGLYPH,D.MGLYPH],[Be.MI,D.MI],[Be.MO,D.MO],[Be.MN,D.MN],[Be.MS,D.MS],[Be.MTEXT,D.MTEXT],[Be.NAV,D.NAV],[Be.NOBR,D.NOBR],[Be.NOFRAMES,D.NOFRAMES],[Be.NOEMBED,D.NOEMBED],[Be.NOSCRIPT,D.NOSCRIPT],[Be.OBJECT,D.OBJECT],[Be.OL,D.OL],[Be.OPTGROUP,D.OPTGROUP],[Be.OPTION,D.OPTION],[Be.P,D.P],[Be.PARAM,D.PARAM],[Be.PLAINTEXT,D.PLAINTEXT],[Be.PRE,D.PRE],[Be.RB,D.RB],[Be.RP,D.RP],[Be.RT,D.RT],[Be.RTC,D.RTC],[Be.RUBY,D.RUBY],[Be.S,D.S],[Be.SCRIPT,D.SCRIPT],[Be.SEARCH,D.SEARCH],[Be.SECTION,D.SECTION],[Be.SELECT,D.SELECT],[Be.SOURCE,D.SOURCE],[Be.SMALL,D.SMALL],[Be.SPAN,D.SPAN],[Be.STRIKE,D.STRIKE],[Be.STRONG,D.STRONG],[Be.STYLE,D.STYLE],[Be.SUB,D.SUB],[Be.SUMMARY,D.SUMMARY],[Be.SUP,D.SUP],[Be.TABLE,D.TABLE],[Be.TBODY,D.TBODY],[Be.TEMPLATE,D.TEMPLATE],[Be.TEXTAREA,D.TEXTAREA],[Be.TFOOT,D.TFOOT],[Be.TD,D.TD],[Be.TH,D.TH],[Be.THEAD,D.THEAD],[Be.TITLE,D.TITLE],[Be.TR,D.TR],[Be.TRACK,D.TRACK],[Be.TT,D.TT],[Be.U,D.U],[Be.UL,D.UL],[Be.SVG,D.SVG],[Be.VAR,D.VAR],[Be.WBR,D.WBR],[Be.XMP,D.XMP]]);function Gx(e){var t;return(t=w0t.get(e))!==null&&t!==void 0?t:D.UNKNOWN}const xt=D,O0t={[yt.HTML]:new Set([xt.ADDRESS,xt.APPLET,xt.AREA,xt.ARTICLE,xt.ASIDE,xt.BASE,xt.BASEFONT,xt.BGSOUND,xt.BLOCKQUOTE,xt.BODY,xt.BR,xt.BUTTON,xt.CAPTION,xt.CENTER,xt.COL,xt.COLGROUP,xt.DD,xt.DETAILS,xt.DIR,xt.DIV,xt.DL,xt.DT,xt.EMBED,xt.FIELDSET,xt.FIGCAPTION,xt.FIGURE,xt.FOOTER,xt.FORM,xt.FRAME,xt.FRAMESET,xt.H1,xt.H2,xt.H3,xt.H4,xt.H5,xt.H6,xt.HEAD,xt.HEADER,xt.HGROUP,xt.HR,xt.HTML,xt.IFRAME,xt.IMG,xt.INPUT,xt.LI,xt.LINK,xt.LISTING,xt.MAIN,xt.MARQUEE,xt.MENU,xt.META,xt.NAV,xt.NOEMBED,xt.NOFRAMES,xt.NOSCRIPT,xt.OBJECT,xt.OL,xt.P,xt.PARAM,xt.PLAINTEXT,xt.PRE,xt.SCRIPT,xt.SECTION,xt.SELECT,xt.SOURCE,xt.STYLE,xt.SUMMARY,xt.TABLE,xt.TBODY,xt.TD,xt.TEMPLATE,xt.TEXTAREA,xt.TFOOT,xt.TH,xt.THEAD,xt.TITLE,xt.TR,xt.TRACK,xt.UL,xt.WBR,xt.XMP]),[yt.MATHML]:new Set([xt.MI,xt.MO,xt.MN,xt.MS,xt.MTEXT,xt.ANNOTATION_XML]),[yt.SVG]:new Set([xt.TITLE,xt.FOREIGN_OBJECT,xt.DESC]),[yt.XLINK]:new Set,[yt.XML]:new Set,[yt.XMLNS]:new Set},z6=new Set([xt.H1,xt.H2,xt.H3,xt.H4,xt.H5,xt.H6]);Be.STYLE,Be.SCRIPT,Be.XMP,Be.IFRAME,Be.NOEMBED,Be.NOFRAMES,Be.PLAINTEXT;var de;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(de||(de={}));const $s={DATA:de.DATA,RCDATA:de.RCDATA,RAWTEXT:de.RAWTEXT,SCRIPT_DATA:de.SCRIPT_DATA,PLAINTEXT:de.PLAINTEXT,CDATA_SECTION:de.CDATA_SECTION};function S0t(e){return e>=oe.DIGIT_0&&e<=oe.DIGIT_9}function $w(e){return e>=oe.LATIN_CAPITAL_A&&e<=oe.LATIN_CAPITAL_Z}function k0t(e){return e>=oe.LATIN_SMALL_A&&e<=oe.LATIN_SMALL_Z}function gp(e){return k0t(e)||$w(e)}function yY(e){return gp(e)||S0t(e)}function IT(e){return e+32}function nEe(e){return e===oe.SPACE||e===oe.LINE_FEED||e===oe.TABULATION||e===oe.FORM_FEED}function vY(e){return nEe(e)||e===oe.SOLIDUS||e===oe.GREATER_THAN_SIGN}function E0t(e){return e===oe.NULL?et.nullCharacterReference:e>1114111?et.characterReferenceOutsideUnicodeRange:Zke(e)?et.surrogateCharacterReference:eEe(e)?et.noncharacterCharacterReference:Jke(e)||e===oe.CARRIAGE_RETURN?et.controlCharacterReference:null}class C0t{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=de.DATA,this.returnState=de.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new d0t(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new v0t(f0t,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(et.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(et.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=E0t(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(et.endTagWithAttributes),t.selfClosing&&this._err(et.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case di.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case di.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case di.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:di.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=nEe(t)?di.WHITESPACE_CHARACTER:t===oe.NULL?di.NULL_CHARACTER:di.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(di.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=de.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Uf.Attribute:Uf.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===de.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case de.DATA:{this._stateData(t);break}case de.RCDATA:{this._stateRcdata(t);break}case de.RAWTEXT:{this._stateRawtext(t);break}case de.SCRIPT_DATA:{this._stateScriptData(t);break}case de.PLAINTEXT:{this._statePlaintext(t);break}case de.TAG_OPEN:{this._stateTagOpen(t);break}case de.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case de.TAG_NAME:{this._stateTagName(t);break}case de.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case de.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case de.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case de.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case de.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case de.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case de.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case de.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case de.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case de.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case de.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case de.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case de.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case de.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case de.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case de.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case de.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case de.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case de.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case de.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case de.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case de.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case de.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case de.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case de.BOGUS_COMMENT:{this._stateBogusComment(t);break}case de.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case de.COMMENT_START:{this._stateCommentStart(t);break}case de.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case de.COMMENT:{this._stateComment(t);break}case de.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case de.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case de.COMMENT_END:{this._stateCommentEnd(t);break}case de.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case de.DOCTYPE:{this._stateDoctype(t);break}case de.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case de.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case de.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case de.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case de.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case de.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case de.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case de.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case de.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case de.CDATA_SECTION:{this._stateCdataSection(t);break}case de.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case de.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case de.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case de.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.TAG_OPEN;break}case oe.AMPERSAND:{this._startCharacterReference();break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitCodePoint(t);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case oe.AMPERSAND:{this._startCharacterReference();break}case oe.LESS_THAN_SIGN:{this.state=de.RCDATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.RAWTEXT_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.SCRIPT_DATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case oe.NULL:{this._err(et.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gp(t))this._createStartTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.EXCLAMATION_MARK:{this.state=de.MARKUP_DECLARATION_OPEN;break}case oe.SOLIDUS:{this.state=de.END_TAG_OPEN;break}case oe.QUESTION_MARK:{this._err(et.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=de.BOGUS_COMMENT,this._stateBogusComment(t);break}case oe.EOF:{this._err(et.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(et.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=de.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gp(t))this._createEndTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.GREATER_THAN_SIGN:{this._err(et.missingEndTagName),this.state=de.DATA;break}case oe.EOF:{this._err(et.eofBeforeTagName),this._emitChars("");break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(et.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===oe.SOLIDUS?this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gp(t)?(this._emitChars("<"),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=de.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gp(t)?(this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case oe.NULL:{this._err(et.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(et.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===oe.SOLIDUS?(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(el.SCRIPT,!1)&&vY(this.preprocessor.peek(el.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==yt.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(j0t,yt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(N0t,yt.HTML)}clearBackToTableRowContext(){this.clearBackTo(_0t,yt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===D.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===D.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case yt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case yt.SVG:{if(OY.has(r))return!1;break}case yt.MATHML:{if(wY.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,gN)}hasInListItemScope(t){return this.hasInDynamicScope(t,T0t)}hasInButtonScope(t){return this.hasInDynamicScope(t,A0t)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case yt.HTML:{if(z6.has(n))return!0;if(gN.has(n))return!1;break}case yt.SVG:{if(OY.has(n))return!1;break}case yt.MATHML:{if(wY.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===yt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===yt.HTML)switch(this.tagIDs[t]){case D.TBODY:case D.THEAD:case D.TFOOT:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===yt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.OPTION:case D.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&iEe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&xY.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&xY.has(this.currentTagId);)this.pop()}}const $M=3;var md;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(md||(md={}));const SY={type:md.Marker};class P0t{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let s=0;for(let a=0;ar.get(c.name)===c.value)&&(s+=1,s>=$M&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(SY)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:md.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:md.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(SY);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===md.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===md.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===md.Element&&n.element===t)}}const bp={createDocument(){return{nodeName:"#document",mode:$c.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};bp.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(bp.isTextNode(n)){n.value+=t;return}}bp.appendChild(e,bp.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&bp.isTextNode(i)?i.value+=t:bp.insertBefore(e,bp.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function B0t(e){return e.name===rEe&&e.publicId===null&&(e.systemId===null||e.systemId===D0t)}function U0t(e){if(e.name!==rEe)return $c.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===M0t)return $c.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),$0t.has(n))return $c.QUIRKS;let i=t===null?L0t:sEe;if(kY(n,i))return $c.QUIRKS;if(i=t===null?aEe:F0t,kY(n,i))return $c.LIMITED_QUIRKS}return $c.NO_QUIRKS}const EY={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Q0t="definitionurl",z0t="definitionURL",V0t=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])),H0t=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:yt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:yt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:yt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:yt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:yt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:yt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:yt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:yt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:yt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:yt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:yt.XMLNS}]]),q0t=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])),W0t=new Set([D.B,D.BIG,D.BLOCKQUOTE,D.BODY,D.BR,D.CENTER,D.CODE,D.DD,D.DIV,D.DL,D.DT,D.EM,D.EMBED,D.H1,D.H2,D.H3,D.H4,D.H5,D.H6,D.HEAD,D.HR,D.I,D.IMG,D.LI,D.LISTING,D.MENU,D.META,D.NOBR,D.OL,D.P,D.PRE,D.RUBY,D.S,D.SMALL,D.SPAN,D.STRONG,D.STRIKE,D.SUB,D.SUP,D.TABLE,D.TT,D.U,D.UL,D.VAR]);function G0t(e){const t=e.tagID;return t===D.FONT&&e.attrs.some(({name:i})=>i===ab.COLOR||i===ab.SIZE||i===ab.FACE)||W0t.has(t)}function oEe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===yt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,yt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=me.TEXT}switchToPlaintextParsing(){this.insertionMode=me.TEXT,this.originalInsertionMode=me.IN_BODY,this.tokenizer.state=$s.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Be.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==yt.HTML))switch(this.fragmentContextID){case D.TITLE:case D.TEXTAREA:{this.tokenizer.state=$s.RCDATA;break}case D.STYLE:case D.XMP:case D.IFRAME:case D.NOEMBED:case D.NOFRAMES:case D.NOSCRIPT:{this.tokenizer.state=$s.RAWTEXT;break}case D.SCRIPT:{this.tokenizer.state=$s.SCRIPT_DATA;break}case D.PLAINTEXT:{this.tokenizer.state=$s.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,yt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,yt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Be.HTML,yt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,D.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,a=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===di.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===D.SVG&&this.treeAdapter.getTagName(n)===Be.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===yt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===D.MGLYPH||t.tagID===D.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,yt.HTML)}_processToken(t){switch(t.type){case di.CHARACTER:{this.onCharacter(t);break}case di.NULL_CHARACTER:{this.onNullCharacter(t);break}case di.COMMENT:{this.onComment(t);break}case di.DOCTYPE:{this.onDoctype(t);break}case di.START_TAG:{this._processStartTag(t);break}case di.END_TAG:{this.onEndTag(t);break}case di.EOF:{this.onEof(t);break}case di.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return Z0t(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===md.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=me.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(D.P),this.openElements.popUntilTagNamePopped(D.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case D.TR:{this.insertionMode=me.IN_ROW;return}case D.TBODY:case D.THEAD:case D.TFOOT:{this.insertionMode=me.IN_TABLE_BODY;return}case D.CAPTION:{this.insertionMode=me.IN_CAPTION;return}case D.COLGROUP:{this.insertionMode=me.IN_COLUMN_GROUP;return}case D.TABLE:{this.insertionMode=me.IN_TABLE;return}case D.BODY:{this.insertionMode=me.IN_BODY;return}case D.FRAMESET:{this.insertionMode=me.IN_FRAMESET;return}case D.SELECT:{this._resetInsertionModeForSelect(t);return}case D.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case D.HTML:{this.insertionMode=this.headElement?me.AFTER_HEAD:me.BEFORE_HEAD;return}case D.TD:case D.TH:{if(t>0){this.insertionMode=me.IN_CELL;return}break}case D.HEAD:{if(t>0){this.insertionMode=me.IN_HEAD;return}break}}this.insertionMode=me.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===D.TEMPLATE)break;if(i===D.TABLE){this.insertionMode=me.IN_SELECT_IN_TABLE;return}}this.insertionMode=me.IN_SELECT}_isElementCausesFosterParenting(t){return cEe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case D.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===yt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case D.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return O0t[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Rvt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:{dEe(this,t);break}case me.TEXT:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_TABLE_TEXT:{bEe(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){jvt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.TEXT:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){V6(this,t);return}switch(this.insertionMode){case me.INITIAL:case me.BEFORE_HTML:case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_TEMPLATE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{V6(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.AFTER_BODY:{cyt(this,t);break}case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{uyt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case me.INITIAL:{dyt(this,t);break}case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:{this._err(t,et.misplacedDoctype);break}case me.IN_TABLE_TEXT:{G1(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,et.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Ivt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{fyt(this,t);break}case me.BEFORE_HEAD:{pyt(this,t);break}case me.IN_HEAD:{Ku(this,t);break}case me.IN_HEAD_NO_SCRIPT:{byt(this,t);break}case me.AFTER_HEAD:{vyt(this,t);break}case me.IN_BODY:{So(this,t);break}case me.IN_TABLE:{ex(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{mvt(this,t);break}case me.IN_COLUMN_GROUP:{uU(this,t);break}case me.IN_TABLE_BODY:{nI(this,t);break}case me.IN_ROW:{iI(this,t);break}case me.IN_CELL:{yvt(this,t);break}case me.IN_SELECT:{xEe(this,t);break}case me.IN_SELECT_IN_TABLE:{xvt(this,t);break}case me.IN_TEMPLATE:{Ovt(this,t);break}case me.AFTER_BODY:{kvt(this,t);break}case me.IN_FRAMESET:{Evt(this,t);break}case me.AFTER_FRAMESET:{Tvt(this,t);break}case me.AFTER_AFTER_BODY:{_vt(this,t);break}case me.AFTER_AFTER_FRAMESET:{Nvt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Pvt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{hyt(this,t);break}case me.BEFORE_HEAD:{myt(this,t);break}case me.IN_HEAD:{gyt(this,t);break}case me.IN_HEAD_NO_SCRIPT:{yyt(this,t);break}case me.AFTER_HEAD:{xyt(this,t);break}case me.IN_BODY:{tI(this,t);break}case me.TEXT:{svt(this,t);break}case me.IN_TABLE:{VS(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{gvt(this,t);break}case me.IN_COLUMN_GROUP:{bvt(this,t);break}case me.IN_TABLE_BODY:{H6(this,t);break}case me.IN_ROW:{vEe(this,t);break}case me.IN_CELL:{vvt(this,t);break}case me.IN_SELECT:{wEe(this,t);break}case me.IN_SELECT_IN_TABLE:{wvt(this,t);break}case me.IN_TEMPLATE:{Svt(this,t);break}case me.AFTER_BODY:{SEe(this,t);break}case me.IN_FRAMESET:{Cvt(this,t);break}case me.AFTER_FRAMESET:{Avt(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onEof(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{mEe(this,t);break}case me.TEXT:{avt(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_TEMPLATE:{OEe(this,t);break}case me.AFTER_BODY:case me.IN_FRAMESET:case me.AFTER_FRAMESET:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{cU(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===oe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.TEXT:case me.IN_COLUMN_GROUP:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{this._insertCharacters(t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:case me.AFTER_BODY:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{uEe(this,t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{FM(this,t);break}case me.IN_TABLE_TEXT:{gEe(this,t);break}}}};function iyt(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):pEe(e,t),n}function ryt(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 syt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,a=r;a!==n;s++,a=r){r=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&s>=tyt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=ayt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function ayt(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 oyt(e,t,n){const i=e.treeAdapter.getTagName(t),r=Gx(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===D.TEMPLATE&&s===yt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function lyt(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 lU(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function dyt(e,t){e._setDocumentType(t);const n=t.forceQuirks?$c.QUIRKS:U0t(t);B0t(t)||e._err(t,et.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=me.BEFORE_HTML}function W1(e,t){e._err(t,et.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$c.QUIRKS),e.insertionMode=me.BEFORE_HTML,e._processToken(t)}function fyt(e,t){t.tagID===D.HTML?(e._insertElement(t,yt.HTML),e.insertionMode=me.BEFORE_HEAD):_O(e,t)}function hyt(e,t){const n=t.tagID;(n===D.HTML||n===D.HEAD||n===D.BODY||n===D.BR)&&_O(e,t)}function _O(e,t){e._insertFakeRootElement(),e.insertionMode=me.BEFORE_HEAD,e._processToken(t)}function pyt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.HEAD:{e._insertElement(t,yt.HTML),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD;break}default:NO(e,t)}}function myt(e,t){const n=t.tagID;n===D.HEAD||n===D.BODY||n===D.HTML||n===D.BR?NO(e,t):e._err(t,et.endTagWithoutMatchingOpenElement)}function NO(e,t){e._insertFakeElement(Be.HEAD,D.HEAD),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD,e._processToken(t)}function Ku(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:{e._appendElement(t,yt.HTML),t.ackSelfClosing=!0;break}case D.TITLE:{e._switchToTextParsing(t,$s.RCDATA);break}case D.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$s.RAWTEXT):(e._insertElement(t,yt.HTML),e.insertionMode=me.IN_HEAD_NO_SCRIPT);break}case D.NOFRAMES:case D.STYLE:{e._switchToTextParsing(t,$s.RAWTEXT);break}case D.SCRIPT:{e._switchToTextParsing(t,$s.SCRIPT_DATA);break}case D.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=me.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(me.IN_TEMPLATE);break}case D.HEAD:{e._err(t,et.misplacedStartTagForHeadElement);break}default:jO(e,t)}}function gyt(e,t){switch(t.tagID){case D.HEAD:{e.openElements.pop(),e.insertionMode=me.AFTER_HEAD;break}case D.BODY:case D.BR:case D.HTML:{jO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function r0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==D.TEMPLATE&&e._err(t,et.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,et.endTagWithoutMatchingOpenElement)}function jO(e,t){e.openElements.pop(),e.insertionMode=me.AFTER_HEAD,e._processToken(t)}function byt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BASEFONT:case D.BGSOUND:case D.HEAD:case D.LINK:case D.META:case D.NOFRAMES:case D.STYLE:{Ku(e,t);break}case D.NOSCRIPT:{e._err(t,et.nestedNoscriptInHead);break}default:RO(e,t)}}function yyt(e,t){switch(t.tagID){case D.NOSCRIPT:{e.openElements.pop(),e.insertionMode=me.IN_HEAD;break}case D.BR:{RO(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function RO(e,t){const n=t.type===di.EOF?et.openElementsLeftAfterEof:et.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=me.IN_HEAD,e._processToken(t)}function vyt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.BODY:{e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_BODY;break}case D.FRAMESET:{e._insertElement(t,yt.HTML),e.insertionMode=me.IN_FRAMESET;break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{e._err(t,et.abandonedHeadElementChild),e.openElements.push(e.headElement,D.HEAD),Ku(e,t),e.openElements.remove(e.headElement);break}case D.HEAD:{e._err(t,et.misplacedStartTagForHeadElement);break}default:IO(e,t)}}function xyt(e,t){switch(t.tagID){case D.BODY:case D.HTML:case D.BR:{IO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,et.endTagWithoutMatchingOpenElement)}}function IO(e,t){e._insertFakeElement(Be.BODY,D.BODY),e.insertionMode=me.IN_BODY,eI(e,t)}function eI(e,t){switch(t.type){case di.CHARACTER:{dEe(e,t);break}case di.WHITESPACE_CHARACTER:{uEe(e,t);break}case di.COMMENT:{V6(e,t);break}case di.START_TAG:{So(e,t);break}case di.END_TAG:{tI(e,t);break}case di.EOF:{mEe(e,t);break}}}function uEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function dEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function wyt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Oyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Syt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_FRAMESET)}function kyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML)}function Eyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&z6.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,yt.HTML)}function Cyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Tyt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),n||(e.formElement=e.openElements.current))}function Ayt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===D.LI&&r===D.LI||(n===D.DD||n===D.DT)&&(r===D.DD||r===D.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==D.ADDRESS&&r!==D.DIV&&r!==D.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML)}function _yt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.tokenizer.state=$s.PLAINTEXT}function Nyt(e,t){e.openElements.hasInScope(D.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(D.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.framesetOk=!1}function jyt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Be.A);n&&(lU(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ryt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Iyt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(D.NOBR)&&(lU(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,yt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Pyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Dyt(e,t){e.treeAdapter.getDocumentMode(e.document)!==$c.QUIRKS&&e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_TABLE}function fEe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,yt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function hEe(e){const t=tEe(e,ab.TYPE);return t!=null&&t.toLowerCase()===J0t}function Myt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,yt.HTML),hEe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Lyt(e,t){e._appendElement(t,yt.HTML),t.ackSelfClosing=!0}function $yt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._appendElement(t,yt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Fyt(e,t){t.tagName=Be.IMG,t.tagID=D.IMG,fEe(e,t)}function Byt(e,t){e._insertElement(t,yt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$s.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=me.TEXT}function Uyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function Qyt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function AY(e,t){e._switchToTextParsing(t,$s.RAWTEXT)}function zyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===me.IN_TABLE||e.insertionMode===me.IN_CAPTION||e.insertionMode===me.IN_TABLE_BODY||e.insertionMode===me.IN_ROW||e.insertionMode===me.IN_CELL?me.IN_SELECT_IN_TABLE:me.IN_SELECT}function Vyt(e,t){e.openElements.currentTagId===D.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML)}function Hyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,yt.HTML)}function qyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(D.RTC),e._insertElement(t,yt.HTML)}function Wyt(e,t){e._reconstructActiveFormattingElements(),oEe(t),oU(t),t.selfClosing?e._appendElement(t,yt.MATHML):e._insertElement(t,yt.MATHML),t.ackSelfClosing=!0}function Gyt(e,t){e._reconstructActiveFormattingElements(),lEe(t),oU(t),t.selfClosing?e._appendElement(t,yt.SVG):e._insertElement(t,yt.SVG),t.ackSelfClosing=!0}function _Y(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,yt.HTML)}function So(e,t){switch(t.tagID){case D.I:case D.S:case D.B:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.SMALL:case D.STRIKE:case D.STRONG:{Ryt(e,t);break}case D.A:{jyt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{Eyt(e,t);break}case D.P:case D.DL:case D.OL:case D.UL:case D.DIV:case D.DIR:case D.NAV:case D.MAIN:case D.MENU:case D.ASIDE:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.DETAILS:case D.ADDRESS:case D.ARTICLE:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{kyt(e,t);break}case D.LI:case D.DD:case D.DT:{Ayt(e,t);break}case D.BR:case D.IMG:case D.WBR:case D.AREA:case D.EMBED:case D.KEYGEN:{fEe(e,t);break}case D.HR:{$yt(e,t);break}case D.RB:case D.RTC:{Hyt(e,t);break}case D.RT:case D.RP:{qyt(e,t);break}case D.PRE:case D.LISTING:{Cyt(e,t);break}case D.XMP:{Uyt(e,t);break}case D.SVG:{Gyt(e,t);break}case D.HTML:{wyt(e,t);break}case D.BASE:case D.LINK:case D.META:case D.STYLE:case D.TITLE:case D.SCRIPT:case D.BGSOUND:case D.BASEFONT:case D.TEMPLATE:{Ku(e,t);break}case D.BODY:{Oyt(e,t);break}case D.FORM:{Tyt(e,t);break}case D.NOBR:{Iyt(e,t);break}case D.MATH:{Wyt(e,t);break}case D.TABLE:{Dyt(e,t);break}case D.INPUT:{Myt(e,t);break}case D.PARAM:case D.TRACK:case D.SOURCE:{Lyt(e,t);break}case D.IMAGE:{Fyt(e,t);break}case D.BUTTON:{Nyt(e,t);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{Pyt(e,t);break}case D.IFRAME:{Qyt(e,t);break}case D.SELECT:{zyt(e,t);break}case D.OPTION:case D.OPTGROUP:{Vyt(e,t);break}case D.NOEMBED:case D.NOFRAMES:{AY(e,t);break}case D.FRAMESET:{Syt(e,t);break}case D.TEXTAREA:{Byt(e,t);break}case D.NOSCRIPT:{e.options.scriptingEnabled?AY(e,t):_Y(e,t);break}case D.PLAINTEXT:{_yt(e,t);break}case D.COL:case D.TH:case D.TD:case D.TR:case D.HEAD:case D.FRAME:case D.TBODY:case D.TFOOT:case D.THEAD:case D.CAPTION:case D.COLGROUP:break;default:_Y(e,t)}}function Kyt(e,t){if(e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Xyt(e,t){e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,SEe(e,t))}function Yyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Zyt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(D.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(D.FORM):n&&e.openElements.remove(n))}function Jyt(e){e.openElements.hasInButtonScope(D.P)||e._insertFakeElement(Be.P,D.P),e._closePElement()}function evt(e){e.openElements.hasInListItemScope(D.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(D.LI),e.openElements.popUntilTagNamePopped(D.LI))}function tvt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function nvt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function ivt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function rvt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Be.BR,D.BR),e.openElements.pop(),e.framesetOk=!1}function pEe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],a=e.openElements.tagIDs[r];if(i===a&&(i!==D.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,a))break}}function tI(e,t){switch(t.tagID){case D.A:case D.B:case D.I:case D.S:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.NOBR:case D.SMALL:case D.STRIKE:case D.STRONG:{lU(e,t);break}case D.P:{Jyt(e);break}case D.DL:case D.UL:case D.OL:case D.DIR:case D.DIV:case D.NAV:case D.PRE:case D.MAIN:case D.MENU:case D.ASIDE:case D.BUTTON:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.ADDRESS:case D.ARTICLE:case D.DETAILS:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.LISTING:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Yyt(e,t);break}case D.LI:{evt(e);break}case D.DD:case D.DT:{tvt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{nvt(e);break}case D.BR:{rvt(e);break}case D.BODY:{Kyt(e,t);break}case D.HTML:{Xyt(e,t);break}case D.FORM:{Zyt(e);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{ivt(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:pEe(e,t)}}function mEe(e,t){e.tmplInsertionModeStack.length>0?OEe(e,t):cU(e,t)}function svt(e,t){var n;t.tagID===D.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function avt(e,t){e._err(t,et.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function FM(e,t){if(e.openElements.currentTagId!==void 0&&cEe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=me.IN_TABLE_TEXT,t.type){case di.CHARACTER:{bEe(e,t);break}case di.WHITESPACE_CHARACTER:{gEe(e,t);break}}else wE(e,t)}function ovt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_CAPTION}function lvt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_COLUMN_GROUP}function cvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.COLGROUP,D.COLGROUP),e.insertionMode=me.IN_COLUMN_GROUP,uU(e,t)}function uvt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,yt.HTML),e.insertionMode=me.IN_TABLE_BODY}function dvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.TBODY,D.TBODY),e.insertionMode=me.IN_TABLE_BODY,nI(e,t)}function fvt(e,t){e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function hvt(e,t){hEe(t)?e._appendElement(t,yt.HTML):wE(e,t),t.ackSelfClosing=!0}function pvt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,yt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ex(e,t){switch(t.tagID){case D.TD:case D.TH:case D.TR:{dvt(e,t);break}case D.STYLE:case D.SCRIPT:case D.TEMPLATE:{Ku(e,t);break}case D.COL:{cvt(e,t);break}case D.FORM:{pvt(e,t);break}case D.TABLE:{fvt(e,t);break}case D.TBODY:case D.TFOOT:case D.THEAD:{uvt(e,t);break}case D.INPUT:{hvt(e,t);break}case D.CAPTION:{ovt(e,t);break}case D.COLGROUP:{lvt(e,t);break}default:wE(e,t)}}function VS(e,t){switch(t.tagID){case D.TABLE:{e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}case D.BODY:case D.CAPTION:case D.COL:case D.COLGROUP:case D.HTML:case D.TBODY:case D.TD:case D.TFOOT:case D.TH:case D.THEAD:case D.TR:break;default:wE(e,t)}}function wE(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eI(e,t),e.fosterParentingEnabled=n}function gEe(e,t){e.pendingCharacterTokens.push(t)}function bEe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function G1(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===D.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===D.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===D.OPTGROUP&&e.openElements.pop();break}case D.OPTION:{e.openElements.currentTagId===D.OPTION&&e.openElements.pop();break}case D.SELECT:{e.openElements.hasInSelectScope(D.SELECT)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}}}function xvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e._processStartTag(t)):xEe(e,t)}function wvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e.onEndTag(t)):wEe(e,t)}function Ovt(e,t){switch(t.tagID){case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{Ku(e,t);break}case D.CAPTION:case D.COLGROUP:case D.TBODY:case D.TFOOT:case D.THEAD:{e.tmplInsertionModeStack[0]=me.IN_TABLE,e.insertionMode=me.IN_TABLE,ex(e,t);break}case D.COL:{e.tmplInsertionModeStack[0]=me.IN_COLUMN_GROUP,e.insertionMode=me.IN_COLUMN_GROUP,uU(e,t);break}case D.TR:{e.tmplInsertionModeStack[0]=me.IN_TABLE_BODY,e.insertionMode=me.IN_TABLE_BODY,nI(e,t);break}case D.TD:case D.TH:{e.tmplInsertionModeStack[0]=me.IN_ROW,e.insertionMode=me.IN_ROW,iI(e,t);break}default:e.tmplInsertionModeStack[0]=me.IN_BODY,e.insertionMode=me.IN_BODY,So(e,t)}}function Svt(e,t){t.tagID===D.TEMPLATE&&r0(e,t)}function OEe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):cU(e,t)}function kvt(e,t){t.tagID===D.HTML?So(e,t):yN(e,t)}function SEe(e,t){var n;if(t.tagID===D.HTML){if(e.fragmentContext||(e.insertionMode=me.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===D.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else yN(e,t)}function yN(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function Evt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.FRAMESET:{e._insertElement(t,yt.HTML);break}case D.FRAME:{e._appendElement(t,yt.HTML),t.ackSelfClosing=!0;break}case D.NOFRAMES:{Ku(e,t);break}}}function Cvt(e,t){t.tagID===D.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==D.FRAMESET&&(e.insertionMode=me.AFTER_FRAMESET))}function Tvt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function Avt(e,t){t.tagID===D.HTML&&(e.insertionMode=me.AFTER_AFTER_FRAMESET)}function _vt(e,t){t.tagID===D.HTML?So(e,t):wA(e,t)}function wA(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function Nvt(e,t){switch(t.tagID){case D.HTML:{So(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function jvt(e,t){t.chars=Zr,e._insertCharacters(t)}function Rvt(e,t){e._insertCharacters(t),e.framesetOk=!1}function kEe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==yt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Ivt(e,t){if(G0t(t))kEe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===yt.MATHML?oEe(t):i===yt.SVG&&(K0t(t),lEe(t)),oU(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function Pvt(e,t){if(t.tagID===D.P||t.tagID===D.BR){kEe(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)===yt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Be.AREA,Be.BASE,Be.BASEFONT,Be.BGSOUND,Be.BR,Be.COL,Be.EMBED,Be.FRAME,Be.HR,Be.IMG,Be.INPUT,Be.KEYGEN,Be.LINK,Be.META,Be.PARAM,Be.SOURCE,Be.TRACK,Be.WBR;const Dvt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Mvt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),NY={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function EEe(e,t){const n=qvt(e),i=USe("type",{handlers:{root:Lvt,element:$vt,text:Fvt,comment:TEe,doctype:Bvt,raw:Qvt},unknown:zvt}),r={parser:n?new TY(NY):TY.getFragmentParser(void 0,NY),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),Kx(r,Yd());const s=n?r.parser.document:r.parser.getFragment(),a=Wbt(s,{file:r.options.file});return r.stitches&&vE(a,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function CEe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:di.CHARACTER,chars:e.value,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Bvt(e,t){const n={type:di.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Uvt(e,t){t.stitches=!0;const n=Wvt(e);if("children"in e&&"children"in n){const i=EEe({type:"root",children:e.children},t.options);n.children=i.children}TEe({type:"comment",value:{stitch:n}},t)}function TEe(e,t){const n=e.value,i={type:di.COMMENT,data:n,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function Qvt(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,AEe(t,Yd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Dvt,"<$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 zvt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Uvt(n,t);else{let i="";throw Mvt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function Kx(e,t){AEe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$s.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function AEe(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 Vvt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,Yd(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:$g.html;r===$g.html&&n==="svg"&&(r=$g.svg);const s=Zbt({...e,children:[]},{space:r===$g.svg?"svg":"html"}),a={type:di.START_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:OE(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Hvt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&a0t.includes(n)||t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,GR(e));const i={type:di.END_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:OE(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$s.RCDATA||t.parser.tokenizer.state===$s.RAWTEXT||t.parser.tokenizer.state===$s.SCRIPT_DATA)&&(t.parser.tokenizer.state=$s.DATA)}function qvt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function OE(e){const t=Yd(e)||{line:void 0,column:void 0,offset:void 0},n=GR(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Wvt(e){return"children"in e?Zv({...e,children:[]}):Zv(e)}function Gvt(e){return function(t,n){return EEe(t,{...e,file:n})}}const Kvt="modulepreload",Xvt=function(e){return"/"+e},jY={},Md=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Xvt(c),c in jY)return;jY[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":Kvt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Yvt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Zvt=/[\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]/,Jvt=/[\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]/,BM={Space_Separator:Yvt,ID_Start:Zvt,ID_Continue:Jvt},Is={isSpaceSeparator(e){return typeof e=="string"&&BM.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||BM.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==="‍"||BM.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 q6,Lo,Qf,vN,Om,Mu,Aa,dU,PO;var ext=function(t,n){q6=String(t),Lo="start",Qf=[],vN=0,Om=1,Mu=0,Aa=void 0,dU=void 0,PO=void 0;do Aa=txt(),rxt[Lo]();while(Aa.type!=="eof");return typeof n=="function"?W6({"":PO},"",n):PO};function W6(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=lh();if(!Is.isHexDigit(n))throw Vr(pt());e+=pt()}return String.fromCodePoint(parseInt(e,16))}const ixt={start(){if(Aa.type==="eof")throw sg();UM()},beforePropertyName(){switch(Aa.type){case"identifier":case"string":dU=Aa.value,Lo="afterPropertyName";return;case"punctuator":PT();return;case"eof":throw sg()}},afterPropertyName(){if(Aa.type==="eof")throw sg();Lo="beforePropertyValue"},beforePropertyValue(){if(Aa.type==="eof")throw sg();UM()},beforeArrayValue(){if(Aa.type==="eof")throw sg();if(Aa.type==="punctuator"&&Aa.value==="]"){PT();return}UM()},afterPropertyValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Lo="beforePropertyName";return;case"}":PT()}},afterArrayValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Lo="beforeArrayValue";return;case"]":PT()}},end(){}};function UM(){let e;switch(Aa.type){case"punctuator":switch(Aa.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Aa.value;break}if(PO===void 0)PO=e;else{const t=Qf[Qf.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,dU,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Qf.push(e),Array.isArray(e)?Lo="beforeArrayValue":Lo="beforePropertyName";else{const t=Qf[Qf.length-1];t==null?Lo="end":Array.isArray(t)?Lo="afterArrayValue":Lo="afterPropertyValue"}}function PT(){Qf.pop();const e=Qf[Qf.length-1];e==null?Lo="end":Array.isArray(e)?Lo="afterArrayValue":Lo="afterPropertyValue"}function Vr(e){return xN(e===void 0?`JSON5: invalid end of input at ${Om}:${Mu}`:`JSON5: invalid character '${_Ee(e)}' at ${Om}:${Mu}`)}function sg(){return xN(`JSON5: invalid end of input at ${Om}:${Mu}`)}function RY(){return Mu-=5,xN(`JSON5: invalid identifier character at ${Om}:${Mu}`)}function rxt(e){console.warn(`JSON5: '${_Ee(e)}' in strings is not valid ECMAScript; consider escaping`)}function _Ee(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function xN(e){const t=new SyntaxError(e);return t.lineNumber=Om,t.columnNumber=Mu,t}var sxt=function(t,n,i){const r=[];let s="",a,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){a=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&a.indexOf(v)<0&&a.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let x="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),x=[];for(const w of y){const k=d(w,b);if(k!==void 0){let S=m(w)+":";c!==""&&(S+=" "),S+=k,x.push(S)}}let O;if(x.length===0)O="{}";else{let w;if(c==="")w=x.join(","),O="{"+w+"}";else{let k=`, +`&&pt(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Vr(pt());case void 0:throw Vr(pt())}return pt()}function ixt(){let e="",t=lh();if(!Is.isHexDigit(t)||(e+=pt(),t=lh(),!Is.isHexDigit(t)))throw Vr(pt());return e+=pt(),String.fromCodePoint(parseInt(e,16))}function G6(){let e="",t=4;for(;t-- >0;){const n=lh();if(!Is.isHexDigit(n))throw Vr(pt());e+=pt()}return String.fromCodePoint(parseInt(e,16))}const rxt={start(){if(Aa.type==="eof")throw sg();UM()},beforePropertyName(){switch(Aa.type){case"identifier":case"string":dU=Aa.value,Lo="afterPropertyName";return;case"punctuator":PT();return;case"eof":throw sg()}},afterPropertyName(){if(Aa.type==="eof")throw sg();Lo="beforePropertyValue"},beforePropertyValue(){if(Aa.type==="eof")throw sg();UM()},beforeArrayValue(){if(Aa.type==="eof")throw sg();if(Aa.type==="punctuator"&&Aa.value==="]"){PT();return}UM()},afterPropertyValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Lo="beforePropertyName";return;case"}":PT()}},afterArrayValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Lo="beforeArrayValue";return;case"]":PT()}},end(){}};function UM(){let e;switch(Aa.type){case"punctuator":switch(Aa.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Aa.value;break}if(PO===void 0)PO=e;else{const t=Qf[Qf.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,dU,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Qf.push(e),Array.isArray(e)?Lo="beforeArrayValue":Lo="beforePropertyName";else{const t=Qf[Qf.length-1];t==null?Lo="end":Array.isArray(t)?Lo="afterArrayValue":Lo="afterPropertyValue"}}function PT(){Qf.pop();const e=Qf[Qf.length-1];e==null?Lo="end":Array.isArray(e)?Lo="afterArrayValue":Lo="afterPropertyValue"}function Vr(e){return xN(e===void 0?`JSON5: invalid end of input at ${Om}:${Mu}`:`JSON5: invalid character '${NEe(e)}' at ${Om}:${Mu}`)}function sg(){return xN(`JSON5: invalid end of input at ${Om}:${Mu}`)}function RY(){return Mu-=5,xN(`JSON5: invalid identifier character at ${Om}:${Mu}`)}function sxt(e){console.warn(`JSON5: '${NEe(e)}' in strings is not valid ECMAScript; consider escaping`)}function NEe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function xN(e){const t=new SyntaxError(e);return t.lineNumber=Om,t.columnNumber=Mu,t}var axt=function(t,n,i){const r=[];let s="",a,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){a=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&a.indexOf(v)<0&&a.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let x="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),x=[];for(const w of y){const k=d(w,b);if(k!==void 0){let S=m(w)+":";c!==""&&(S+=" "),S+=k,x.push(S)}}let O;if(x.length===0)O="{}";else{let w;if(c==="")w=x.join(","),O="{"+w+"}";else{let k=`, `+s;w=x.join(k),O=`{ `+s+w+`, `+v+"}"}}return r.pop(),s=v,O}function m(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!Is.isIdStartChar(v))return f(b);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let O=0;O30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&cxt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)wN(n,t+1);return}if(Bw(e))for(const[n,i]of Object.entries(e)){if(lxt.has(n))throw new Error("ECharts option contains an unsafe key");wN(i,t+1)}}function uxt(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 dxt(e,t){let n=1,i="",r=!1,s=!1,a=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(fxt),s=n[i],a=n[i+1]??!1;if(!Array.isArray(s)||typeof a!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:a}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:a}}function pxt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;loxt)throw new Error("ECharts option is too large");const n=mxt(uxt(e));let i;try{i=NEe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let QM;function bxt(){return QM??(QM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw QM=void 0,e})),QM}function yxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=gxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return bxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const vxt=p.memo(yxt);let IY,PY=Promise.resolve(),xxt=0;function wxt(){return IY??(IY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DIFRJAlh.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))),IY}function Oxt(e){const t=PY.then(async()=>{const n=await wxt(),i=`mermaid-diagram-${xxt+=1}`;return n.render(i,e)});return PY=t.then(()=>{},()=>{}),t}function Sxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),Oxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const kxt=p.memo(Sxt),Ext="_SegmentedControl_1sl7d_1",Cxt="_SegmentedControlOption_1sl7d_140",Txt="_SegmentedControlThumb_1sl7d_219",K6={SegmentedControl:Ext,SegmentedControlOption:Cxt,SegmentedControlThumb:Txt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);Eye({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||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(EWe,{ref:d,className:pi(K6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:K6.SegmentedControlThumb,ref:f}),n]})},Axt=({children:e,...t})=>o.jsx(NWe,{className:K6.SegmentedControlOption,...t,onPointerEnter:l7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=Axt;function _xt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[a,l]=p.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const Nxt=p.memo(_xt);function jxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const jEe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function X6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(X6).join(""):p.isValidElement(e)?X6(e.props.children):""}function Rxt(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 jxt(n==null?void 0:n.slice(9))}function REe(e){if(!e)return!1;try{const t=e.toLowerCase();return jEe.some(n=>t.includes(n))}catch{return!1}}function Ixt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(REe(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 jEe.some(s=>r.includes(s))}return!1}function Pxt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),[s,a]=p.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},m=h({children:f});if(m)return m}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Zft,{remarkPlugins:[dmt],rehypePlugins:n?[Wvt,hY]:[hY],components:{pre:({node:d,children:f,...h})=>{const m=Rxt(f);if(m==="mermaid"||m==="echarts"){const g=X6(f).replace(/\n$/,"");return o.jsx(Nxt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(kxt,{source:g}):o.jsx(vxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(REe(h)||Ixt(d))){const m=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(gbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=p.memo(Pxt);function zM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function IEe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Dxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Mxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function Lxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function $xt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx(Lxt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function Y6(e){return e instanceof DOMException&&e.name==="AbortError"}function Fxt(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 PEe=[".jpg",".jpeg",".png"].join(","),Bxt=new Set(PEe.split(",")),DEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Uxt=new Set(DEe.split(",")),Qxt=200*1024*1024;function Z6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function zxt(e,t,n){return e.size>Qxt?n("knowledge.errors.fileTooLarge"):t==="image"?Bxt.has(Z6(e.name))?"":n("knowledge.errors.invalidImageType"):Uxt.has(Z6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function fU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function J6(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 Vxt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await flt(x))}catch(O){m(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function Hxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await hlt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function MEe(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 qxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState("{}"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(null),N=p.useRef(null),_=p.useRef(null),j=p.useRef(null),A=p.useRef(0),F=!!O;p.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=zxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Z6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!m)return;let U;try{U=MEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await blt(e.id,e.region,I),n()}else{const I=await ylt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else m&&(await vlt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===KOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(K+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(xn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?PEe:DEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:fU(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(xn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!m),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function Wxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=MEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await xlt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const LEe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),$Ee=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),FEe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Gxt=new Set(["pdf"]),Kxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Xxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Yxt=new Set(["error","failed","unavailable"]);function DY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Zxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(DY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=DY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function BEe(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 Jxt(e){const t=BEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function e1t(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 LEe.has(i)?"image":$Ee.has(i)?"audio":FEe.has(i)?"video":Gxt.has(i)?"pdf":t||i?"file":"none"}function t1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Xxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Yxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=J6(e).toLocaleLowerCase();return i==="pdf"||Kxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:LEe.has(i)||$Ee.has(i)||FEe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function n1t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=BEe(e.attachmentUrl),s=e1t(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function i1t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(0),O=p.useRef(null),w=p.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?m(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await glt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!Y6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=Jxt(a.url||t.url),S=t1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:fU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Zxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(n1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function r1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,x]=p.useState("overview"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(!0),[N,_]=p.useState(!1),[j,A]=p.useState(""),[F,T]=p.useState([]),[P,R]=p.useState(!1),[L,M]=p.useState(""),[U,I]=p.useState(""),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(!1),[le,se]=p.useState(!1),[re,ge]=p.useState(null),[W,X]=p.useState(null),[ae,ue]=p.useState(null),[Oe,ke]=p.useState(null),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),qe=p.useRef(0),Ae=p.useRef(0),ze=p.useRef([]),Ee=p.useRef(!1),De=p.useRef(!1),J=p.useRef(null),he=p.useRef(null),_e=p.useRef({}),Ze=p.useRef(!1),at=p.useRef(null),wt=p.useRef(null),Se=p.useRef(null),ve=p.useRef(null),He=p.useMemo(()=>[t],[t]),Je=p.useCallback(ye=>`${ye.region}\0${ye.id}`,[]),Ce=u.find(ye=>Je(ye)===b)??null,Wt=!!(Ce&&H===Je(Ce));p.useEffect(()=>{r==null||r(!!Ce)},[r,Ce]),p.useEffect(()=>{x("overview"),S("")},[b]);const ln=p.useMemo(()=>{const ye=O.trim().toLocaleLowerCase();return ye?u.filter(Ue=>[Ue.name,Ue.description,Ue.ownerLabel,Ue.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):u},[u,O]),cn=p.useMemo(()=>{const ye=k.trim().toLocaleLowerCase();return ye?F.filter(Ue=>[Ue.name,Ue.id,J6(Ue)].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):F},[k,F]);p.useEffect(()=>{X(null)},[Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Ot=p.useCallback(async(ye=!1)=>{var ft;if(ye&&(Ze.current||Object.keys(_e.current).length===0))return;(ft=J.current)==null||ft.abort();const Ue=new AbortController;J.current=Ue;const Ke=qe.current+1;qe.current=Ke,Ze.current=!0,ye?_(!0):C(!0),A(""),ye||g([]);try{const ut=await dlt({regions:He,nextTokens:ye?_e.current:void 0,signal:Ue.signal});if(qe.current!==Ke)return;d(Rt=>ye?[...Rt,...ut.items.filter(zt=>!Rt.some(Z=>Je(Z)===Je(zt)))]:ut.items),_e.current=ut.nextTokens,h(ut.nextTokens);const Gt=ut.failures.map(({region:Rt,error:zt})=>`${xh(Rt,e)}: ${ho(zt,l("common.loadFailed"))}`);g(Rt=>ye?[...new Set([...Rt,...Gt])]:Gt),ye||v(Rt=>ut.items.some(zt=>Je(zt)===Rt)?Rt:"")}catch(ut){if(Y6(ut))return;qe.current===Ke&&(ye?g(Gt=>[...new Set([...Gt,ho(ut,l("knowledge.errors.loadMoreBases"))])]):A(ho(ut,l("knowledge.errors.loadBases"))))}finally{qe.current===Ke&&(Ze.current=!1,C(!1),_(!1))}},[Je,e,He,l]),jt=p.useCallback(async(ye,Ue=!1)=>{var ut;if(Ue&&Ee.current)return;(ut=he.current)==null||ut.abort();const Ke=new AbortController;he.current=Ke;const ft=Ae.current+1;Ae.current=ft,Ue||(ze.current=[],De.current=!1,T([]),q(!1),I("")),Ee.current=!0,R(!0),Ue?I(""):M("");try{const Gt=await mlt(ye.id,{region:ye.region,offset:Ue?ze.current.length:0,signal:Ke.signal});if(Ae.current!==ft)return;K(Bt=>Bt===Je(ye)?"":Bt);const Rt=ze.current,zt=Ue?[...Rt,...Gt.items.filter(Bt=>!Bt.id||!Rt.some(Qe=>Qe.id===Bt.id))]:Gt.items,Z=Gt.hasMore&&(!Ue||zt.length>Rt.length);ze.current=zt,De.current=Z,T(zt),q(Z)}catch(Gt){if(Y6(Gt))return;Ae.current===ft&&(Gt instanceof HR&&Gt.errorCode===KOe&&(K(Je(ye)),ge(zt=>zt&&Je(zt)===Je(ye)?null:zt)),Ue?I(ho(Gt,l("knowledge.errors.loadMoreData"))):M(ho(Gt,l("knowledge.errors.loadData"))))}finally{Ae.current===ft&&(Ee.current=!1,R(!1))}},[Je,l]);p.useEffect(()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1,_e.current={},d([]),h({}),g([]),v(""),K(""),A(""),C(!0)},[e]),p.useEffect(()=>{if(n)return Ot(),()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1}},[n,i,Ot]),p.useEffect(()=>{var ye,Ue;if(!n){(ye=he.current)==null||ye.abort(),Ae.current+=1,Ee.current=!1;return}if(!Ce){(Ue=he.current)==null||Ue.abort(),Ae.current+=1,ze.current=[],Ee.current=!1,De.current=!1,T([]),q(!1),I("");return}return jt(Ce),()=>{var Ke;(Ke=he.current)==null||Ke.abort(),Ae.current+=1,Ee.current=!1}},[n,i,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const ot=n&&!Ce&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;p.useEffect(()=>{const ye=wt.current,Ue=at.current;if(!ye||!Ue||!ot)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ot(!0)},{root:Ue,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[ot,Ot]);const gt=()=>{const ye=at.current;!ye||!ot||ye.scrollHeight-ye.scrollTop-ye.clientHeight<=240&&Ot(!0)},Pe=!!(Ce&&F.length>0&&Q&&!P&&!U);p.useEffect(()=>{const ye=ve.current,Ue=Se.current;if(!Ce||!ye||!Ue||!Pe)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&jt(Ce,!0)},{root:Se.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[Pe,jt,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Et=()=>{const ye=Se.current;if(!Ce||!ye||!De.current||Ee.current||U)return;const{scrollHeight:Ue,scrollTop:Ke,clientHeight:ft}=ye;Ue-Ke-ft<=240&&jt(Ce,!0)},bt=ye=>{d(Ue=>Ue.map(Ke=>Je(Ke)===Je(ye)?ye:Ke))},Mt=async()=>{if(Oe){Ie(!0);try{await plt(Oe.id,Oe.region),d(ye=>ye.filter(Ue=>Je(Ue)!==Je(Oe))),K(ye=>ye===Je(Oe)?"":ye),b===Je(Oe)&&v(""),ke(null)}catch(ye){A(ho(ye,l("knowledge.errors.deleteBase"))),ke(null)}finally{Ie(!1)}}},$e=async()=>{if(!(!Ce||!st)){Ie(!0);try{await wlt(Ce.id,st.id,Ce.region);const ye=ze.current.filter(Ue=>Ue.id!==st.id);ze.current=ye,T(ye),Le(null)}catch(ye){M(ho(ye,l("knowledge.errors.deleteDocument"))),Le(null)}finally{Ie(!1)}}};return o.jsxs("section",{className:`knowledge-library${Ce?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ce?o.jsx(uE,{className:"knowledge-library__detail",title:Ce.name,description:Ce.description||l("common.noDescription"),identitySeed:Ce.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(jB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:Ce.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ce.providerKnowledgeId,children:Ce.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:Ce.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:zM(Ce.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:Fxt(Ce.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Wt&&Ce.canManage?o.jsx("button",{type:"button",onClick:()=>ke(Ce),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void jt(Ce),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Mxt,{}),o.jsx("p",{children:l("knowledge.noData")}),Ce.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(Ce),children:l("knowledge.addFirstData")})]}):o.jsx(jot,{rows:cn,rowKey:ye=>ye.id,rowLabel:ye=>ye.name||ye.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:ye=>o.jsx("span",{title:ye.name||ye.id,children:ye.name||ye.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:ye=>J6(ye)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:ye=>fU(ye.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ce.canManage?{label:l(Wt?"knowledge.associationInvalid":"knowledge.addData"),disabled:Wt,title:Wt?l("knowledge.providerMissing"):void 0,onClick:()=>ge(Ce)}:void 0,rowActions:ye=>[{label:l("common.preview"),onSelect:()=>X(ye)},...Ce.canManage?[{label:l("common.edit"),onSelect:()=>ue(ye)},{label:l("common.delete"),onSelect:()=>Le(ye),danger:!0}]:[]],scrollRef:Se,onScroll:Et,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void jt(Ce,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ve,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:Ce.canManage?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>ke(Ce),children:l("common.delete")}),o.jsx(Ht,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:ye=>w(ye.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:at,"aria-live":"polite",onScroll:gt,children:[m.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}):ln.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Dxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx($xt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),ln.map(ye=>o.jsx(pE,{className:"knowledge-card",title:ye.name,description:ye.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:zM(ye.ownerLabel),title:zM(ye.ownerLabel)},{label:l("knowledge.project"),value:ye.projectName||"default",title:ye.projectName||"default"}],action:{label:H===Je(ye)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!ye.canManage||H===Je(ye),title:ye.canManage?H===Je(ye)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(ye)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Je(ye))}},Je(ye)))]}),ot||N?o.jsx("div",{ref:wt,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ot?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(Vxt,{region:t,onClose:()=>ee(!1),onCreated:ye=>{d(Ue=>[ye,...Ue]),v(Je(ye)),ee(!1)}}),Ce&&le&&o.jsx(Hxt,{item:Ce,onClose:()=>se(!1),onUpdated:ye=>{bt(ye),se(!1)}}),Ce&&W&&o.jsx(i1t,{base:Ce,item:W,onClose:()=>X(null)}),re&&o.jsx(qxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:ye=>{K(Je(re)),Ce&&Je(Ce)===Je(re)&&M(ho(ye,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{Ce&&Je(Ce)===Je(re)&&jt(Ce),ge(null)}}),Ce&&ae&&o.jsx(Wxt,{base:Ce,item:ae,onClose:()=>ue(null),onUpdated:ye=>{const Ue=ze.current.map(Ke=>Ke.id===ye.id?ye:Ke);ze.current=Ue,T(Ue),ue(null)}}),Oe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:Oe.name}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>ke(null),onConfirm:()=>void Mt()}),st&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:st.name||st.id}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>Le(null),onConfirm:()=>void $e()})]})}const s1t="_EmptyMessage_1r5gu_1",a1t="_IconBadge_1r5gu_16",o1t="_Title_1r5gu_54",l1t="_Description_1r5gu_69",c1t="_ActionRow_1r5gu_77",kE={EmptyMessage:s1t,IconBadge:a1t,Title:o1t,Description:l1t,ActionRow:c1t},Cn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),u1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),d1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),f1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),h1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});Cn.Icon=u1t;Cn.Title=d1t;Cn.Description=f1t;Cn.ActionRow=h1t;const p1t="/web/skill-management";class m1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Uo(`${p1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function UEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new m1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await UEe(e,t);return e.json()}async function g1t(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function b1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function y1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function v1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function x1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function w1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function O1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function S1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function k1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await UEe(t,$t("helpers.skills.agentKitRequestFailed"));return t.json()}async function QEe(){return(await rI("/web/skill-spaces")).items||[]}async function zEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function E1t(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function C1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function T1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function A1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}an.hasResourceBundle("en-US","skills")||an.addResourceBundle("en-US","skills",Jae,!0,!0);an.hasResourceBundle("zh-CN","skills")||an.addResourceBundle("zh-CN","skills",gde,!0,!0);function Ut(e,t={}){return an.t(e,{...t,ns:"skills"})}const _1t="/web/skill-workbench";class e$ extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Ut("api.invalidFormat",{label:t}));return e}function MY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Ut("api.invalidFormat",{label:t}));return e.trim()}}function N1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Ut("api.invalidFormat",{label:Ut("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Uo(`${_1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function hU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Ut("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Ut("api.errorDetails")):r;return new e$(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])||Ut("api.missingContentType");return new e$(Ut("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await hU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Ut("api.missingContentType");throw new Error(Ut("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function j1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Ut("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(Ut("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Ut("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(Ut("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function R1t(e){if(e==null)return;const t=eu(e,Ut("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Ut("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(Ut("api.invalidFormat",{label:Ut("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Ut("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(Ut("api.unknownTaskState"));const r=MY(t.toolId,"Tool ID"),s=MY(t.sessionId,"Session ID"),a=N1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:j1t(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:R1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Ut("api.loadCapability")),Ut("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 I1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Ut("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Ut("api.startTask")))}async function P1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Ut("api.loadTask")))}async function VM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Ut("api.loadArtifact")),Ut("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(Ut("api.invalidFormat",{label:Ut("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Ut("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("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 HM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Ut("api.refine")))}async function D1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Ut("api.stop")))}async function M1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await hU(t,Ut("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Ut("api.nonNdjson"));if(!t.body)throw new Error(Ut("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Ut("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Ut("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=eu(d.error,Ut("api.publishError"));throw new e$(typeof m.message=="string"?m.message:Ut("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(Ut("api.unknownPublishEvent"));const f=eu(d.result,Ut("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"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Ut("api.streamEnded"));return r}async function L1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Ut("api.deleteTask"))}async function $1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await hU(r,Ut("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const F1t={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 B1t(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 U1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Q1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function pU(e,t){if(U1t(e))return B1t(t,e.path);if(Q1t(e)){const n=F1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=pU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function z1t(e,t){const n=pU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const VEe=new Map;function s0(e,t){VEe.set(e,t)}function V1t(e){return VEe.get(e)}function H1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;spU(i,e.dataModel),resolveString:i=>z1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=V1t(r.component)??q1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function qEe(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 aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(kbe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function mU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function WEe(e){var n,i,r,s;const t=mU(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 GEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function KEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?e0e(t,e.uri):""}function G1t({kind:e}){return e==="image"?o.jsx($F,{}):e==="video"?o.jsx(Cbe,{}):e==="pdf"?o.jsx(y7e,{}):o.jsx(MF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=mU(l.mimeType),u=KEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(N7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(G1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:WEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):GEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(gbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(K1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function K1t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>KEe(t,e),[e,t]),s=mU(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??i("media.attachment")}),o.jsxs("span",{children:[WEe(t),t.sizeBytes?` · ${GEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function LY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function X1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function gU(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Y1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function Z1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function J1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function ewt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function twt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function rwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function FY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function bU(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function swt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(xn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(bU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function kn(e){return typeof e=="string"?e:""}function BY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function t$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return kn(t.error)||kn(t.message)||kn(n==null?void 0:n.error)||kn(n==null?void 0:n.message)}function awt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=kn(t==null?void 0:t.source_type).toLowerCase(),i=kn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const XEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function owt(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 lwt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function cwt(e,t=XEe){const n=t$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:kn(l.ref),kind:c,category:awt(l),name:kn(l.name)||kn(l.ref)||t.unnamedResource,description:kn(l.description),source:kn(l.source),version:kn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=kn(l.source),u=kn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:lwt(c),label:owt(c,t),status:d,count:BY(l.count),message:kn(l.message),searchKeywords:Vc(l.search_keywords).map(kn).filter(Boolean)}]});return{collectionId:kn(n.collection_id),capabilities:{googleAdkVersion:kn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(kn).filter(Boolean),maxOrchestrationDepth:BY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function uwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function YEe(e,t,n=XEe){const i=t$(e),r=t$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>kn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=kn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),m=kn(d.root_node),g=h.find(E=>kn(E.id)===m),b=h.filter(E=>kn(E.id)!==m).map(E=>({id:kn(E.id)||n.unnamedAgent,type:kn(E.type)||"llm",description:kn(E.description)})),v=s.get(f),y=kn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=UY(v==null?void 0:v.resources),w=O.length>0?O:UY(h.flatMap(E=>Vc(E.resources))),k=QY(v==null?void 0:v.python_tools),S=k.length>0?k:QY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:kn(v==null?void 0:v.description)||kn(g==null?void 0:g.description)||kn(d.task),task:kn(d.task),rootType:kn(v==null?void 0:v.root_type)||kn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:kn(v==null?void 0:v.output),error:kn(v==null?void 0:v.error)}});return{collectionId:kn(r.collection_id)||kn(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 dwt(e,t){return!!lI(t)||YEe(e,t).failedCount>0}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=kn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:kn(i==null?void 0:i.name)||l[l.length-1]||r,description:kn(i==null?void 0:i.description),version:kn(i==null?void 0:i.version),source:kn(i==null?void 0:i.source)}]})}function QY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i==null?void 0:i.name),s=kn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:kn(i.description),code:s,entrypoint:kn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(kn).filter(Boolean)}])})}function fwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function hwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>mye(e,t,n),[e,t,n]),[a,l]=p.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(fwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(Ht,{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 ZEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const yU={...Fb},zY={};function Ab(e,t){const n=p.useRef(zY);return n.current===zY&&(n.current=e(t)),n}const qM=yU.useInsertionEffect,pwt=qM&&qM!==yU.useLayoutEffect?qM:e=>e();function Xa(e){const t=Ab(mwt).current;return t.next=e,pwt(t.effect),t.trampoline}function mwt(){const e={next:void 0,callback:gwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function gwt(){}const bwt=()=>{},bl=typeof document<"u"?p.useLayoutEffect:bwt,JEe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ywt(){return p.useContext(JEe)}function vwt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=p.useState(!1),l=Ab(wwt).current,c=Ab(xwt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),m()}),b=Xa(k=>{c.delete(k),m()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!kwt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&eCe(_,j)>0){S.disconnect(),m();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=Owt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(JEe.Provider,{value:w,children:t})}function xwt(){return new Map}function wwt(){return new Set}function Owt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>eCe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function Swt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function kwt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=Ewt("https://base-ui.com/production-error","Base UI"),tCe=p.createContext(void 0);function nCe(){const e=p.useContext(tCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(iCe).current;return Twt(r,e,t,n,i)&&rCe(r,[e,t,n,i]),r.callback}function Cwt(e){const t=Ab(iCe).current;return Awt(t,e)&&rCe(t,e),t.callback}function iCe(){return{callback:null,cleanup:null,refs:[]}}function Twt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function Awt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function rCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function VY(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(Nwt(19)?n==null?void 0:n.ref:t.ref)??null}function n$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const jwt=Object.freeze([]),Ry=Object.freeze({});function Rwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Iwt(e,t){return typeof e=="function"?e(t):e}function sCe(e,t){return typeof e=="function"?e(t):e}const vU={};function xU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Pwt(e){if(e.length===0)return vU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wU(e){return typeof e=="function"}function oCe(e,t){return wU(e)?e(t):e??vU}function Lwt(e,t){return t?e?(...n)=>{const i=n[0];if(uCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:lCe(t):e}function lCe(e){return e&&((...t)=>{const n=t[0];return uCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function cCe(e,t){return t?e?t+" "+e:t:e}function uCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=$wt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Uwt(e,i,r,s)}function $wt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Iwt(n,s):void 0,f=u?sCe(i,s):void 0,h=u?Rwt(s,c):Ry,m=u&&l?Fwt(l):void 0,g=u?n$(h,m)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Cwt([g.ref,VY(r),...a]):g.ref=ON(g.ref,VY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=cCe(g.className,d)),f!==void 0&&(g.style=n$(g.style,f)),g):Ry}function Fwt(e){return Array.isArray(e)?Pwt(e):xU(void 0,e)}const Bwt=Symbol.for("react.lazy");function Uwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=xU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Bwt&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Qwt(e,n);throw new Error(EE(8))}function Qwt(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 zwt={value:()=>null},dCe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[x,O]=ZEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=p.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:zwt});return o.jsx(tCe.Provider,{value:S,children:o.jsx(vwt,{elementsRef:y,children:E})})});let HY=0;function Vwt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(HY+=1,i(`${t}-${HY}`))},[n,t]),r}const qY=yU.useId;function Hwt(e,t){if(qY!==void 0){const n=qY();return`${t}-${n}`}return Vwt(e,t)}function i$(e){return Hwt(e,"base-ui")}const qwt="none",Wwt="trigger-press";function fCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Gwt(e){p.useEffect(e,jwt)}const MT=null;let Kwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Kwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Xwt(){const e=Ab(Kl.create).current;return Gwt(e.disposeEffect),e}function Ywt(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Zwt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=ZEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Ywt(s,!0,!0),d=i$(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=fCe(Wwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const hCe=p.createContext(void 0);function pCe(){const e=p.useContext(hCe);if(e===void 0)throw new Error(EE(15));return e}function Jwt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=ywt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const mCe=p.createContext(void 0);function OU(){const e=p.useContext(mCe);if(e===void 0)throw new Error(EE(9));return e}let WY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const eOt={"data-starting-style":""},tOt={"data-ending-style":""},nOt={transitionStatus(e){return e==="starting"?eOt:e==="ending"?tOt:null}};let SU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=WY.startingStyle]="startingStyle",e[e.endingStyle=WY.endingStyle]="endingStyle",e}({}),iOt=function(e){return e.panelOpen="data-panel-open",e}({});const rOt={[SU.open]:""},sOt={[SU.closed]:""},aOt={open(e){return e?{[iOt.panelOpen]:""}:null}},oOt={open(e){return e?rOt:sOt}};let lOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const kU={...oOt,index:e=>({[lOt.index]:String(e)}),...nOt,value:()=>null},gCe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=Jwt(),h=ON(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=nCe(),y=i$(),x=l??y,O=r||m,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Zwt({open:w,onOpenChange:k,disabled:O}),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]),N=p.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=i$(),[j,A]=p.useState(),F=j===null?void 0:j??_,T=p.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:kU});return o.jsx(hCe.Provider,{value:C,children:o.jsx(mCe.Provider,{value:T,children:P})})}),bCe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=OU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:kU})}),cOt=p.createContext(void 0);function uOt(e=!1){const t=p.useContext(cOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function dOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function WM(e,t,{detail:n=0}={}){e.dispatchEvent(new(yo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function fOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=uOt(!0),c=s??l!==void 0,{props:u}=dOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;GM(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=m;return xU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=GM(S),C=!r&&hOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),WM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),WM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&GM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),WM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function GM(e){return Kd(e)&&e.tagName==="BUTTON"}function hOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const yCe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=pCe(),g=i||m,{getButtonProps:b,buttonRef:v}=fOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=OU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:aOt})});function pOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function mOt(e){const t=Ab(gOt,e).current;return t.next=e,bl(t.effect),t}function gOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function bOt(e){return e==null?e:"current"in e?e.current:e}function vCe(e,t=!1){const n=Xwt();return Xa((i,r=null)=>{n.cancel();const s=bOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function yOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=vCe(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function vOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(K1),b=p.useRef(K1),v=p.useRef(!1),y=p.useRef(l),x=p.useRef(!1),[O,w]=p.useState(!1),k=p.useRef(null),S=ON(t,f),E=mOt(l),C=vCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),p.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=xOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const ee=wOt(U);if(T(F0(U)),!Q)return ee;const le=$T(U,"transition-duration","0s");return R(le),w(!0),ee}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),yOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),p.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function K(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(K,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),p.useEffect(function(){const I=f.current;if(!I)return;function H(K){const Q=fCe(qwt,K);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return pOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[SU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function xOt(e,t){const n=yo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&GY(n.animationDuration),r=GY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function GY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function wOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let KY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const xCe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=nCe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=pCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=vOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=OU(),L={...P,transitionStatus:F},M=sCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[KY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[KY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:kU});return A?U:null}),OOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=SOt(i,n.getBoundingClientRect()),s=kOt(i,r),a=EOt(t.getBoundingClientRect());return TOt([...s,...a])};function SOt(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 kOt(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 EOt(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 COt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function TOt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),AOt(t)}function AOt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const _Ot="_Transition_1wdpp_1",NOt="_Popover_1wdpp_3",wCe={Transition:_Ot,Popover:NOt},OCe=p.createContext(null),cI=()=>{const e=p.use(OCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=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);o7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=p.useCallback(E=>{x.current(E)},[x]),w=p.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,m,w,k]);return o.jsx(OCe,{value:S,children:o.jsx(hxe,{open:g,onOpenChange:O,modal:!1,children:r})})},jOt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(pxe,{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})},SCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=Aye(y),O=x[x.length-1];O==null||O.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(gxe,{forceMount:!0,ref:g,className:pi(wCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},ROt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=OOt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!COt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=Aye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(SCe,{...e})},IOt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(mxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:wCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(ROt,{...e},"popover-hover"):o.jsx(SCe,{...e},"popover"))})})};im.Trigger=jOt;im.Content=IOt;const POt=["skill_hub","skill_space","knowledge_base","tool"];function kCe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function ECe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function DOt(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 KM({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:DOt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function MOt({tools:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(dCe,{children:e.map((n,i)=>o.jsxs(gCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(bCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(yCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(kCe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(xCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function LOt({agents:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function $Ot({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(()=>cwt(e,i),[i,e]),s=p.useMemo(()=>POt.map(c=>{const u=uwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(ECe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(dCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(gCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(bCe,{className:"create-agent-card__accordion-header",children:o.jsxs(yCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(kCe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(xCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function FOt({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(()=>YEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(RB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(PB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Kxe,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(ZFe,{"aria-hidden":"true"}),children:[o.jsx(KM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(MOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(e7e,{"aria-hidden":"true"}),children:o.jsx(LOt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(ECe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const BOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:LY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:LY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:twt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:iwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:rwt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:FY},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:FY},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:X1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:gU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Y1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:Z1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:J1t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:ewt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:nwt,detailRenderer:$Ot},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:$Y,detailRenderer:FOt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:$Y,detailRenderer:hwt,hideHeader:!0}};function UOt(e){return BOt[e]}function CCe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function QOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function zOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function VOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function TCe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function XM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function HOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function qOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function ACe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function WOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function GOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function KOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const XOt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>rje),void 0)),YOt=p.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-CEoOh5b3.js"),[])),_Ce="veadk-code-workspace-theme";function ZOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function JOt(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 eSt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(_Ce)==="dark"?"dark":"light"}catch{return"light"}}function tSt(e){return e===""?0:e.split(` -`).length}function WS({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var F;const{t:a}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(eSt),m=p.useMemo(()=>s?VOt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(T=>({path:T.path,content:T.status==="deleted"?T.before:T.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(T=>[T.path,T.status])),[m]),[v,y]=p.useState(((F=g[0])==null?void 0:F.path)??null),[x,O]=p.useState(new Set),w=p.useMemo(()=>ZOt(g),[g]),k=g.find(T=>T.path===v)??null,S=m.find(T=>T.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(_Ce,f)}catch{}},[f]),p.useEffect(()=>{var L;if(!t)return;const T=document.body.style.overflow,P=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=u.current)==null||L.focus();const R=M=>{if(M.key==="Escape"){M.preventDefault(),d.current();return}if(M.key!=="Tab"||!c.current)return;const U=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(K=>K.offsetParent!==null);if(U.length===0)return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=T,window.removeEventListener("keydown",R),P!=null&&P.isConnected&&P.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(T){O(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}function C(T){return T?o.jsx("span",{className:`code-browser-change is-${T}`,children:a(`codeBrowser.change.${T}`)}):null}function N(T,P,R){return JOt(T,P===0).map(L=>{const M=R?`${R}/${L.name}`:L.name;if(!(L.children.size>0&&L.path===void 0)&&L.path){const H=b.get(L.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===L.path?" is-active":""}`,style:{paddingLeft:`${12+P*16}px`},onClick:()=>y(L.path??null),title:L.path,"aria-pressed":v===L.path,children:[o.jsx(XM,{}),o.jsx("span",{children:L.name}),C(H)]},M)}const I=x.has(M);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+P*16}px`},onClick:()=>E(M),"aria-expanded":!I,children:[o.jsx(qOt,{className:I?"":"is-open"}),o.jsx(HOt,{}),o.jsx("span",{children:L.name})]}),!I&&N(L,P+1,M)]},M)})}function _(T){!k||s||i({...e,files:e.files.map(P=>P.path===k.path?{...P,content:T}:P)})}const j=f==="light"?"dark":"light",A=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Li.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:T=>{T.target===T.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon",children:o.jsx(TCe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:a(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),o.jsx("p",{title:e.name,children:e.name||a("codeBrowser.projectFallback")})]})]}),o.jsxs("div",{className:"code-browser-head-actions",children:[o.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(j),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${j}`)}),children:f==="light"?o.jsx(GOt,{}):o.jsx(WOt,{})}),o.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":a("codeBrowser.closeWorkspace"),title:a("codeBrowser.close"),children:o.jsx(ACe,{})})]})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":a(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:[o.jsx("span",{children:a(s?"codeBrowser.changes":"codeBrowser.files")}),o.jsx("span",{children:g.length})]}),o.jsx("div",{className:"code-browser-tree",children:g.length>0?N(w,0,""):o.jsx("div",{className:"code-browser-empty",children:A})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:k?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(XM,{}),o.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(XM,{}),o.jsx("span",{children:(k==null?void 0:k.path)??a("codeBrowser.noFileSelected")})]}),s?o.jsxs("div",{className:"code-browser-diff-labels","aria-label":a("codeBrowser.comparisonDirection"),children:[o.jsx("span",{children:s.baseLabel??a("codeBrowser.before")}),o.jsx("span",{children:s.targetLabel??a("codeBrowser.after")})]}):null,o.jsx("div",{className:"code-browser-editor",children:k?o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:S?o.jsx(YOt,{before:S.before,after:S.after,path:S.path,theme:f}):o.jsx(XOt,{value:k.content,path:k.path,onChange:_,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:A})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:m.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:k?a("codeBrowser.lineCount",{count:tSt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function nSt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,a]=p.useState(!1),l=i??r("codeBrowser.viewSource");return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>a(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[o.jsx(TCe,{}),o.jsx("span",{children:l})]}),o.jsx(WS,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const NCe="send_a2ui_json_to_client",iSt=28,rSt=3e3;function sSt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function aSt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function jCe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),a=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=a.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(a.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=a.current;if(!b.startsWith(v)){a.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function oSt(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function lSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),o.jsx("path",{d:"M12 7h7.5"}),o.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),o.jsx("path",{d:"M12 13h7.5"}),o.jsx("path",{d:"M5 19h4"}),o.jsx("path",{d:"M12 19h7.5"})]})}function cSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),o.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function uSt({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?o.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>o.jsxs("div",{children:[o.jsx("dt",{children:i}),o.jsx("dd",{title:r,children:r})]},i))}):null}function dSt(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 RCe({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=Te("conversation"),[a,l]=p.useState(!(t||n)),c=p.useRef(!1);p.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` +`+v+"]"}return r.pop(),s=v,x}};const oxt={parse:ext,stringify:axt};var jEe=oxt;const lxt=2e5,cxt=new Set(["__proto__","constructor","prototype"]),uxt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function Bw(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wN(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&uxt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)wN(n,t+1);return}if(Bw(e))for(const[n,i]of Object.entries(e)){if(cxt.has(n))throw new Error("ECharts option contains an unsafe key");wN(i,t+1)}}function dxt(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 fxt(e,t){let n=1,i="",r=!1,s=!1,a=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(hxt),s=n[i],a=n[i+1]??!1;if(!Array.isArray(s)||typeof a!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:a}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:a}}function mxt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;llxt)throw new Error("ECharts option is too large");const n=gxt(dxt(e));let i;try{i=jEe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let QM;function yxt(){return QM??(QM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw QM=void 0,e})),QM}function vxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=bxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return yxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const xxt=p.memo(vxt);let IY,PY=Promise.resolve(),wxt=0;function Oxt(){return IY??(IY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DnksLuoJ.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))),IY}function Sxt(e){const t=PY.then(async()=>{const n=await Oxt(),i=`mermaid-diagram-${wxt+=1}`;return n.render(i,e)});return PY=t.then(()=>{},()=>{}),t}function kxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),Sxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const Ext=p.memo(kxt),Cxt="_SegmentedControl_1sl7d_1",Txt="_SegmentedControlOption_1sl7d_140",Axt="_SegmentedControlThumb_1sl7d_219",K6={SegmentedControl:Cxt,SegmentedControlOption:Txt,SegmentedControlThumb:Axt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);Cye({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||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(CWe,{ref:d,className:pi(K6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:K6.SegmentedControlThumb,ref:f}),n]})},_xt=({children:e,...t})=>o.jsx(jWe,{className:K6.SegmentedControlOption,...t,onPointerEnter:l7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=_xt;function Nxt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[a,l]=p.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const jxt=p.memo(Nxt);function Rxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const REe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function X6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(X6).join(""):p.isValidElement(e)?X6(e.props.children):""}function Ixt(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 Rxt(n==null?void 0:n.slice(9))}function IEe(e){if(!e)return!1;try{const t=e.toLowerCase();return REe.some(n=>t.includes(n))}catch{return!1}}function Pxt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(IEe(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 REe.some(s=>r.includes(s))}return!1}function Dxt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),[s,a]=p.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},m=h({children:f});if(m)return m}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Jft,{remarkPlugins:[fmt],rehypePlugins:n?[Gvt,hY]:[hY],components:{pre:({node:d,children:f,...h})=>{const m=Ixt(f);if(m==="mermaid"||m==="echarts"){const g=X6(f).replace(/\n$/,"");return o.jsx(jxt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(Ext,{source:g}):o.jsx(xxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(IEe(h)||Pxt(d))){const m=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(bbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=p.memo(Dxt);function zM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function PEe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Mxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Lxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function $xt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function Fxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx($xt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function Y6(e){return e instanceof DOMException&&e.name==="AbortError"}function Bxt(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 DEe=[".jpg",".jpeg",".png"].join(","),Uxt=new Set(DEe.split(",")),MEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Qxt=new Set(MEe.split(",")),zxt=200*1024*1024;function Z6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function Vxt(e,t,n){return e.size>zxt?n("knowledge.errors.fileTooLarge"):t==="image"?Uxt.has(Z6(e.name))?"":n("knowledge.errors.invalidImageType"):Qxt.has(Z6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function fU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function J6(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 Hxt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await hlt(x))}catch(O){m(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function qxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await plt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function LEe(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 Wxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState("{}"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(null),N=p.useRef(null),_=p.useRef(null),j=p.useRef(null),A=p.useRef(0),F=!!O;p.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=Vxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Z6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!m)return;let U;try{U=LEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await ylt(e.id,e.region,I),n()}else{const I=await vlt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else m&&(await xlt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===XOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(K+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(xn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?DEe:MEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:fU(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(xn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!m),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function Gxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=LEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await wlt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const $Ee=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),FEe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),BEe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Kxt=new Set(["pdf"]),Xxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Yxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Zxt=new Set(["error","failed","unavailable"]);function DY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Jxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(DY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=DY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function UEe(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 e1t(e){const t=UEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function t1t(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 $Ee.has(i)?"image":FEe.has(i)?"audio":BEe.has(i)?"video":Kxt.has(i)?"pdf":t||i?"file":"none"}function n1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Yxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Zxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=J6(e).toLocaleLowerCase();return i==="pdf"||Xxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:$Ee.has(i)||FEe.has(i)||BEe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function i1t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=UEe(e.attachmentUrl),s=t1t(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function r1t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(0),O=p.useRef(null),w=p.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?m(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await blt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!Y6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=e1t(a.url||t.url),S=n1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:fU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Jxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(i1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function s1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,x]=p.useState("overview"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(!0),[N,_]=p.useState(!1),[j,A]=p.useState(""),[F,T]=p.useState([]),[P,R]=p.useState(!1),[L,M]=p.useState(""),[U,I]=p.useState(""),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(!1),[le,se]=p.useState(!1),[re,ge]=p.useState(null),[W,X]=p.useState(null),[ae,ue]=p.useState(null),[Oe,ke]=p.useState(null),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),qe=p.useRef(0),Ae=p.useRef(0),ze=p.useRef([]),Ee=p.useRef(!1),De=p.useRef(!1),J=p.useRef(null),he=p.useRef(null),_e=p.useRef({}),Ze=p.useRef(!1),at=p.useRef(null),wt=p.useRef(null),Se=p.useRef(null),ve=p.useRef(null),He=p.useMemo(()=>[t],[t]),Je=p.useCallback(ye=>`${ye.region}\0${ye.id}`,[]),Ce=u.find(ye=>Je(ye)===b)??null,Wt=!!(Ce&&H===Je(Ce));p.useEffect(()=>{r==null||r(!!Ce)},[r,Ce]),p.useEffect(()=>{x("overview"),S("")},[b]);const ln=p.useMemo(()=>{const ye=O.trim().toLocaleLowerCase();return ye?u.filter(Ue=>[Ue.name,Ue.description,Ue.ownerLabel,Ue.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):u},[u,O]),cn=p.useMemo(()=>{const ye=k.trim().toLocaleLowerCase();return ye?F.filter(Ue=>[Ue.name,Ue.id,J6(Ue)].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):F},[k,F]);p.useEffect(()=>{X(null)},[Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Ot=p.useCallback(async(ye=!1)=>{var ft;if(ye&&(Ze.current||Object.keys(_e.current).length===0))return;(ft=J.current)==null||ft.abort();const Ue=new AbortController;J.current=Ue;const Ke=qe.current+1;qe.current=Ke,Ze.current=!0,ye?_(!0):C(!0),A(""),ye||g([]);try{const ut=await flt({regions:He,nextTokens:ye?_e.current:void 0,signal:Ue.signal});if(qe.current!==Ke)return;d(Rt=>ye?[...Rt,...ut.items.filter(zt=>!Rt.some(Z=>Je(Z)===Je(zt)))]:ut.items),_e.current=ut.nextTokens,h(ut.nextTokens);const Gt=ut.failures.map(({region:Rt,error:zt})=>`${xh(Rt,e)}: ${ho(zt,l("common.loadFailed"))}`);g(Rt=>ye?[...new Set([...Rt,...Gt])]:Gt),ye||v(Rt=>ut.items.some(zt=>Je(zt)===Rt)?Rt:"")}catch(ut){if(Y6(ut))return;qe.current===Ke&&(ye?g(Gt=>[...new Set([...Gt,ho(ut,l("knowledge.errors.loadMoreBases"))])]):A(ho(ut,l("knowledge.errors.loadBases"))))}finally{qe.current===Ke&&(Ze.current=!1,C(!1),_(!1))}},[Je,e,He,l]),jt=p.useCallback(async(ye,Ue=!1)=>{var ut;if(Ue&&Ee.current)return;(ut=he.current)==null||ut.abort();const Ke=new AbortController;he.current=Ke;const ft=Ae.current+1;Ae.current=ft,Ue||(ze.current=[],De.current=!1,T([]),q(!1),I("")),Ee.current=!0,R(!0),Ue?I(""):M("");try{const Gt=await glt(ye.id,{region:ye.region,offset:Ue?ze.current.length:0,signal:Ke.signal});if(Ae.current!==ft)return;K(Bt=>Bt===Je(ye)?"":Bt);const Rt=ze.current,zt=Ue?[...Rt,...Gt.items.filter(Bt=>!Bt.id||!Rt.some(Qe=>Qe.id===Bt.id))]:Gt.items,Z=Gt.hasMore&&(!Ue||zt.length>Rt.length);ze.current=zt,De.current=Z,T(zt),q(Z)}catch(Gt){if(Y6(Gt))return;Ae.current===ft&&(Gt instanceof HR&&Gt.errorCode===XOe&&(K(Je(ye)),ge(zt=>zt&&Je(zt)===Je(ye)?null:zt)),Ue?I(ho(Gt,l("knowledge.errors.loadMoreData"))):M(ho(Gt,l("knowledge.errors.loadData"))))}finally{Ae.current===ft&&(Ee.current=!1,R(!1))}},[Je,l]);p.useEffect(()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1,_e.current={},d([]),h({}),g([]),v(""),K(""),A(""),C(!0)},[e]),p.useEffect(()=>{if(n)return Ot(),()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1}},[n,i,Ot]),p.useEffect(()=>{var ye,Ue;if(!n){(ye=he.current)==null||ye.abort(),Ae.current+=1,Ee.current=!1;return}if(!Ce){(Ue=he.current)==null||Ue.abort(),Ae.current+=1,ze.current=[],Ee.current=!1,De.current=!1,T([]),q(!1),I("");return}return jt(Ce),()=>{var Ke;(Ke=he.current)==null||Ke.abort(),Ae.current+=1,Ee.current=!1}},[n,i,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const ot=n&&!Ce&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;p.useEffect(()=>{const ye=wt.current,Ue=at.current;if(!ye||!Ue||!ot)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ot(!0)},{root:Ue,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[ot,Ot]);const gt=()=>{const ye=at.current;!ye||!ot||ye.scrollHeight-ye.scrollTop-ye.clientHeight<=240&&Ot(!0)},Pe=!!(Ce&&F.length>0&&Q&&!P&&!U);p.useEffect(()=>{const ye=ve.current,Ue=Se.current;if(!Ce||!ye||!Ue||!Pe)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&jt(Ce,!0)},{root:Se.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[Pe,jt,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Et=()=>{const ye=Se.current;if(!Ce||!ye||!De.current||Ee.current||U)return;const{scrollHeight:Ue,scrollTop:Ke,clientHeight:ft}=ye;Ue-Ke-ft<=240&&jt(Ce,!0)},bt=ye=>{d(Ue=>Ue.map(Ke=>Je(Ke)===Je(ye)?ye:Ke))},Mt=async()=>{if(Oe){Ie(!0);try{await mlt(Oe.id,Oe.region),d(ye=>ye.filter(Ue=>Je(Ue)!==Je(Oe))),K(ye=>ye===Je(Oe)?"":ye),b===Je(Oe)&&v(""),ke(null)}catch(ye){A(ho(ye,l("knowledge.errors.deleteBase"))),ke(null)}finally{Ie(!1)}}},$e=async()=>{if(!(!Ce||!st)){Ie(!0);try{await Olt(Ce.id,st.id,Ce.region);const ye=ze.current.filter(Ue=>Ue.id!==st.id);ze.current=ye,T(ye),Le(null)}catch(ye){M(ho(ye,l("knowledge.errors.deleteDocument"))),Le(null)}finally{Ie(!1)}}};return o.jsxs("section",{className:`knowledge-library${Ce?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ce?o.jsx(uE,{className:"knowledge-library__detail",title:Ce.name,description:Ce.description||l("common.noDescription"),identitySeed:Ce.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(jB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:Ce.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ce.providerKnowledgeId,children:Ce.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:Ce.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:zM(Ce.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:Bxt(Ce.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Wt&&Ce.canManage?o.jsx("button",{type:"button",onClick:()=>ke(Ce),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void jt(Ce),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Lxt,{}),o.jsx("p",{children:l("knowledge.noData")}),Ce.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(Ce),children:l("knowledge.addFirstData")})]}):o.jsx(Rot,{rows:cn,rowKey:ye=>ye.id,rowLabel:ye=>ye.name||ye.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:ye=>o.jsx("span",{title:ye.name||ye.id,children:ye.name||ye.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:ye=>J6(ye)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:ye=>fU(ye.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ce.canManage?{label:l(Wt?"knowledge.associationInvalid":"knowledge.addData"),disabled:Wt,title:Wt?l("knowledge.providerMissing"):void 0,onClick:()=>ge(Ce)}:void 0,rowActions:ye=>[{label:l("common.preview"),onSelect:()=>X(ye)},...Ce.canManage?[{label:l("common.edit"),onSelect:()=>ue(ye)},{label:l("common.delete"),onSelect:()=>Le(ye),danger:!0}]:[]],scrollRef:Se,onScroll:Et,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void jt(Ce,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ve,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:Ce.canManage?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>ke(Ce),children:l("common.delete")}),o.jsx(Ht,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:ye=>w(ye.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:at,"aria-live":"polite",onScroll:gt,children:[m.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}):ln.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Mxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx(Fxt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),ln.map(ye=>o.jsx(pE,{className:"knowledge-card",title:ye.name,description:ye.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:zM(ye.ownerLabel),title:zM(ye.ownerLabel)},{label:l("knowledge.project"),value:ye.projectName||"default",title:ye.projectName||"default"}],action:{label:H===Je(ye)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!ye.canManage||H===Je(ye),title:ye.canManage?H===Je(ye)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(ye)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Je(ye))}},Je(ye)))]}),ot||N?o.jsx("div",{ref:wt,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ot?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(Hxt,{region:t,onClose:()=>ee(!1),onCreated:ye=>{d(Ue=>[ye,...Ue]),v(Je(ye)),ee(!1)}}),Ce&&le&&o.jsx(qxt,{item:Ce,onClose:()=>se(!1),onUpdated:ye=>{bt(ye),se(!1)}}),Ce&&W&&o.jsx(r1t,{base:Ce,item:W,onClose:()=>X(null)}),re&&o.jsx(Wxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:ye=>{K(Je(re)),Ce&&Je(Ce)===Je(re)&&M(ho(ye,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{Ce&&Je(Ce)===Je(re)&&jt(Ce),ge(null)}}),Ce&&ae&&o.jsx(Gxt,{base:Ce,item:ae,onClose:()=>ue(null),onUpdated:ye=>{const Ue=ze.current.map(Ke=>Ke.id===ye.id?ye:Ke);ze.current=Ue,T(Ue),ue(null)}}),Oe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:Oe.name}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>ke(null),onConfirm:()=>void Mt()}),st&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:st.name||st.id}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>Le(null),onConfirm:()=>void $e()})]})}const a1t="_EmptyMessage_1r5gu_1",o1t="_IconBadge_1r5gu_16",l1t="_Title_1r5gu_54",c1t="_Description_1r5gu_69",u1t="_ActionRow_1r5gu_77",kE={EmptyMessage:a1t,IconBadge:o1t,Title:l1t,Description:c1t,ActionRow:u1t},Cn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),d1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),f1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),h1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),p1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});Cn.Icon=d1t;Cn.Title=f1t;Cn.Description=h1t;Cn.ActionRow=p1t;const m1t="/web/skill-management";class g1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Uo(`${m1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function QEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new g1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await QEe(e,t);return e.json()}async function b1t(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function y1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function v1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function x1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function w1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function O1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function S1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function k1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function E1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await QEe(t,$t("helpers.skills.agentKitRequestFailed"));return t.json()}async function zEe(){return(await rI("/web/skill-spaces")).items||[]}async function VEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function C1t(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function T1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function A1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function _1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}an.hasResourceBundle("en-US","skills")||an.addResourceBundle("en-US","skills",eoe,!0,!0);an.hasResourceBundle("zh-CN","skills")||an.addResourceBundle("zh-CN","skills",bde,!0,!0);function Ut(e,t={}){return an.t(e,{...t,ns:"skills"})}const N1t="/web/skill-workbench";class e$ extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Ut("api.invalidFormat",{label:t}));return e}function MY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Ut("api.invalidFormat",{label:t}));return e.trim()}}function j1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Ut("api.invalidFormat",{label:Ut("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Uo(`${N1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function hU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Ut("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Ut("api.errorDetails")):r;return new e$(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])||Ut("api.missingContentType");return new e$(Ut("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await hU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Ut("api.missingContentType");throw new Error(Ut("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function R1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Ut("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(Ut("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Ut("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(Ut("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function I1t(e){if(e==null)return;const t=eu(e,Ut("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Ut("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(Ut("api.invalidFormat",{label:Ut("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Ut("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(Ut("api.unknownTaskState"));const r=MY(t.toolId,"Tool ID"),s=MY(t.sessionId,"Session ID"),a=j1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:R1t(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:I1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Ut("api.loadCapability")),Ut("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 P1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Ut("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Ut("api.startTask")))}async function D1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Ut("api.loadTask")))}async function VM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Ut("api.loadArtifact")),Ut("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(Ut("api.invalidFormat",{label:Ut("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Ut("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("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 HM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Ut("api.refine")))}async function M1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Ut("api.stop")))}async function L1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await hU(t,Ut("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Ut("api.nonNdjson"));if(!t.body)throw new Error(Ut("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Ut("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Ut("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=eu(d.error,Ut("api.publishError"));throw new e$(typeof m.message=="string"?m.message:Ut("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(Ut("api.unknownPublishEvent"));const f=eu(d.result,Ut("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"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Ut("api.streamEnded"));return r}async function $1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Ut("api.deleteTask"))}async function F1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await hU(r,Ut("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const B1t={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 U1t(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 Q1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function z1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function pU(e,t){if(Q1t(e))return U1t(t,e.path);if(z1t(e)){const n=B1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=pU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function V1t(e,t){const n=pU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const HEe=new Map;function s0(e,t){HEe.set(e,t)}function H1t(e){return HEe.get(e)}function q1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;spU(i,e.dataModel),resolveString:i=>V1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=H1t(r.component)??W1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function WEe(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 aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(Ebe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function mU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function GEe(e){var n,i,r,s;const t=mU(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 KEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function XEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?t0e(t,e.uri):""}function K1t({kind:e}){return e==="image"?o.jsx($F,{}):e==="video"?o.jsx(Tbe,{}):e==="pdf"?o.jsx(v7e,{}):o.jsx(MF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=mU(l.mimeType),u=XEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(j7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(K1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:GEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):KEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(bbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(X1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function X1t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>XEe(t,e),[e,t]),s=mU(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??i("media.attachment")}),o.jsxs("span",{children:[GEe(t),t.sizeBytes?` · ${KEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function LY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function Y1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function gU(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Z1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function J1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function ewt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function twt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function rwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function swt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function FY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function bU(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function awt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(xn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(bU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function kn(e){return typeof e=="string"?e:""}function BY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function t$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return kn(t.error)||kn(t.message)||kn(n==null?void 0:n.error)||kn(n==null?void 0:n.message)}function owt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=kn(t==null?void 0:t.source_type).toLowerCase(),i=kn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const YEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function lwt(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 cwt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function uwt(e,t=YEe){const n=t$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:kn(l.ref),kind:c,category:owt(l),name:kn(l.name)||kn(l.ref)||t.unnamedResource,description:kn(l.description),source:kn(l.source),version:kn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=kn(l.source),u=kn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:cwt(c),label:lwt(c,t),status:d,count:BY(l.count),message:kn(l.message),searchKeywords:Vc(l.search_keywords).map(kn).filter(Boolean)}]});return{collectionId:kn(n.collection_id),capabilities:{googleAdkVersion:kn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(kn).filter(Boolean),maxOrchestrationDepth:BY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function dwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function ZEe(e,t,n=YEe){const i=t$(e),r=t$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>kn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=kn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),m=kn(d.root_node),g=h.find(E=>kn(E.id)===m),b=h.filter(E=>kn(E.id)!==m).map(E=>({id:kn(E.id)||n.unnamedAgent,type:kn(E.type)||"llm",description:kn(E.description)})),v=s.get(f),y=kn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=UY(v==null?void 0:v.resources),w=O.length>0?O:UY(h.flatMap(E=>Vc(E.resources))),k=QY(v==null?void 0:v.python_tools),S=k.length>0?k:QY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:kn(v==null?void 0:v.description)||kn(g==null?void 0:g.description)||kn(d.task),task:kn(d.task),rootType:kn(v==null?void 0:v.root_type)||kn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:kn(v==null?void 0:v.output),error:kn(v==null?void 0:v.error)}});return{collectionId:kn(r.collection_id)||kn(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 fwt(e,t){return!!lI(t)||ZEe(e,t).failedCount>0}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=kn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:kn(i==null?void 0:i.name)||l[l.length-1]||r,description:kn(i==null?void 0:i.description),version:kn(i==null?void 0:i.version),source:kn(i==null?void 0:i.source)}]})}function QY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i==null?void 0:i.name),s=kn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:kn(i.description),code:s,entrypoint:kn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(kn).filter(Boolean)}])})}function hwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function pwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>gye(e,t,n),[e,t,n]),[a,l]=p.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(hwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(Ht,{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 JEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const yU={...Fb},zY={};function Ab(e,t){const n=p.useRef(zY);return n.current===zY&&(n.current=e(t)),n}const qM=yU.useInsertionEffect,mwt=qM&&qM!==yU.useLayoutEffect?qM:e=>e();function Xa(e){const t=Ab(gwt).current;return t.next=e,mwt(t.effect),t.trampoline}function gwt(){const e={next:void 0,callback:bwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function bwt(){}const ywt=()=>{},bl=typeof document<"u"?p.useLayoutEffect:ywt,eCe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function vwt(){return p.useContext(eCe)}function xwt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=p.useState(!1),l=Ab(Owt).current,c=Ab(wwt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),m()}),b=Xa(k=>{c.delete(k),m()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!Ewt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&tCe(_,j)>0){S.disconnect(),m();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=Swt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(eCe.Provider,{value:w,children:t})}function wwt(){return new Map}function Owt(){return new Set}function Swt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>tCe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function kwt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ewt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=Cwt("https://base-ui.com/production-error","Base UI"),nCe=p.createContext(void 0);function iCe(){const e=p.useContext(nCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(rCe).current;return Awt(r,e,t,n,i)&&sCe(r,[e,t,n,i]),r.callback}function Twt(e){const t=Ab(rCe).current;return _wt(t,e)&&sCe(t,e),t.callback}function rCe(){return{callback:null,cleanup:null,refs:[]}}function Awt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function _wt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function sCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function VY(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(jwt(19)?n==null?void 0:n.ref:t.ref)??null}function n$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Rwt=Object.freeze([]),Ry=Object.freeze({});function Iwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Pwt(e,t){return typeof e=="function"?e(t):e}function aCe(e,t){return typeof e=="function"?e(t):e}const vU={};function xU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Dwt(e){if(e.length===0)return vU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wU(e){return typeof e=="function"}function lCe(e,t){return wU(e)?e(t):e??vU}function $wt(e,t){return t?e?(...n)=>{const i=n[0];if(dCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:cCe(t):e}function cCe(e){return e&&((...t)=>{const n=t[0];return dCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function uCe(e,t){return t?e?t+" "+e:t:e}function dCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=Fwt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Qwt(e,i,r,s)}function Fwt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Pwt(n,s):void 0,f=u?aCe(i,s):void 0,h=u?Iwt(s,c):Ry,m=u&&l?Bwt(l):void 0,g=u?n$(h,m)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Twt([g.ref,VY(r),...a]):g.ref=ON(g.ref,VY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=uCe(g.className,d)),f!==void 0&&(g.style=n$(g.style,f)),g):Ry}function Bwt(e){return Array.isArray(e)?Dwt(e):xU(void 0,e)}const Uwt=Symbol.for("react.lazy");function Qwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=xU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Uwt&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return zwt(e,n);throw new Error(EE(8))}function zwt(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 Vwt={value:()=>null},fCe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[x,O]=JEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=p.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Vwt});return o.jsx(nCe.Provider,{value:S,children:o.jsx(xwt,{elementsRef:y,children:E})})});let HY=0;function Hwt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(HY+=1,i(`${t}-${HY}`))},[n,t]),r}const qY=yU.useId;function qwt(e,t){if(qY!==void 0){const n=qY();return`${t}-${n}`}return Hwt(e,t)}function i$(e){return qwt(e,"base-ui")}const Wwt="none",Gwt="trigger-press";function hCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Kwt(e){p.useEffect(e,Rwt)}const MT=null;let Xwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Xwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Ywt(){const e=Ab(Kl.create).current;return Kwt(e.disposeEffect),e}function Zwt(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Jwt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=JEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Zwt(s,!0,!0),d=i$(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=hCe(Gwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const pCe=p.createContext(void 0);function mCe(){const e=p.useContext(pCe);if(e===void 0)throw new Error(EE(15));return e}function eOt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=vwt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const gCe=p.createContext(void 0);function OU(){const e=p.useContext(gCe);if(e===void 0)throw new Error(EE(9));return e}let WY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const tOt={"data-starting-style":""},nOt={"data-ending-style":""},iOt={transitionStatus(e){return e==="starting"?tOt:e==="ending"?nOt:null}};let SU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=WY.startingStyle]="startingStyle",e[e.endingStyle=WY.endingStyle]="endingStyle",e}({}),rOt=function(e){return e.panelOpen="data-panel-open",e}({});const sOt={[SU.open]:""},aOt={[SU.closed]:""},oOt={open(e){return e?{[rOt.panelOpen]:""}:null}},lOt={open(e){return e?sOt:aOt}};let cOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const kU={...lOt,index:e=>({[cOt.index]:String(e)}),...iOt,value:()=>null},bCe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=eOt(),h=ON(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=iCe(),y=i$(),x=l??y,O=r||m,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Jwt({open:w,onOpenChange:k,disabled:O}),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]),N=p.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=i$(),[j,A]=p.useState(),F=j===null?void 0:j??_,T=p.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:kU});return o.jsx(pCe.Provider,{value:C,children:o.jsx(gCe.Provider,{value:T,children:P})})}),yCe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=OU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:kU})}),uOt=p.createContext(void 0);function dOt(e=!1){const t=p.useContext(uOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function fOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function WM(e,t,{detail:n=0}={}){e.dispatchEvent(new(yo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=dOt(!0),c=s??l!==void 0,{props:u}=fOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;GM(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=m;return xU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=GM(S),C=!r&&pOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),WM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),WM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&GM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),WM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function GM(e){return Kd(e)&&e.tagName==="BUTTON"}function pOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const vCe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=mCe(),g=i||m,{getButtonProps:b,buttonRef:v}=hOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=OU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:oOt})});function mOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function gOt(e){const t=Ab(bOt,e).current;return t.next=e,bl(t.effect),t}function bOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function yOt(e){return e==null?e:"current"in e?e.current:e}function xCe(e,t=!1){const n=Ywt();return Xa((i,r=null)=>{n.cancel();const s=yOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function vOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=xCe(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function xOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(K1),b=p.useRef(K1),v=p.useRef(!1),y=p.useRef(l),x=p.useRef(!1),[O,w]=p.useState(!1),k=p.useRef(null),S=ON(t,f),E=gOt(l),C=xCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),p.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=wOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const ee=OOt(U);if(T(F0(U)),!Q)return ee;const le=$T(U,"transition-duration","0s");return R(le),w(!0),ee}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),vOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),p.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function K(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(K,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),p.useEffect(function(){const I=f.current;if(!I)return;function H(K){const Q=hCe(Wwt,K);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return mOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[SU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wOt(e,t){const n=yo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&GY(n.animationDuration),r=GY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function GY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function OOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let KY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const wCe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=iCe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=mCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=xOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=OU(),L={...P,transitionStatus:F},M=aCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[KY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[KY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:kU});return A?U:null}),SOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=kOt(i,n.getBoundingClientRect()),s=EOt(i,r),a=COt(t.getBoundingClientRect());return AOt([...s,...a])};function kOt(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 EOt(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 COt(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 TOt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function AOt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),_Ot(t)}function _Ot(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const NOt="_Transition_1wdpp_1",jOt="_Popover_1wdpp_3",OCe={Transition:NOt,Popover:jOt},SCe=p.createContext(null),cI=()=>{const e=p.use(SCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=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);o7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=p.useCallback(E=>{x.current(E)},[x]),w=p.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,m,w,k]);return o.jsx(SCe,{value:S,children:o.jsx(pxe,{open:g,onOpenChange:O,modal:!1,children:r})})},ROt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(mxe,{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})},kCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=_ye(y),O=x[x.length-1];O==null||O.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(bxe,{forceMount:!0,ref:g,className:pi(OCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},IOt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=SOt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!TOt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=_ye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(kCe,{...e})},POt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(gxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:OCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(IOt,{...e},"popover-hover"):o.jsx(kCe,{...e},"popover"))})})};im.Trigger=ROt;im.Content=POt;const DOt=["skill_hub","skill_space","knowledge_base","tool"];function ECe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function CCe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function MOt(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 KM({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:MOt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function LOt({tools:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(fCe,{children:e.map((n,i)=>o.jsxs(bCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(yCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(vCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(ECe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(wCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function $Ot({agents:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function FOt({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(()=>uwt(e,i),[i,e]),s=p.useMemo(()=>DOt.map(c=>{const u=dwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(CCe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(fCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(bCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(yCe,{className:"create-agent-card__accordion-header",children:o.jsxs(vCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(ECe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(wCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function BOt({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(()=>ZEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(RB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(PB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Xxe,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(JFe,{"aria-hidden":"true"}),children:[o.jsx(KM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(LOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(t7e,{"aria-hidden":"true"}),children:o.jsx($Ot,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(CCe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const UOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:LY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:LY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:nwt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:rwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:swt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:FY},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:FY},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:Y1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:gU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Z1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:J1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:ewt},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:twt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:iwt,detailRenderer:FOt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:$Y,detailRenderer:BOt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:$Y,detailRenderer:pwt,hideHeader:!0}};function QOt(e){return UOt[e]}function TCe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function zOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function VOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function HOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function ACe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function XM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function qOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function WOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function _Ce(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function GOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function KOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function XOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const YOt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>sje),void 0)),ZOt=p.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-Dx8z_oo1.js"),[])),NCe="veadk-code-workspace-theme";function JOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function eSt(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 tSt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(NCe)==="dark"?"dark":"light"}catch{return"light"}}function nSt(e){return e===""?0:e.split(` +`).length}function WS({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var F;const{t:a}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(tSt),m=p.useMemo(()=>s?HOt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(T=>({path:T.path,content:T.status==="deleted"?T.before:T.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(T=>[T.path,T.status])),[m]),[v,y]=p.useState(((F=g[0])==null?void 0:F.path)??null),[x,O]=p.useState(new Set),w=p.useMemo(()=>JOt(g),[g]),k=g.find(T=>T.path===v)??null,S=m.find(T=>T.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(NCe,f)}catch{}},[f]),p.useEffect(()=>{var L;if(!t)return;const T=document.body.style.overflow,P=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=u.current)==null||L.focus();const R=M=>{if(M.key==="Escape"){M.preventDefault(),d.current();return}if(M.key!=="Tab"||!c.current)return;const U=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(K=>K.offsetParent!==null);if(U.length===0)return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=T,window.removeEventListener("keydown",R),P!=null&&P.isConnected&&P.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(T){O(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}function C(T){return T?o.jsx("span",{className:`code-browser-change is-${T}`,children:a(`codeBrowser.change.${T}`)}):null}function N(T,P,R){return eSt(T,P===0).map(L=>{const M=R?`${R}/${L.name}`:L.name;if(!(L.children.size>0&&L.path===void 0)&&L.path){const H=b.get(L.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===L.path?" is-active":""}`,style:{paddingLeft:`${12+P*16}px`},onClick:()=>y(L.path??null),title:L.path,"aria-pressed":v===L.path,children:[o.jsx(XM,{}),o.jsx("span",{children:L.name}),C(H)]},M)}const I=x.has(M);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+P*16}px`},onClick:()=>E(M),"aria-expanded":!I,children:[o.jsx(WOt,{className:I?"":"is-open"}),o.jsx(qOt,{}),o.jsx("span",{children:L.name})]}),!I&&N(L,P+1,M)]},M)})}function _(T){!k||s||i({...e,files:e.files.map(P=>P.path===k.path?{...P,content:T}:P)})}const j=f==="light"?"dark":"light",A=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Li.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:T=>{T.target===T.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon",children:o.jsx(ACe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:a(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),o.jsx("p",{title:e.name,children:e.name||a("codeBrowser.projectFallback")})]})]}),o.jsxs("div",{className:"code-browser-head-actions",children:[o.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(j),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${j}`)}),children:f==="light"?o.jsx(KOt,{}):o.jsx(GOt,{})}),o.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":a("codeBrowser.closeWorkspace"),title:a("codeBrowser.close"),children:o.jsx(_Ce,{})})]})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":a(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:[o.jsx("span",{children:a(s?"codeBrowser.changes":"codeBrowser.files")}),o.jsx("span",{children:g.length})]}),o.jsx("div",{className:"code-browser-tree",children:g.length>0?N(w,0,""):o.jsx("div",{className:"code-browser-empty",children:A})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:k?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(XM,{}),o.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(XM,{}),o.jsx("span",{children:(k==null?void 0:k.path)??a("codeBrowser.noFileSelected")})]}),s?o.jsxs("div",{className:"code-browser-diff-labels","aria-label":a("codeBrowser.comparisonDirection"),children:[o.jsx("span",{children:s.baseLabel??a("codeBrowser.before")}),o.jsx("span",{children:s.targetLabel??a("codeBrowser.after")})]}):null,o.jsx("div",{className:"code-browser-editor",children:k?o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:S?o.jsx(ZOt,{before:S.before,after:S.after,path:S.path,theme:f}):o.jsx(YOt,{value:k.content,path:k.path,onChange:_,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:A})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:m.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:k?a("codeBrowser.lineCount",{count:nSt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function iSt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,a]=p.useState(!1),l=i??r("codeBrowser.viewSource");return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>a(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[o.jsx(ACe,{}),o.jsx("span",{children:l})]}),o.jsx(WS,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const jCe="send_a2ui_json_to_client",rSt=28,sSt=3e3;function aSt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function oSt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function RCe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),a=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=a.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(a.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=a.current;if(!b.startsWith(v)){a.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function lSt(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function cSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),o.jsx("path",{d:"M12 7h7.5"}),o.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),o.jsx("path",{d:"M12 13h7.5"}),o.jsx("path",{d:"M5 19h4"}),o.jsx("path",{d:"M12 19h7.5"})]})}function uSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),o.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function dSt({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?o.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>o.jsxs("div",{children:[o.jsx("dt",{children:i}),o.jsx("dd",{title:r,children:r})]},i))}):null}function fSt(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 ICe({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=Te("conversation"),[a,l]=p.useState(!(t||n)),c=p.useRef(!1);p.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(g=>g.replace(/[^\S\n]*\n[^\S\n]*/g,(b,v,y)=>{const x=y[v-1]??"",O=y[v+b.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` -`),f=jCe(d,!t||i,r),{ref:h,onScroll:m}=qEe(f);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(CCe,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(xn,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(Uk,{className:`chev ${a?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${a&&f?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:h,onScroll:m,children:f})})})]})}function fSt({text:e}){return o.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:o.jsxs("div",{className:"think-head progress-head",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(CCe,{className:"thinking-logo is-active"})}),o.jsx(xn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function hSt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=Te("conversation"),[l,c]=p.useState(e.files?e:null),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,x]=p.useState(""),[O,w]=p.useState(null),k=new Date(e.validatedAt),S=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const A=window.setTimeout(()=>w(null),rSt);return()=>window.clearTimeout(A)},[O]);async function E(){if(l)return l;if(!t)throw new Error(s("blocks.sourceUnavailable"));const A=await t(e);return c(A),A}async function C(){v("source"),x(""),w(null);try{await E(),d(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}async function N(){if(i){v("download"),x(""),w(null);try{await i(e),w({message:s("blocks.downloadStarted")})}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function _(){if(n){v("compare"),x(""),w(null);try{const A=m??await n(e);g(A),h(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function j(){v("deploy"),x(""),w(null);try{r==null||r(await E())}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[o.jsxs("header",{className:"delivery-card-header",children:[o.jsx("span",{className:"delivery-card-icon",children:e.verified?o.jsx(zOt,{}):o.jsx(QOt,{})}),o.jsxs("div",{children:[o.jsx("strong",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")}),o.jsx("span",{children:e.agentName})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.fileCount")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.size")}),o.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:S})]})]}),o.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",o.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:o.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),o.jsxs("div",{className:"delivery-card-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void C(),disabled:!t||b!==null,children:[b==="source"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!n||b!==null,children:[b==="compare"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void N(),disabled:!i||b!==null,"aria-busy":b==="download",children:[b==="download"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="download"?"blocks.preparing":"blocks.downloadSource")]}),o.jsxs("button",{type:"button",onClick:()=>void j(),disabled:!e.deployable||!r||!t||b!==null,title:e.deployable?void 0:s("blocks.sourceNotReady"),children:[b==="deploy"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.manualDeploy")]})]}),y?o.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(WS,{project:{name:e.agentName,files:(l==null?void 0:l.files)??[]},open:u,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),o.jsx(WS,{project:{name:(m==null?void 0:m.target.agentName)??e.agentName,files:(m==null?void 0:m.target.files)??[]},comparison:m?{baseProject:{name:m.base.agentName,files:m.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:f,onClose:()=>h(!1),onChange:()=>{},readOnly:!0})]})}function ICe(){return o.jsx(RCe,{text:"",done:!1})}const pSt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=jCe(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Bu,{text:s,streaming:n})}):null});function mSt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||a(!i)},[i]);const c=()=>{l.current=!0,a(u=>!u)};return o.jsxs("div",{className:"block-plan",children:[o.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[o.jsx("span",{className:"plan-icon","aria-hidden":"true",children:o.jsx(lSt,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(xn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?o.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?o.jsx(bU,{className:`plan-chevron${s?" is-open":""}`}):null]}),o.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:n.length>0?o.jsx("ol",{className:"plan-items",children:n.map((u,d)=>o.jsxs("li",{"data-status":u.status,children:[o.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),o.jsx("span",{className:"plan-item-text",children:u.text}),o.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function gSt(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 bSt({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,onBranchSelect:c,onAction:u}){const{t:d}=Te("conversation"),h=e==="create_agents"&&i&&dwt(t,n)?"failed":r??(i?"completed":"running"),m=e==="create_agents"&&h==="failed"&&a,g=UOt(e),b=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||s||!!b||!!l,[x,O]=p.useState(y),w=p.useRef(!1);p.useEffect(()=>{!w.current&&y&&O(!0)},[y]);const k=()=>{w.current=!0,O(_=>!_)},S=e===NCe?d("blocks.renderUi"):e,E=gSt(n),C=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),N=C&&C.length>2e3?`${C.slice(0,2e3)} -${d("blocks.truncated")}`:C;return o.jsxs(pr.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":h,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?o.jsx(swt,{definition:g,label:m?d("blocks.agentAdjusting"):h==="failed"?d(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):dSt(e,t,d),done:i,open:x,onToggle:k}):g?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:k,type:"button","aria-expanded":x,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(oSt,{})}),i?o.jsx("span",{className:"tool-name",children:S}):o.jsx(xn,{className:"tool-name",duration:2.2,spread:15,children:S}),o.jsx(bU,{className:`tool-chevron${x?" is-open":""}`})]}),o.jsx("div",{className:`${v?"":"think-collapse "}${x?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":d("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(cSt,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(uSt,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(TE,{blocks:l.items.map(_=>_.block),streaming:!i,onAction:u}):o.jsx(xn,{className:"codex-sandbox-run__empty",children:d("blocks.waitingCodex")})})]}):null,b?o.jsx(b,{args:t,response:n,status:h,onBranchSelect:c}):l?null:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.arguments")}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),N!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:N})]}),E.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:E.map(_=>o.jsx("a",{href:_.contentUrl,download:_.name,children:d("blocks.downloadNamed",{name:_.name})},`${_.contentUrl}:${_.name}`))})]})]})]})})]})}function ySt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(MF,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:g.filename}),o.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),o.jsxs("span",{className:"artifact-card__actions",children:[v&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(m7e,{}),i("blocks.preview")]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(Yj,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),a&&o.jsx("div",{className:"artifact-card__error",children:a}),c&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:c.name}),o.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:o.jsx(Ba,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function vSt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,a]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){a(""),r("authorizing");try{await t(e),r("done")}catch(f){a(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?o.jsxs(pr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(wW,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(pr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(wW,{className:"auth-card-icon"}),o.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),o.jsxs("p",{className:"auth-card-desc",children:[o.jsx(KA,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:o.jsx("code",{className:"auth-card-code"})}}),c&&o.jsxs(o.Fragment,{children:[" ",o.jsx(KA,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:o.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),o.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):o.jsx(o.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function TE({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:i,onStreamComplete:r,onAction:s,onAuth:a,onArtifactDownload:l,onArtifactPreview:c,onResolveDelivery:u,onResolveDeliveryComparison:d,onDownloadDelivery:f,onDeployDelivery:h,onBranchSelect:m}){const g=e.reduce((b,v,y)=>v.kind==="text"?y:b,-1);return o.jsx(o.Fragment,{children:e.map((b,v)=>{switch(b.kind){case"progress":return o.jsx(fSt,{text:b.text},"build-progress");case"thinking":{const y=e.slice(v+1).some(x=>x.kind==="text"&&!!x.text.trim());return o.jsx(RCe,{text:b.text,done:b.done,answerStarted:y,streaming:n,onStreamFrame:i},v)}case"text":{const y=b.text.replace(/^\s+/,"");return y?o.jsx(pSt,{text:y,streaming:n,onStreamFrame:i,onStreamComplete:v===g?r:void 0},v):null}case"plan":return o.jsx(mSt,{title:b.title,summary:b.summary,items:b.items,done:b.done},v);case"attachment":return o.jsx(oI,{appName:t,items:b.files},v);case"artifact":return o.jsx(ySt,{block:b,onDownload:l,onPreview:c},v);case"delivery":return o.jsx(hSt,{value:b.value,onResolve:u,onResolveComparison:d,onDownload:f,onDeploy:h},v);case"invocation":return o.jsx(aI,{value:b.value},v);case"tool":{if(b.name===NCe&&b.done)return null;const y=b.name==="create_agents"&&e.slice(v+1).some(x=>x.kind==="tool"&&x.name==="create_agents");return o.jsx(bSt,{name:b.name,args:b.args,response:b.response,done:b.done,status:b.status,defaultOpen:b.defaultOpen,retrying:b.name==="create_agents"&&(n||y),codexActivity:b.codexActivity,onBranchSelect:m,onAction:s},v)}case"agent-transfer":return null;case"auth":return o.jsx(vSt,{block:b,onAuth:a},v);case"a2ui":return HEe(b.messages).filter(y=>y.components[y.rootId]).map(y=>o.jsx(pr.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(W1t,{surface:y,onAction:s})},`${v}-${y.surfaceId}`));default:return null}})})}const xSt=()=>{};function wSt(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(Ut("conversation.unsupportedActivity"))}function OSt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(wSt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(TE,{blocks:n,onAction:xSt})})}function XY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function SA({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=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),x=p.useRef([]),O=n.findIndex(P=>P.value===t),w=t.trim().toLocaleLowerCase(),k=s&&w?n.filter(P=>P.value.toLocaleLowerCase().includes(w)||P.label.toLocaleLowerCase().includes(w)):n,[S,E]=p.useState(!1),[C,N]=p.useState(Math.max(0,O)),_=O>=0?n[O]:void 0,j=r||!s&&n.length===0,A=(P=!1)=>{E(!1),P&&window.requestAnimationFrame(()=>{var R,L;return s?(R=v.current)==null?void 0:R.focus():(L=b.current)==null?void 0:L.focus()})},F=P=>{j||k.length!==0&&(N(Math.min(Math.max(P,0),k.length-1)),E(!0))};p.useEffect(()=>{if(!S)return;const P=y.current,R=s?void 0:window.requestAnimationFrame(()=>{var I;(I=x.current[C])==null||I.focus()}),L=I=>{if(!P)return;const H=P.scrollTop<=0,K=P.scrollTop+P.clientHeight>=P.scrollHeight-1;(P.scrollHeight<=P.clientHeight||I.deltaY<0&&H||I.deltaY>0&&K)&&I.preventDefault(),I.stopPropagation()},M=I=>{var H;I.target instanceof Node&&!((H=g.current)!=null&&H.contains(I.target))&&A()},U=I=>{I.key==="Escape"&&A(!0)};return P==null||P.addEventListener("wheel",L,{passive:!1}),window.addEventListener("pointerdown",M),window.addEventListener("keydown",U),()=>{R!==void 0&&window.cancelAnimationFrame(R),P==null||P.removeEventListener("wheel",L),window.removeEventListener("pointerdown",M),window.removeEventListener("keydown",U)}},[C,s,S]);const T=P=>{var L;if(k.length===0)return;const R=(P+k.length)%k.length;N(R),(L=x.current[R])==null||L.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:P=>{var R;(!P.relatedTarget||!((R=g.current)!=null&&R.contains(P.relatedTarget)))&&A()},children:[o.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,a?o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?o.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:P=>{i(P.target.value),N(0),n.length>0&&E(!0)},onClick:()=>{!S&&k.length>0&&F(0)},onKeyDown:P=>{var R,L;if(!(P.nativeEvent.isComposing||P.keyCode===229))if(P.key==="ArrowDown")P.preventDefault(),S?(R=x.current[C])==null||R.focus():F(0);else if(P.key==="ArrowUp")P.preventDefault(),S?(L=x.current[k.length-1])==null||L.focus():F(k.length-1);else if(P.key==="Enter"&&S){P.preventDefault();const M=k[C];M&&i(M.value),A()}else P.key==="Escape"&&(P.preventDefault(),A())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():F(0)},children:o.jsx(XY,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:j,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{S?A():F(O>=0?O:0)},onKeyDown:P=>{P.key==="ArrowDown"?(P.preventDefault(),F(O>=0?O:0)):P.key==="ArrowUp"&&(P.preventDefault(),F(O>=0?O:n.length-1))},children:[o.jsx("span",{className:_?void 0:"is-placeholder",title:_==null?void 0:_.label,children:(_==null?void 0:_.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(XY,{})]}),S?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((P,R)=>{const L=P.value===t;return o.jsx("button",{ref:M=>{x.current[R]=M},type:"button",role:"option","aria-selected":L,tabIndex:R===C?0:-1,className:`skill-config-select__option${L?" is-selected":""}`,title:P.label,onFocus:()=>N(R),onClick:()=>{i(P.value),A(!0)},onKeyDown:M=>{M.key==="Enter"||M.key===" "?(M.preventDefault(),i(P.value),A(!0)):M.key==="ArrowDown"?(M.preventDefault(),T(R+1)):M.key==="ArrowUp"?(M.preventDefault(),T(R-1)):M.key==="Home"?(M.preventDefault(),T(0)):M.key==="End"&&(M.preventDefault(),T(n.length-1))},children:P.label},P.value)})]}):null,c?o.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function ja(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function cl({error:e}){var s,a,l,c,u;const{t}=Te("skills"),n=e,i=(a=(s=n.originalError)==null?void 0:s.message)==null?void 0:a.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return o.jsxs("div",{className:"skill-error-details",children:[o.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?o.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?o.jsxs("details",{children:[o.jsx("summary",{children:t("errorDetails.details")}),o.jsx("pre",{children:r.join(` -`)})]}):null]})}const EU=Symbol.for("yaml.alias"),r$=Symbol.for("yaml.document"),rm=Symbol.for("yaml.map"),PCe=Symbol.for("yaml.pair"),zd=Symbol.for("yaml.scalar"),Xx=Symbol.for("yaml.seq"),ru=Symbol.for("yaml.node.type"),Yx=e=>!!e&&typeof e=="object"&&e[ru]===EU,AE=e=>!!e&&typeof e=="object"&&e[ru]===r$,_E=e=>!!e&&typeof e=="object"&&e[ru]===rm,Qs=e=>!!e&&typeof e=="object"&&e[ru]===PCe,Mr=e=>!!e&&typeof e=="object"&&e[ru]===zd,NE=e=>!!e&&typeof e=="object"&&e[ru]===Xx;function Fs(e){if(e&&typeof e=="object")switch(e[ru]){case rm:case Xx:return!0}return!1}function Us(e){if(e&&typeof e=="object")switch(e[ru]){case EU:case rm:case zd:case Xx:return!0}return!1}const DCe=e=>(Mr(e)||Fs(e))&&!!e.anchor,Sg=Symbol("break visit"),SSt=Symbol("skip children"),DO=Symbol("remove node");function Zx(e,t){const n=kSt(t);AE(e)?Iy(null,e.contents,n,Object.freeze([e]))===DO&&(e.contents=null):Iy(null,e,n,Object.freeze([]))}Zx.BREAK=Sg;Zx.SKIP=SSt;Zx.REMOVE=DO;function Iy(e,t,n,i){const r=ESt(e,t,n,i);if(Us(r)||Qs(r))return CSt(e,i,r),Iy(e,r,n,i);if(typeof r!="symbol"){if(Fs(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>TSt[t]);class Po{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Po.defaultYaml,t),this.tags=Object.assign({},Po.defaultTags,n)}clone(){const t=new Po(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Po(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Po.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Po.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Po.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Po.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+ASt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Us(t.contents)){const s={};Zx(t.contents,(a,l)=>{Us(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(` -`)}}Po.defaultYaml={explicit:!1,version:"1.2"};Po.defaultTags={"!!":"tag:yaml.org,2002:"};function MCe(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 LCe(e){const t=new Set;return Zx(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function $Ce(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function _St(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=LCe(e));const a=$Ce(t,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(Mr(a.node)||Fs(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Py(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rtu(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!DCe(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 CU{constructor(t){Object.defineProperty(this,ru,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!AE(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=tu(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof s=="function"?Py(s,{"":l},"",l):l}}let TU=class extends CU{constructor(t){super(EU),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],Zx(t,{Node:(s,a)=>{(Yx(a)||DCe(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,a=this.resolve(r,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(a);if(l||(tu(a,null,n),l=i.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=kA(r,a,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(MCe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function kA(e,t,n){if(Yx(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Fs(t)){let i=0;for(const r of t.items){const s=kA(e,r,n);s>i&&(i=s)}return i}else if(Qs(t)){const i=kA(e,t.key,n),r=kA(e,t.value,n);return Math.max(i,r)}return 1}const FCe=e=>!e||typeof e!="function"&&typeof e!="object";class Wn extends CU{constructor(t){super(zd),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tu(this.value,t,n)}toString(){return String(this.value)}}Wn.BLOCK_FOLDED="BLOCK_FOLDED";Wn.BLOCK_LITERAL="BLOCK_LITERAL";Wn.PLAIN="PLAIN";Wn.QUOTE_DOUBLE="QUOTE_DOUBLE";Wn.QUOTE_SINGLE="QUOTE_SINGLE";const NSt="tag:yaml.org,2002:";function jSt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function GS(e,t,n){var f,h,m;if(AE(e)&&(e=e.contents),Us(e))return e;if(Qs(e)){const g=(h=(f=n.schema[rm]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new TU(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=NSt+t.slice(2));let u=jSt(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Wn(e);return c&&(c.node=g),g}u=e instanceof Map?a[rm]:Symbol.iterator in Object(e)?a[Xx]:a[rm]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new Wn(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function EN(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return GS(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Uw=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class BCe extends CU{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Us(i)||Qs(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Uw(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Fs(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Fs(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Mr(s)?s.value:s:Fs(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Qs(n))return!1;const i=n.value;return i==null||t&&Mr(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Fs(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Fs(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const RSt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xf(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Bg=(e,t,n)=>e.endsWith(` +`),f=RCe(d,!t||i,r),{ref:h,onScroll:m}=WEe(f);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(TCe,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(xn,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(Uk,{className:`chev ${a?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${a&&f?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:h,onScroll:m,children:f})})})]})}function hSt({text:e}){return o.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:o.jsxs("div",{className:"think-head progress-head",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(TCe,{className:"thinking-logo is-active"})}),o.jsx(xn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function pSt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=Te("conversation"),[l,c]=p.useState(e.files?e:null),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,x]=p.useState(""),[O,w]=p.useState(null),k=new Date(e.validatedAt),S=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const A=window.setTimeout(()=>w(null),sSt);return()=>window.clearTimeout(A)},[O]);async function E(){if(l)return l;if(!t)throw new Error(s("blocks.sourceUnavailable"));const A=await t(e);return c(A),A}async function C(){v("source"),x(""),w(null);try{await E(),d(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}async function N(){if(i){v("download"),x(""),w(null);try{await i(e),w({message:s("blocks.downloadStarted")})}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function _(){if(n){v("compare"),x(""),w(null);try{const A=m??await n(e);g(A),h(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function j(){v("deploy"),x(""),w(null);try{r==null||r(await E())}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[o.jsxs("header",{className:"delivery-card-header",children:[o.jsx("span",{className:"delivery-card-icon",children:e.verified?o.jsx(VOt,{}):o.jsx(zOt,{})}),o.jsxs("div",{children:[o.jsx("strong",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")}),o.jsx("span",{children:e.agentName})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.fileCount")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.size")}),o.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:S})]})]}),o.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",o.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:o.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),o.jsxs("div",{className:"delivery-card-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void C(),disabled:!t||b!==null,children:[b==="source"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!n||b!==null,children:[b==="compare"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void N(),disabled:!i||b!==null,"aria-busy":b==="download",children:[b==="download"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="download"?"blocks.preparing":"blocks.downloadSource")]}),o.jsxs("button",{type:"button",onClick:()=>void j(),disabled:!e.deployable||!r||!t||b!==null,title:e.deployable?void 0:s("blocks.sourceNotReady"),children:[b==="deploy"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.manualDeploy")]})]}),y?o.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(WS,{project:{name:e.agentName,files:(l==null?void 0:l.files)??[]},open:u,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),o.jsx(WS,{project:{name:(m==null?void 0:m.target.agentName)??e.agentName,files:(m==null?void 0:m.target.files)??[]},comparison:m?{baseProject:{name:m.base.agentName,files:m.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:f,onClose:()=>h(!1),onChange:()=>{},readOnly:!0})]})}function PCe(){return o.jsx(ICe,{text:"",done:!1})}const mSt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=RCe(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Bu,{text:s,streaming:n})}):null});function gSt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||a(!i)},[i]);const c=()=>{l.current=!0,a(u=>!u)};return o.jsxs("div",{className:"block-plan",children:[o.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[o.jsx("span",{className:"plan-icon","aria-hidden":"true",children:o.jsx(cSt,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(xn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?o.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?o.jsx(bU,{className:`plan-chevron${s?" is-open":""}`}):null]}),o.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:n.length>0?o.jsx("ol",{className:"plan-items",children:n.map((u,d)=>o.jsxs("li",{"data-status":u.status,children:[o.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),o.jsx("span",{className:"plan-item-text",children:u.text}),o.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function bSt(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 ySt({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,onBranchSelect:c,onAction:u}){const{t:d}=Te("conversation"),h=e==="create_agents"&&i&&fwt(t,n)?"failed":r??(i?"completed":"running"),m=e==="create_agents"&&h==="failed"&&a,g=QOt(e),b=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||s||!!b||!!l,[x,O]=p.useState(y),w=p.useRef(!1);p.useEffect(()=>{!w.current&&y&&O(!0)},[y]);const k=()=>{w.current=!0,O(_=>!_)},S=e===jCe?d("blocks.renderUi"):e,E=bSt(n),C=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),N=C&&C.length>2e3?`${C.slice(0,2e3)} +${d("blocks.truncated")}`:C;return o.jsxs(pr.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":h,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?o.jsx(awt,{definition:g,label:m?d("blocks.agentAdjusting"):h==="failed"?d(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):fSt(e,t,d),done:i,open:x,onToggle:k}):g?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:k,type:"button","aria-expanded":x,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(lSt,{})}),i?o.jsx("span",{className:"tool-name",children:S}):o.jsx(xn,{className:"tool-name",duration:2.2,spread:15,children:S}),o.jsx(bU,{className:`tool-chevron${x?" is-open":""}`})]}),o.jsx("div",{className:`${v?"":"think-collapse "}${x?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":d("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(uSt,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(dSt,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(TE,{blocks:l.items.map(_=>_.block),streaming:!i,onAction:u}):o.jsx(xn,{className:"codex-sandbox-run__empty",children:d("blocks.waitingCodex")})})]}):null,b?o.jsx(b,{args:t,response:n,status:h,onBranchSelect:c}):l?null:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.arguments")}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),N!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:N})]}),E.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:E.map(_=>o.jsx("a",{href:_.contentUrl,download:_.name,children:d("blocks.downloadNamed",{name:_.name})},`${_.contentUrl}:${_.name}`))})]})]})]})})]})}function vSt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(MF,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:g.filename}),o.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),o.jsxs("span",{className:"artifact-card__actions",children:[v&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(g7e,{}),i("blocks.preview")]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(Yj,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),a&&o.jsx("div",{className:"artifact-card__error",children:a}),c&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:c.name}),o.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:o.jsx(Ba,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function xSt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,a]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){a(""),r("authorizing");try{await t(e),r("done")}catch(f){a(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?o.jsxs(pr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(wW,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(pr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(wW,{className:"auth-card-icon"}),o.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),o.jsxs("p",{className:"auth-card-desc",children:[o.jsx(KA,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:o.jsx("code",{className:"auth-card-code"})}}),c&&o.jsxs(o.Fragment,{children:[" ",o.jsx(KA,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:o.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),o.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):o.jsx(o.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function TE({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:i,onStreamComplete:r,onAction:s,onAuth:a,onArtifactDownload:l,onArtifactPreview:c,onResolveDelivery:u,onResolveDeliveryComparison:d,onDownloadDelivery:f,onDeployDelivery:h,onBranchSelect:m}){const g=e.reduce((b,v,y)=>v.kind==="text"?y:b,-1);return o.jsx(o.Fragment,{children:e.map((b,v)=>{switch(b.kind){case"progress":return o.jsx(hSt,{text:b.text},"build-progress");case"thinking":{const y=e.slice(v+1).some(x=>x.kind==="text"&&!!x.text.trim());return o.jsx(ICe,{text:b.text,done:b.done,answerStarted:y,streaming:n,onStreamFrame:i},v)}case"text":{const y=b.text.replace(/^\s+/,"");return y?o.jsx(mSt,{text:y,streaming:n,onStreamFrame:i,onStreamComplete:v===g?r:void 0},v):null}case"plan":return o.jsx(gSt,{title:b.title,summary:b.summary,items:b.items,done:b.done},v);case"attachment":return o.jsx(oI,{appName:t,items:b.files},v);case"artifact":return o.jsx(vSt,{block:b,onDownload:l,onPreview:c},v);case"delivery":return o.jsx(pSt,{value:b.value,onResolve:u,onResolveComparison:d,onDownload:f,onDeploy:h},v);case"invocation":return o.jsx(aI,{value:b.value},v);case"tool":{if(b.name===jCe&&b.done)return null;const y=b.name==="create_agents"&&e.slice(v+1).some(x=>x.kind==="tool"&&x.name==="create_agents");return o.jsx(ySt,{name:b.name,args:b.args,response:b.response,done:b.done,status:b.status,defaultOpen:b.defaultOpen,retrying:b.name==="create_agents"&&(n||y),codexActivity:b.codexActivity,onBranchSelect:m,onAction:s},v)}case"agent-transfer":return null;case"auth":return o.jsx(xSt,{block:b,onAuth:a},v);case"a2ui":return qEe(b.messages).filter(y=>y.components[y.rootId]).map(y=>o.jsx(pr.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(G1t,{surface:y,onAction:s})},`${v}-${y.surfaceId}`));default:return null}})})}const wSt=()=>{};function OSt(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(Ut("conversation.unsupportedActivity"))}function SSt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(OSt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(TE,{blocks:n,onAction:wSt})})}function XY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function SA({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=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),x=p.useRef([]),O=n.findIndex(P=>P.value===t),w=t.trim().toLocaleLowerCase(),k=s&&w?n.filter(P=>P.value.toLocaleLowerCase().includes(w)||P.label.toLocaleLowerCase().includes(w)):n,[S,E]=p.useState(!1),[C,N]=p.useState(Math.max(0,O)),_=O>=0?n[O]:void 0,j=r||!s&&n.length===0,A=(P=!1)=>{E(!1),P&&window.requestAnimationFrame(()=>{var R,L;return s?(R=v.current)==null?void 0:R.focus():(L=b.current)==null?void 0:L.focus()})},F=P=>{j||k.length!==0&&(N(Math.min(Math.max(P,0),k.length-1)),E(!0))};p.useEffect(()=>{if(!S)return;const P=y.current,R=s?void 0:window.requestAnimationFrame(()=>{var I;(I=x.current[C])==null||I.focus()}),L=I=>{if(!P)return;const H=P.scrollTop<=0,K=P.scrollTop+P.clientHeight>=P.scrollHeight-1;(P.scrollHeight<=P.clientHeight||I.deltaY<0&&H||I.deltaY>0&&K)&&I.preventDefault(),I.stopPropagation()},M=I=>{var H;I.target instanceof Node&&!((H=g.current)!=null&&H.contains(I.target))&&A()},U=I=>{I.key==="Escape"&&A(!0)};return P==null||P.addEventListener("wheel",L,{passive:!1}),window.addEventListener("pointerdown",M),window.addEventListener("keydown",U),()=>{R!==void 0&&window.cancelAnimationFrame(R),P==null||P.removeEventListener("wheel",L),window.removeEventListener("pointerdown",M),window.removeEventListener("keydown",U)}},[C,s,S]);const T=P=>{var L;if(k.length===0)return;const R=(P+k.length)%k.length;N(R),(L=x.current[R])==null||L.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:P=>{var R;(!P.relatedTarget||!((R=g.current)!=null&&R.contains(P.relatedTarget)))&&A()},children:[o.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,a?o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?o.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:P=>{i(P.target.value),N(0),n.length>0&&E(!0)},onClick:()=>{!S&&k.length>0&&F(0)},onKeyDown:P=>{var R,L;if(!(P.nativeEvent.isComposing||P.keyCode===229))if(P.key==="ArrowDown")P.preventDefault(),S?(R=x.current[C])==null||R.focus():F(0);else if(P.key==="ArrowUp")P.preventDefault(),S?(L=x.current[k.length-1])==null||L.focus():F(k.length-1);else if(P.key==="Enter"&&S){P.preventDefault();const M=k[C];M&&i(M.value),A()}else P.key==="Escape"&&(P.preventDefault(),A())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():F(0)},children:o.jsx(XY,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:j,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{S?A():F(O>=0?O:0)},onKeyDown:P=>{P.key==="ArrowDown"?(P.preventDefault(),F(O>=0?O:0)):P.key==="ArrowUp"&&(P.preventDefault(),F(O>=0?O:n.length-1))},children:[o.jsx("span",{className:_?void 0:"is-placeholder",title:_==null?void 0:_.label,children:(_==null?void 0:_.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(XY,{})]}),S?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((P,R)=>{const L=P.value===t;return o.jsx("button",{ref:M=>{x.current[R]=M},type:"button",role:"option","aria-selected":L,tabIndex:R===C?0:-1,className:`skill-config-select__option${L?" is-selected":""}`,title:P.label,onFocus:()=>N(R),onClick:()=>{i(P.value),A(!0)},onKeyDown:M=>{M.key==="Enter"||M.key===" "?(M.preventDefault(),i(P.value),A(!0)):M.key==="ArrowDown"?(M.preventDefault(),T(R+1)):M.key==="ArrowUp"?(M.preventDefault(),T(R-1)):M.key==="Home"?(M.preventDefault(),T(0)):M.key==="End"&&(M.preventDefault(),T(n.length-1))},children:P.label},P.value)})]}):null,c?o.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function ja(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function cl({error:e}){var s,a,l,c,u;const{t}=Te("skills"),n=e,i=(a=(s=n.originalError)==null?void 0:s.message)==null?void 0:a.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return o.jsxs("div",{className:"skill-error-details",children:[o.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?o.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?o.jsxs("details",{children:[o.jsx("summary",{children:t("errorDetails.details")}),o.jsx("pre",{children:r.join(` +`)})]}):null]})}const EU=Symbol.for("yaml.alias"),r$=Symbol.for("yaml.document"),rm=Symbol.for("yaml.map"),DCe=Symbol.for("yaml.pair"),zd=Symbol.for("yaml.scalar"),Xx=Symbol.for("yaml.seq"),ru=Symbol.for("yaml.node.type"),Yx=e=>!!e&&typeof e=="object"&&e[ru]===EU,AE=e=>!!e&&typeof e=="object"&&e[ru]===r$,_E=e=>!!e&&typeof e=="object"&&e[ru]===rm,Qs=e=>!!e&&typeof e=="object"&&e[ru]===DCe,Mr=e=>!!e&&typeof e=="object"&&e[ru]===zd,NE=e=>!!e&&typeof e=="object"&&e[ru]===Xx;function Fs(e){if(e&&typeof e=="object")switch(e[ru]){case rm:case Xx:return!0}return!1}function Us(e){if(e&&typeof e=="object")switch(e[ru]){case EU:case rm:case zd:case Xx:return!0}return!1}const MCe=e=>(Mr(e)||Fs(e))&&!!e.anchor,Sg=Symbol("break visit"),kSt=Symbol("skip children"),DO=Symbol("remove node");function Zx(e,t){const n=ESt(t);AE(e)?Iy(null,e.contents,n,Object.freeze([e]))===DO&&(e.contents=null):Iy(null,e,n,Object.freeze([]))}Zx.BREAK=Sg;Zx.SKIP=kSt;Zx.REMOVE=DO;function Iy(e,t,n,i){const r=CSt(e,t,n,i);if(Us(r)||Qs(r))return TSt(e,i,r),Iy(e,r,n,i);if(typeof r!="symbol"){if(Fs(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>ASt[t]);class Po{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Po.defaultYaml,t),this.tags=Object.assign({},Po.defaultTags,n)}clone(){const t=new Po(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Po(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Po.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Po.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Po.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Po.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+_St(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Us(t.contents)){const s={};Zx(t.contents,(a,l)=>{Us(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(` +`)}}Po.defaultYaml={explicit:!1,version:"1.2"};Po.defaultTags={"!!":"tag:yaml.org,2002:"};function LCe(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 $Ce(e){const t=new Set;return Zx(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function FCe(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function NSt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=$Ce(e));const a=FCe(t,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(Mr(a.node)||Fs(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Py(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rtu(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!MCe(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 CU{constructor(t){Object.defineProperty(this,ru,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!AE(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=tu(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof s=="function"?Py(s,{"":l},"",l):l}}let TU=class extends CU{constructor(t){super(EU),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],Zx(t,{Node:(s,a)=>{(Yx(a)||MCe(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,a=this.resolve(r,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(a);if(l||(tu(a,null,n),l=i.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=kA(r,a,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(LCe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function kA(e,t,n){if(Yx(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Fs(t)){let i=0;for(const r of t.items){const s=kA(e,r,n);s>i&&(i=s)}return i}else if(Qs(t)){const i=kA(e,t.key,n),r=kA(e,t.value,n);return Math.max(i,r)}return 1}const BCe=e=>!e||typeof e!="function"&&typeof e!="object";class Wn extends CU{constructor(t){super(zd),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tu(this.value,t,n)}toString(){return String(this.value)}}Wn.BLOCK_FOLDED="BLOCK_FOLDED";Wn.BLOCK_LITERAL="BLOCK_LITERAL";Wn.PLAIN="PLAIN";Wn.QUOTE_DOUBLE="QUOTE_DOUBLE";Wn.QUOTE_SINGLE="QUOTE_SINGLE";const jSt="tag:yaml.org,2002:";function RSt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function GS(e,t,n){var f,h,m;if(AE(e)&&(e=e.contents),Us(e))return e;if(Qs(e)){const g=(h=(f=n.schema[rm]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new TU(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=jSt+t.slice(2));let u=RSt(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Wn(e);return c&&(c.node=g),g}u=e instanceof Map?a[rm]:Symbol.iterator in Object(e)?a[Xx]:a[rm]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new Wn(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function EN(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return GS(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Uw=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class UCe extends CU{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Us(i)||Qs(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Uw(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Fs(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Fs(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Mr(s)?s.value:s:Fs(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Qs(n))return!1;const i=n.value;return i==null||t&&Mr(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Fs(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Fs(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const ISt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xf(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Bg=(e,t,n)=>e.endsWith(` `)?Xf(n,t):n.includes(` `)?` -`+Xf(n,t):(e.endsWith(" ")?"":" ")+n,UCe="flow",s$="block",EA="quoted";function uI(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===s$&&(b=YY(e,b,t.length),b!==-1&&(f=b+c));for(let O;O=e[b+=1];){if(n===EA&&O==="\\"){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(O===` +`+Xf(n,t):(e.endsWith(" ")?"":" ")+n,QCe="flow",s$="block",EA="quoted";function uI(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===s$&&(b=YY(e,b,t.length),b!==-1&&(f=b+c));for(let O;O=e[b+=1];){if(n===EA&&O==="\\"){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(O===` `)n===s$&&(b=YY(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(O===" "&&m&&m!==" "&&m!==` `&&m!==" "){const w=e[b+1];w&&w!==" "&&w!==` `&&w!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===EA){for(;m===" "||m===" ";)m=O,O=e[b+=1],g=!0;const w=b>y+1?b-2:v-1;if(d[w])return e;u.push(w),d[w]=!0,f=w+c,h=void 0}else g=!0}m=O}if(g&&l&&l(),u.length===0)return e;a&&a();let x=e.slice(0,u[0]);for(let O=0;O({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),fI=e=>/^(%|---|\.\.\.)/m.test(e);function ISt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,a=0;s({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),fI=e=>/^(%|---|\.\.\.)/m.test(e);function PSt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,a=0;si)return!0;if(a=s+1,r-a<=i)return!1}return!0}function MO(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(fI(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const k=n[h-1];if(k!==` `&&k!==" "&&k!==" ")break}let m=n.substring(h);const g=m.indexOf(` @@ -598,12 +598,12 @@ ${n}`)+"'";return t.implicitKey?i:uI(i,n,UCe,dI(t,!1))}function Dy(e,t){const{si `)y=v;else break}let x=n.substring(0,y{S=!0});const C=uI(`${x}${k}${m}`,u,s$,E);if(!S)return`>${w} ${u}${C}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w} -${u}${x}${n}${m}`}function PSt(e,t,n,i){const{type:r,value:s}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` +${u}${x}${n}${m}`}function DSt(e,t,n,i){const{type:r,value:s}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` `)||d&&/[[\]{},]/.test(s))return Dy(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` `)?Dy(s,t):CA(e,t,n,i);if(!l&&!d&&r!==Wn.PLAIN&&s.includes(` `))return CA(e,t,n,i);if(fI(s)){if(c==="")return t.forceBlockIndent=!0,CA(e,t,n,i);if(l&&c===u)return Dy(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Dy(s,t)}return l?f:uI(f,c,UCe,dI(t,!1))}function AU(e,t,n,i){const{implicitKey:r,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Wn.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Wn.QUOTE_DOUBLE);const c=d=>{switch(d){case Wn.BLOCK_FOLDED:case Wn.BLOCK_LITERAL:return r||s?Dy(a.value,t):CA(a,t,n,i);case Wn.QUOTE_DOUBLE:return MO(a.value,t);case Wn.QUOTE_SINGLE:return a$(a.value,t);case Wn.PLAIN:return PSt(a,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function QCe(e,t){const n=Object.assign({blockQuote:!0,commentString:RSt,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 DSt(e,t){var r;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,i;if(Mr(t)){i=t.value;let s=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,i)});if(s.length>1){const a=s.filter(l=>l.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function MSt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Mr(e)||Fs(e))&&e.anchor;s&&MCe(s)&&(n.add(s),r.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function tx(e,t,n,i){var c;if(Qs(e))return e.toString(t,n,i);if(Yx(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=Us(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=DSt(t.doc.schema.tags,s));const a=MSt(s,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Mr(s)?AU(s,t,n,i):s.toString(t,n,i);return a?Mr(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function LSt({key:e,value:t},n,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Us(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Fs(e)||!Us(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||Fs(e)||(Mr(e)?e.type===Wn.BLOCK_FOLDED||e.type===Wn.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=tx(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+=Bg(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Bg(v,n.indent,u(h))),v=`? ${v} +${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Dy(s,t)}return l?f:uI(f,c,QCe,dI(t,!1))}function AU(e,t,n,i){const{implicitKey:r,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Wn.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Wn.QUOTE_DOUBLE);const c=d=>{switch(d){case Wn.BLOCK_FOLDED:case Wn.BLOCK_LITERAL:return r||s?Dy(a.value,t):CA(a,t,n,i);case Wn.QUOTE_DOUBLE:return MO(a.value,t);case Wn.QUOTE_SINGLE:return a$(a.value,t);case Wn.PLAIN:return DSt(a,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function zCe(e,t){const n=Object.assign({blockQuote:!0,commentString:ISt,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 MSt(e,t){var r;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,i;if(Mr(t)){i=t.value;let s=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,i)});if(s.length>1){const a=s.filter(l=>l.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function LSt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Mr(e)||Fs(e))&&e.anchor;s&&LCe(s)&&(n.add(s),r.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function tx(e,t,n,i){var c;if(Qs(e))return e.toString(t,n,i);if(Yx(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=Us(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=MSt(t.doc.schema.tags,s));const a=LSt(s,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Mr(s)?AU(s,t,n,i):s.toString(t,n,i);return a?Mr(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function $St({key:e,value:t},n,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Us(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Fs(e)||!Us(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||Fs(e)||(Mr(e)?e.type===Wn.BLOCK_FOLDED||e.type===Wn.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=tx(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+=Bg(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Bg(v,n.indent,u(h))),v=`? ${v} ${l}:`):(v=`${v}:`,h&&(v+=Bg(v,n.indent,u(h))));let y,x,O;Us(t)?(y=!!t.spaceBefore,x=t.commentBefore,O=t.comment):(y=!1,x=null,O=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!m&&!h&&Mr(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&NE(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const k=tx(t,n,()=>w=!0,()=>b=!0);let S=" ";if(h||y||x){if(S=y?` `:"",x){const E=u(x);S+=` ${Xf(E,n.indent)}`}k===""&&!n.inFlow?S===` @@ -613,32 +613,32 @@ ${Xf(E,n.indent)}`}k===""&&!n.inFlow?S===` ${n.indent}`}else if(!m&&Fs(t)){const E=k[0],C=k.indexOf(` `),N=C!==-1,_=n.inFlow??t.flow??t.items.length===0;if(N||!_){let j=!1;if(N&&(E==="&"||E==="!")){let A=k.indexOf(" ");E==="&"&&A!==-1&&Ae===BT||typeof e=="symbol"&&e.description===BT,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Wn(Symbol(BT)),{addToJSMap:VCe}),stringify:()=>BT},$St=(e,t)=>(ch.identify(t)||Mr(t)&&(!t.type||t.type===Wn.PLAIN)&&ch.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ch.tag&&n.default));function VCe(e,t,n){const i=HCe(e,n);if(NE(i))for(const r of i.items)YM(e,t,r);else if(Array.isArray(i))for(const r of i)YM(e,t,r);else YM(e,t,i)}function YM(e,t,n){const i=HCe(e,n);if(!_E(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,a]of r)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function HCe(e,t){return e&&Yx(t)?t.resolve(e.doc,e):t}function qCe(e,t,{key:n,value:i}){if(Us(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if($St(e,n))VCe(e,t,i);else{const r=tu(n,"",e);if(t instanceof Map)t.set(r,tu(i,r,e));else if(t instanceof Set)t.add(r);else{const s=FSt(n,r,e),a=tu(i,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function FSt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Us(e)&&(n!=null&&n.doc)){const i=QCe(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)+'..."'),zCe(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 _U(e,t,n){const i=GS(e,void 0,n),r=GS(t,void 0,n);return new Qo(i,r)}class Qo{constructor(t,n=null){Object.defineProperty(this,ru,{value:PCe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Us(n)&&(n=n.clone(t)),Us(i)&&(i=i.clone(t)),new Qo(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return qCe(n,i,this)}toString(t,n,i){return t!=null&&t.doc?LSt(this,t,n,i):JSON.stringify(this)}}function WCe(e,t,n){return(t.inFlow??e.flow?USt:BSt)(e,t,n)}function BSt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Bg(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;ge===BT||typeof e=="symbol"&&e.description===BT,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Wn(Symbol(BT)),{addToJSMap:HCe}),stringify:()=>BT},FSt=(e,t)=>(ch.identify(t)||Mr(t)&&(!t.type||t.type===Wn.PLAIN)&&ch.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ch.tag&&n.default));function HCe(e,t,n){const i=qCe(e,n);if(NE(i))for(const r of i.items)YM(e,t,r);else if(Array.isArray(i))for(const r of i)YM(e,t,r);else YM(e,t,i)}function YM(e,t,n){const i=qCe(e,n);if(!_E(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,a]of r)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function qCe(e,t){return e&&Yx(t)?t.resolve(e.doc,e):t}function WCe(e,t,{key:n,value:i}){if(Us(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(FSt(e,n))HCe(e,t,i);else{const r=tu(n,"",e);if(t instanceof Map)t.set(r,tu(i,r,e));else if(t instanceof Set)t.add(r);else{const s=BSt(n,r,e),a=tu(i,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function BSt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Us(e)&&(n!=null&&n.doc)){const i=zCe(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)+'..."'),VCe(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 _U(e,t,n){const i=GS(e,void 0,n),r=GS(t,void 0,n);return new Qo(i,r)}class Qo{constructor(t,n=null){Object.defineProperty(this,ru,{value:DCe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Us(n)&&(n=n.clone(t)),Us(i)&&(i=i.clone(t)),new Qo(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return WCe(n,i,this)}toString(t,n,i){return t!=null&&t.doc?$St(this,t,n,i):JSON.stringify(this)}}function GCe(e,t,n){return(t.inFlow??e.flow?QSt:USt)(e,t,n)}function USt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Bg(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(` +`+Xf(u(e),c),l&&l()):f&&a&&a(),m}function QSt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=t;i+=s;const c=Object.assign({},t,{indent:i,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let g=0;gv=null);u||(u=f.length>d||y.includes(` `)),g0&&(u||(u=f.reduce((x,O)=>x+O.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Bg(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` ${s}${r}${b}`:` `;return`${g} -${r}${m}`}else return`${h}${a}${f.join(" ")}${a}${m}`}function CN({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Xf(t(i),e);n.push(s.trimStart())}}function Ug(e,t){const n=Mr(t)?t.value:t;for(const i of e)if(Qs(i)&&(i.key===t||i.key===n||Mr(i.key)&&i.key.value===n))return i}class Hc extends BCe{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(rm,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,a=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&a.items.push(_U(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let i;Qs(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Qo(t,t==null?void 0:t.value):i=new Qo(t.key,t.value);const r=Ug(this.items,i.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Mr(r.value)&&FCe(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=Ug(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Ug(this.items,t),r=i==null?void 0:i.value;return(!n&&Mr(r)?r.value:r)??void 0}has(t){return!!Ug(this.items,t)}set(t,n){this.add(new Qo(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)qCe(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Qs(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})),WCe(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const Jx={collection:"map",default:!0,nodeClass:Hc,tag:"tag:yaml.org,2002:map",resolve(e,t){return _E(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Hc.from(e,t,n)};class _b extends BCe{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Xx,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=UT(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=UT(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Mr(r)?r.value:r}has(t){const n=UT(t);return typeof n=="number"&&n=0?t:null}const e1={collection:"seq",default:!0,nodeClass:_b,tag:"tag:yaml.org,2002:seq",resolve(e,t){return NE(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>_b.from(e,t,n)},hI={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),AU(e,t,n,i)}},pI={identify:e=>e==null,createNode:()=>new Wn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Wn(null),stringify:({source:e},t)=>typeof e=="string"&&pI.test.test(e)?e:t.options.nullStr},NU={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Wn(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&NU.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 Xu({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=t-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const GCe={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:Xu},KCe={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():Xu(e)}},XCe={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 Wn(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Xu},mI=e=>typeof e=="bigint"||Number.isInteger(e),jU=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function YCe(e,t,n){const{value:i}=e;return mI(i)&&i>=0?n+i.toString(t):Xu(e)}const ZCe={identify:e=>mI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>jU(e,2,8,n),stringify:e=>YCe(e,8,"0o")},JCe={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>jU(e,0,10,n),stringify:Xu},eTe={identify:e=>mI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>jU(e,2,16,n),stringify:e=>YCe(e,16,"0x")},QSt=[Jx,e1,hI,pI,NU,ZCe,JCe,eTe,GCe,KCe,XCe];function ZY(e){return typeof e=="bigint"||Number.isInteger(e)}const QT=({value:e})=>JSON.stringify(e),zSt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:QT},{identify:e=>e==null,createNode:()=>new Wn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:QT},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:QT},{identify:ZY,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})=>ZY(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:QT}],VSt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},HSt=[Jx,e1].concat(zSt,VSt),RU={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 Qo(new Wn(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${a}${f.join(" ")}${a}${m}`}function CN({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Xf(t(i),e);n.push(s.trimStart())}}function Ug(e,t){const n=Mr(t)?t.value:t;for(const i of e)if(Qs(i)&&(i.key===t||i.key===n||Mr(i.key)&&i.key.value===n))return i}class Hc extends UCe{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(rm,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,a=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&a.items.push(_U(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let i;Qs(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Qo(t,t==null?void 0:t.value):i=new Qo(t.key,t.value);const r=Ug(this.items,i.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Mr(r.value)&&BCe(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=Ug(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Ug(this.items,t),r=i==null?void 0:i.value;return(!n&&Mr(r)?r.value:r)??void 0}has(t){return!!Ug(this.items,t)}set(t,n){this.add(new Qo(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)WCe(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Qs(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})),GCe(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const Jx={collection:"map",default:!0,nodeClass:Hc,tag:"tag:yaml.org,2002:map",resolve(e,t){return _E(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Hc.from(e,t,n)};class _b extends UCe{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Xx,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=UT(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=UT(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Mr(r)?r.value:r}has(t){const n=UT(t);return typeof n=="number"&&n=0?t:null}const e1={collection:"seq",default:!0,nodeClass:_b,tag:"tag:yaml.org,2002:seq",resolve(e,t){return NE(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>_b.from(e,t,n)},hI={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),AU(e,t,n,i)}},pI={identify:e=>e==null,createNode:()=>new Wn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Wn(null),stringify:({source:e},t)=>typeof e=="string"&&pI.test.test(e)?e:t.options.nullStr},NU={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Wn(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&NU.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 Xu({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=t-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const KCe={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:Xu},XCe={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():Xu(e)}},YCe={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 Wn(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Xu},mI=e=>typeof e=="bigint"||Number.isInteger(e),jU=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function ZCe(e,t,n){const{value:i}=e;return mI(i)&&i>=0?n+i.toString(t):Xu(e)}const JCe={identify:e=>mI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>jU(e,2,8,n),stringify:e=>ZCe(e,8,"0o")},eTe={identify:mI,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>jU(e,0,10,n),stringify:Xu},tTe={identify:e=>mI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>jU(e,2,16,n),stringify:e=>ZCe(e,16,"0x")},zSt=[Jx,e1,hI,pI,NU,JCe,eTe,tTe,KCe,XCe,YCe];function ZY(e){return typeof e=="bigint"||Number.isInteger(e)}const QT=({value:e})=>JSON.stringify(e),VSt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:QT},{identify:e=>e==null,createNode:()=>new Wn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:QT},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:QT},{identify:ZY,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})=>ZY(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:QT}],HSt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},qSt=[Jx,e1].concat(VSt,HSt),RU={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 Qo(new Wn(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]=Qs(i)?i:new Qo(i)}}else t("Expected a sequence for this tag");return e}function nTe(e,t,n){const{replacer:i}=n,r=new _b(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(s++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(_U(l,c,n))}return r}const IU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:tTe,createNode:nTe};class av extends _b{constructor(){super(),this.add=Hc.prototype.add.bind(this),this.delete=Hc.prototype.delete.bind(this),this.get=Hc.prototype.get.bind(this),this.has=Hc.prototype.has.bind(this),this.set=Hc.prototype.set.bind(this),this.tag=av.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,a;if(Qs(r)?(s=tu(r.key,"",n),a=tu(r.value,s,n)):s=tu(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(t,n,i){const r=nTe(t,n,i),s=new this;return s.items=r.items,s}}av.tag="tag:yaml.org,2002:omap";const PU={collection:"seq",identify:e=>e instanceof Map,nodeClass:av,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=tTe(e,t),i=[];for(const{key:r}of n.items)Mr(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new av,n)},createNode:(e,t,n)=>av.from(e,t,n)};function iTe({value:e,source:t},n){return t&&(e?rTe:sTe).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const rTe={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 Wn(!0),stringify:iTe},sTe={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 Wn(!1),stringify:iTe},qSt={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:Xu},WSt={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():Xu(e)}},GSt={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 Wn(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:Xu},jE=e=>typeof e=="bigint"||Number.isInteger(e);function gI(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return r==="-"?BigInt(-1)*a:a}const s=parseInt(e,n);return r==="-"?-1*s:s}function DU(e,t,n){const{value:i}=e;if(jE(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Xu(e)}const KSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>gI(e,2,2,n),stringify:e=>DU(e,2,"0b")},XSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>gI(e,1,8,n),stringify:e=>DU(e,8,"0")},YSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>gI(e,0,10,n),stringify:Xu},ZSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>gI(e,2,16,n),stringify:e=>DU(e,16,"0x")};class ov extends Hc{constructor(t){super(t),this.tag=ov.tag}add(t){let n;Qs(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Qo(t.key,null):n=new Qo(t,null),Ug(this.items,n.key)||this.items.push(n)}get(t,n){const i=Ug(this.items,t);return!n&&Qs(i)?Mr(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=Ug(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Qo(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),s.items.push(_U(a,null,i));return s}}ov.tag="tag:yaml.org,2002:set";const MU={collection:"map",identify:e=>e instanceof Set,nodeClass:ov,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ov.from(e,t,n),resolve(e,t){if(_E(e)){if(e.hasAllNullValues(!0))return Object.assign(new ov,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function LU(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function aTe(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Xu(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const oTe={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})=>LU(e,n),stringify:aTe},lTe={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=>LU(e,!1),stringify:aTe},bI={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(bI.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=LU(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$/,""))??""},JY=[Jx,e1,hI,pI,rTe,sTe,KSt,XSt,YSt,ZSt,qSt,WSt,GSt,RU,ch,PU,IU,MU,oTe,lTe,bI],eZ=new Map([["core",QSt],["failsafe",[Jx,e1,hI]],["json",HSt],["yaml11",JY],["yaml-1.1",JY]]),tZ={binary:RU,bool:NU,float:XCe,floatExp:KCe,floatNaN:GCe,floatTime:lTe,int:JCe,intHex:eTe,intOct:ZCe,intTime:oTe,map:Jx,merge:ch,null:pI,omap:PU,pairs:IU,seq:e1,set:MU,timestamp:bI},JSt={"tag:yaml.org,2002:binary":RU,"tag:yaml.org,2002:merge":ch,"tag:yaml.org,2002:omap":PU,"tag:yaml.org,2002:pairs":IU,"tag:yaml.org,2002:set":MU,"tag:yaml.org,2002:timestamp":bI};function ZM(e,t,n){const i=eZ.get(t);if(i&&!e)return n&&!i.includes(ch)?i.concat(ch):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(eZ.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(ch)),r.reduce((s,a)=>{const l=typeof a=="string"?tZ[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(tZ).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 ekt=(e,t)=>e.keyt.key?1:0;let tkt=class cTe{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?ZM(t,"compat"):t?ZM(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?JSt:{},this.tags=ZM(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,rm,{value:Jx}),Object.defineProperty(this,zd,{value:hI}),Object.defineProperty(this,Xx,{value:e1}),this.sortMapEntries=typeof a=="function"?a:a===!0?ekt:null}clone(){const t=Object.create(cTe.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function nkt(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=QCe(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Xf(u,""))}let a=!1,l=null;if(e.contents){if(Us(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Xf(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=tx(e.contents,r,()=>l=null,u);l&&(d+=Bg(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(tx(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +${s.comment}`:i.comment}i=r}e.items[n]=Qs(i)?i:new Qo(i)}}else t("Expected a sequence for this tag");return e}function iTe(e,t,n){const{replacer:i}=n,r=new _b(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(s++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(_U(l,c,n))}return r}const IU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:nTe,createNode:iTe};class av extends _b{constructor(){super(),this.add=Hc.prototype.add.bind(this),this.delete=Hc.prototype.delete.bind(this),this.get=Hc.prototype.get.bind(this),this.has=Hc.prototype.has.bind(this),this.set=Hc.prototype.set.bind(this),this.tag=av.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,a;if(Qs(r)?(s=tu(r.key,"",n),a=tu(r.value,s,n)):s=tu(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(t,n,i){const r=iTe(t,n,i),s=new this;return s.items=r.items,s}}av.tag="tag:yaml.org,2002:omap";const PU={collection:"seq",identify:e=>e instanceof Map,nodeClass:av,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=nTe(e,t),i=[];for(const{key:r}of n.items)Mr(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new av,n)},createNode:(e,t,n)=>av.from(e,t,n)};function rTe({value:e,source:t},n){return t&&(e?sTe:aTe).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const sTe={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 Wn(!0),stringify:rTe},aTe={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 Wn(!1),stringify:rTe},WSt={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:Xu},GSt={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():Xu(e)}},KSt={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 Wn(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:Xu},jE=e=>typeof e=="bigint"||Number.isInteger(e);function gI(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return r==="-"?BigInt(-1)*a:a}const s=parseInt(e,n);return r==="-"?-1*s:s}function DU(e,t,n){const{value:i}=e;if(jE(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Xu(e)}const XSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>gI(e,2,2,n),stringify:e=>DU(e,2,"0b")},YSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>gI(e,1,8,n),stringify:e=>DU(e,8,"0")},ZSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>gI(e,0,10,n),stringify:Xu},JSt={identify:jE,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>gI(e,2,16,n),stringify:e=>DU(e,16,"0x")};class ov extends Hc{constructor(t){super(t),this.tag=ov.tag}add(t){let n;Qs(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Qo(t.key,null):n=new Qo(t,null),Ug(this.items,n.key)||this.items.push(n)}get(t,n){const i=Ug(this.items,t);return!n&&Qs(i)?Mr(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=Ug(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Qo(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),s.items.push(_U(a,null,i));return s}}ov.tag="tag:yaml.org,2002:set";const MU={collection:"map",identify:e=>e instanceof Set,nodeClass:ov,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ov.from(e,t,n),resolve(e,t){if(_E(e)){if(e.hasAllNullValues(!0))return Object.assign(new ov,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function LU(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function oTe(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Xu(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const lTe={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})=>LU(e,n),stringify:oTe},cTe={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=>LU(e,!1),stringify:oTe},bI={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(bI.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=LU(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$/,""))??""},JY=[Jx,e1,hI,pI,sTe,aTe,XSt,YSt,ZSt,JSt,WSt,GSt,KSt,RU,ch,PU,IU,MU,lTe,cTe,bI],eZ=new Map([["core",zSt],["failsafe",[Jx,e1,hI]],["json",qSt],["yaml11",JY],["yaml-1.1",JY]]),tZ={binary:RU,bool:NU,float:YCe,floatExp:XCe,floatNaN:KCe,floatTime:cTe,int:eTe,intHex:tTe,intOct:JCe,intTime:lTe,map:Jx,merge:ch,null:pI,omap:PU,pairs:IU,seq:e1,set:MU,timestamp:bI},ekt={"tag:yaml.org,2002:binary":RU,"tag:yaml.org,2002:merge":ch,"tag:yaml.org,2002:omap":PU,"tag:yaml.org,2002:pairs":IU,"tag:yaml.org,2002:set":MU,"tag:yaml.org,2002:timestamp":bI};function ZM(e,t,n){const i=eZ.get(t);if(i&&!e)return n&&!i.includes(ch)?i.concat(ch):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(eZ.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(ch)),r.reduce((s,a)=>{const l=typeof a=="string"?tZ[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(tZ).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 tkt=(e,t)=>e.keyt.key?1:0;let nkt=class uTe{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?ZM(t,"compat"):t?ZM(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?ekt:{},this.tags=ZM(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,rm,{value:Jx}),Object.defineProperty(this,zd,{value:hI}),Object.defineProperty(this,Xx,{value:e1}),this.sortMapEntries=typeof a=="function"?a:a===!0?tkt:null}clone(){const t=Object.create(uTe.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function ikt(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=zCe(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Xf(u,""))}let a=!1,l=null;if(e.contents){if(Us(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Xf(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=tx(e.contents,r,()=>l=null,u);l&&(d+=Bg(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(tx(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` `)?(n.push("..."),n.push(Xf(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(Xf(s(u),"")))}return n.join(` `)+` -`}class RE{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ru,{value:r$});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Po({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(RE.prototype,{[ru]:{value:r$}});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=Us(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){B0(this.contents)&&this.contents.add(t)}addIn(t,n){B0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=LCe(this);t.anchor=!n||i.has(n)?$Ce(n||"a",i):n}return new TU(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=x=>typeof x=="number"||x instanceof String||x instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=_St(this,a||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=GS(t,d,g);return l&&Fs(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 Qo(r,s)}delete(t){return B0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Uw(t)?this.contents==null?!1:(this.contents=null,!0):B0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Fs(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Uw(t)?!n&&Mr(this.contents)?this.contents.value:this.contents:Fs(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Fs(this.contents)?this.contents.has(t):!1}hasIn(t){return Uw(t)?this.contents!==void 0:Fs(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=EN(this.schema,[t],n):B0(this.contents)&&this.contents.set(t,n)}setIn(t,n){Uw(t)?this.contents=n:this.contents==null?this.contents=EN(this.schema,Array.from(t),n):B0(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 Po({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 Po({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 tkt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=tu(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof a=="function"?Py(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return nkt(this,t)}}function B0(e){if(Fs(e))return!0;throw new Error("Expected a YAML collection as document contents")}class uTe extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class Qw extends uTe{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class ikt extends uTe{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const nZ=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class RE{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ru,{value:r$});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Po({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(RE.prototype,{[ru]:{value:r$}});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=Us(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){B0(this.contents)&&this.contents.add(t)}addIn(t,n){B0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=$Ce(this);t.anchor=!n||i.has(n)?FCe(n||"a",i):n}return new TU(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=x=>typeof x=="number"||x instanceof String||x instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=NSt(this,a||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=GS(t,d,g);return l&&Fs(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 Qo(r,s)}delete(t){return B0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Uw(t)?this.contents==null?!1:(this.contents=null,!0):B0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Fs(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Uw(t)?!n&&Mr(this.contents)?this.contents.value:this.contents:Fs(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Fs(this.contents)?this.contents.has(t):!1}hasIn(t){return Uw(t)?this.contents!==void 0:Fs(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=EN(this.schema,[t],n):B0(this.contents)&&this.contents.set(t,n)}setIn(t,n){Uw(t)?this.contents=n:this.contents==null?this.contents=EN(this.schema,Array.from(t),n):B0(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 Po({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 Po({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 nkt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=tu(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof a=="function"?Py(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return ikt(this,t)}}function B0(e){if(Fs(e))return!0;throw new Error("Expected a YAML collection as document contents")}class dTe extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class Qw extends dTe{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class rkt extends dTe{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const nZ=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===i&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-s)));const u=" ".repeat(s)+"^".repeat(l);n.message+=`: ${a} ${u} `}};function nx(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,x=null,O=null,w=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 N=C.source.substring(1)||" ";f?f+=h+N:f=N,h="",u=!1;break}case"newline":u?f?f+=C.source:(!w||n!=="seq-item-ind")&&(c=!0):h+=C.source,u=!0,m=!0,(v||y)&&(x=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`),w&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),w=C,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){O&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),O=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<=a||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:w,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:x,end:E,start:k??E}}function KS(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(KS(t.key)||KS(t.value))return!0}return!1;default:return!0}}function l$(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&KS(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function dTe(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||Mr(s)&&Mr(a)&&s.value===a.value;return t.some(s=>r(s.key,n))}const iZ="All mapping items must start at the same column";function rkt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const a=(s==null?void 0:s.nodeClass)??Hc,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=nx(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",iZ)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||KS(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",iZ);n.atKey=!0;const x=v.end,O=m?e(n,m,v,r):t(n,x,h,null,v,r);n.schema.compat&&l$(i.indent,m,r),n.atKey=!1,dTe(n,l.items,O)&&r(x,"DUPLICATE_KEY","Map keys must be unique");const w=nx(g??[],{indicator:"map-value-ind",next:b,offset:O.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=w.end,w.found){y&&((b==null?void 0:b.type)==="block-map"&&!w.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 akt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const a=i.start.source==="{",l=a?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(a?Hc:_b),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;ys===a||Mr(s)&&Mr(a)&&s.value===a.value;return t.some(s=>r(s.key,n))}const iZ="All mapping items must start at the same column";function skt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const a=(s==null?void 0:s.nodeClass)??Hc,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=nx(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",iZ)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||KS(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",iZ);n.atKey=!0;const x=v.end,O=m?e(n,m,v,r):t(n,x,h,null,v,r);n.schema.compat&&l$(i.indent,m,r),n.atKey=!1,fTe(n,l.items,O)&&r(x,"DUPLICATE_KEY","Map keys must be unique");const w=nx(g??[],{indicator:"map-value-ind",next:b,offset:O.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=w.end,w.found){y&&((b==null?void 0:b.type)==="block-map"&&!w.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 okt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const a=i.start.source==="{",l=a?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(a?Hc:_b),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=IE(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 t5(e,t,n,i,r,s){const a=n.type==="block-map"?rkt(e,t,n,i,s):n.type==="block-seq"?skt(e,t,n,i,s):akt(e,t,n,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function okt(e,t,n,i,r){var h;const s=i.tag,a=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===a&&m.collection===l);if(!c){const m=t.schema.knownTags[a];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),t5(e,t,n,r,a)}const u=t5(e,t,n,r,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Us(d)?d:new Wn(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function lkt(e,t,n){const i=t.offset,r=ckt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Wn.BLOCK_FOLDED:Wn.BLOCK_LITERAL,a=t.source?ukt(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&a.length>0?` +`+_.comment:N.comment=_.comment);const A=new Qo(N,j);if(n.options.keepSourceTokens&&(A.srcToken=x),a){const F=u;fTe(n,F.items,N)&&r(C,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(A)}else{const F=new Hc(n.schema);F.flow=!0,F.items.push(A);const T=(j??N).range;F.range=[N.range[0],T[1],T[2]],u.items.push(F)}f=j?j.range[2]:_.end}}const h=a?"}":"]",[m,...g]=i.end;let b=f;if((m==null?void 0:m.source)===h)b=m.offset+m.source.length;else{const y=l[0].toUpperCase()+l.substring(1),x=d?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;r(f,d?"MISSING_CHAR":"BAD_INDENT",x),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const y=IE(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 t5(e,t,n,i,r,s){const a=n.type==="block-map"?skt(e,t,n,i,s):n.type==="block-seq"?akt(e,t,n,i,s):okt(e,t,n,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function lkt(e,t,n,i,r){var h;const s=i.tag,a=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===a&&m.collection===l);if(!c){const m=t.schema.knownTags[a];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),t5(e,t,n,r,a)}const u=t5(e,t,n,r,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Us(d)?d:new Wn(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function ckt(e,t,n){const i=t.offset,r=ukt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Wn.BLOCK_FOLDED:Wn.BLOCK_LITERAL,a=t.source?dkt(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"";let v=i+r.length;return t.source&&(v+=t.source.length),{value:b,type:s,comment:r.comment,range:[i,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)a[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` @@ -653,38 +653,38 @@ ${u} `+a[b][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const g=i+r.length+t.source.length;return{value:f,type:s,comment:r.comment,range:[i,g,g]}}function ckt({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],s=r[0];let a=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=Wn.PLAIN,c=fkt(s,u);break;case"single-quoted-scalar":l=Wn.QUOTE_SINGLE,c=hkt(s,u);break;case"double-quoted-scalar":l=Wn.QUOTE_DOUBLE,c=pkt(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=IE(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function fkt(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}`),fTe(e)}function hkt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),fTe(e.slice(1,-1)).replace(/''/g,"'")}function fTe(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=Wn.PLAIN,c=hkt(s,u);break;case"single-quoted-scalar":l=Wn.QUOTE_SINGLE,c=pkt(s,u);break;case"double-quoted-scalar":l=Wn.QUOTE_DOUBLE,c=mkt(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=IE(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function hkt(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}`),hTe(e)}function pkt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),hTe(e.slice(1,-1)).replace(/''/g,"'")}function hTe(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 mkt(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 gkt(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 gkt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function bkt(e,t,n,i){const r=e.substr(t,n),a=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{const l=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function hTe(e,t,n,i){const{value:r,type:s,comment:a,range:l}=t.type==="block-scalar"?lkt(e,t,i):dkt(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[zd]:c?u=ykt(e.schema,r,c,n,i):t.type==="scalar"?u=vkt(e,r,t,i):u=e.schema[zd];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Mr(f)?f:new Wn(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Wn(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function ykt(e,t,n,i,r){var l;if(n==="!")return e[zd];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[zd])}function vkt({atKey:e,directives:t,schema:n},i,r,s){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[zd];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[zd];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return a}function xkt(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 wkt={composeNode:pTe,composeEmptyNode:$U};function pTe(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=Okt(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=hTe(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=okt(wkt,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=$U(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&&(!Mr(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function $U(e,t,n,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:xkt(t,n,i),indent:-1,source:""},f=hTe(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function Okt({options:e},{offset:t,source:n,end:i},r){const s=new TU(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=IE(i,a,e.strict,r);return s.range=[t,a,l.offset],l.comment&&(s.comment=l.comment),s}function Skt(e,t,{offset:n,start:i,value:r,end:s},a){const l=Object.assign({_directives:t},e),c=new RE(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=nx(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?pTe(u,r,d,a):$U(u,d.end,i,null,d,a);const f=c.contents.range[2],h=IE(s,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function X1(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 rZ(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[zd]:c?u=vkt(e.schema,r,c,n,i):t.type==="scalar"?u=xkt(e,r,t,i):u=e.schema[zd];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Mr(f)?f:new Wn(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Wn(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function vkt(e,t,n,i,r){var l;if(n==="!")return e[zd];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[zd])}function xkt({atKey:e,directives:t,schema:n},i,r,s){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[zd];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[zd];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return a}function wkt(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 Okt={composeNode:mTe,composeEmptyNode:$U};function mTe(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=Skt(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=pTe(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=lkt(Okt,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=$U(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&&(!Mr(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function $U(e,t,n,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:wkt(t,n,i),indent:-1,source:""},f=pTe(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function Skt({options:e},{offset:t,source:n,end:i},r){const s=new TU(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=IE(i,a,e.strict,r);return s.range=[t,a,l.offset],l.comment&&(s.comment=l.comment),s}function kkt(e,t,{offset:n,start:i,value:r,end:s},a){const l=Object.assign({_directives:t},e),c=new RE(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=nx(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?mTe(u,r,d,a):$U(u,d.end,i,null,d,a);const f=c.contents.range[2],h=IE(s,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function X1(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 rZ(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const a=X1(n);s?this.warnings.push(new ikt(a,i,r)):this.errors.push(new Qw(a,i,r))},this.directives=new Po({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=rZ(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +`)+(a.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[s+1])==null?void 0:r[0])!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}let Ekt=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const a=X1(n);s?this.warnings.push(new rkt(a,i,r)):this.errors.push(new Qw(a,i,r))},this.directives=new Po({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=rZ(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(Fs(s)&&!s.flow&&s.items.length>0){let a=s.items[0];Qs(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${i} ${l}`:i}else{const a=s.commentBefore;s.commentBefore=a?`${i} -${a}`:i}}if(n){for(let s=0;s{const s=X1(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Skt(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 Qw(X1(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 Qw(X1(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=IE(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 Qw(X1(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 RE(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 mTe="\uFEFF",gTe="",bTe="",c$="";function Ekt(e){switch(e){case mTe:return"byte-order-mark";case gTe:return"doc-mode";case bTe:return"flow-error-end";case c$:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:i}}if(n){for(let s=0;s{const s=X1(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=kkt(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 Qw(X1(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 Qw(X1(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=IE(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 Qw(X1(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 RE(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 gTe="\uFEFF",bTe="",yTe="",c$="";function Ckt(e){switch(e){case gTe:return"byte-order-mark";case bTe:return"doc-mode";case yTe:return"flow-error-end";case c$: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 gu(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const sZ=new Set("0123456789ABCDEFabcdef"),Ckt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),zT=new Set(",[]{}"),Tkt=new Set(` ,[]{} -\r `),n5=e=>!e||Tkt.has(e);class Akt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:case"\r":case" ":return!0;default:return!1}}const sZ=new Set("0123456789ABCDEFabcdef"),Tkt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),zT=new Set(",[]{}"),Akt=new Set(` ,[]{} +\r `),n5=e=>!e||Akt.has(e);class _kt{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==="...")&&gu(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!gu(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===":")&&gu(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(n5),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&ithis.indentValue&&!gu(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===":")&&gu(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(n5),"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=>gu(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` @@ -694,25 +694,25 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus `&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield c$,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(gu(s)||t&&zT.has(s))break;n=i}else if(gu(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` `,s=this.buffer[i+1]):n=i),s==="#"||t&&zT.has(s))break;if(r===` -`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&zT.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield c$,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(n5),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(gu(i)||n&&zT.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(;!gu(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(Ckt.has(n))n=this.buffer[++t];else if(n==="%"&&sZ.has(this.buffer[t+1])&&sZ.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&zT.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield c$,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(n5),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(gu(i)||n&&zT.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(;!gu(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(Tkt.has(n))n=this.buffer[++t];else if(n==="%"&&sZ.has(this.buffer[t+1])&&sZ.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 _kt{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 TN(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"&&oZ(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&&aZ(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 Nkt{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 TN(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"&&oZ(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&&aZ(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Op(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(yTe(n.key)&&!Op(n.sep,"newline")){const l=U0(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Op(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=U0(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Op(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Op(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){TN(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Op(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=VT(i),s=U0(r);oZ(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){TN(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Op(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(vTe(n.key)&&!Op(n.sep,"newline")){const l=U0(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Op(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=U0(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Op(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Op(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){TN(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Op(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=VT(i),s=U0(r);oZ(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function jkt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new _kt||null,prettyErrors:t}}function vTe(e,t={}){const{lineCounter:n,prettyErrors:i}=jkt(t),r=new Nkt(n==null?void 0:n.addNewLine),s=new kkt(t);let a=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Qw(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(nZ(e,n)),a.warnings.forEach(nZ(e,n))),a}function Rkt(e,t,n){let i;const r=vTe(e,n);if(!r)return null;if(r.warnings.forEach(s=>zCe(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 FU(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return AE(e)&&!i?e.toString(n):new RE(e,i,n).toString(n)}const xTe=1024;let Ikt=0,Wc=class{constructor(t,n){this.from=t,this.to=n}};class Ln{constructor(t={}){this.id=Ikt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ea.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}Ln.closedBy=new Ln({deserialize:e=>e.split(" ")});Ln.openedBy=new Ln({deserialize:e=>e.split(" ")});Ln.group=new Ln({deserialize:e=>e.split(" ")});Ln.isolate=new Ln({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ln.contextHash=new Ln({perNode:!0});Ln.lookAhead=new Ln({perNode:!0});Ln.mounted=new Ln({perNode:!0});class lv{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[Ln.mounted.id]}}const Pkt=Object.create(null);class ea{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Pkt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new ea(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ln.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(Ln.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}ea.none=new ea("",Object.create(null),0,8);class t1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|er.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:QU(ea.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new hi(ea.none,n,i,r)))}static build(t){return $kt(t)}}hi.empty=new hi(ea.none,[],[],0);class BU{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 BU(this.buffer,this.index)}}class km{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return ea.none}toString(){let t=[];for(let n=0;n0));c=a[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),a=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function XS(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+a.from,h;if(!(!(s&er.EnterBracketed&&d instanceof hi&&(h=lv.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!wTe(r,i,f,f+d.length))){if(d instanceof km){if(s&er.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new Td(new Dkt(a,d,t,f),null,m)}else if(s&er.IncludeAnonymous||!d.type.isAnonymous||UU(d)){let m;if(!(s&er.IgnoreMounts)&&(m=lv.get(d))&&!m.overlay)return new wo(m.tree,f,t,a);let g=new wo(d,f,t,a);return s&er.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&er.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&er.IgnoreOverlays)&&(r=lv.get(this._tree))&&r.overlay){let s=t-this.from,a=i&er.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new wo(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 cZ(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function u$(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 Dkt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Td extends OTe{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new Td(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&er.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new Td(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Td(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Td(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let a=i.buffer[this.index+1];t.push(i.slice(r,s,a)),n.push(0)}return new hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function STe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new wo(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(XS(l,t,n,!1))}}return r?STe(r):i}class AN{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~er.EnterBracketed,t instanceof wo)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 wo?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&er.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&er.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&er.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,a=t<0?-1:i._tree.children.length;s!=a;s+=t){let l=i._tree.children[s];if(this.mode&er.IncludeAnonymous||l instanceof km||!l.type.isAnonymous||UU(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let a=t;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return u$(this._tree,t,r);let a=i[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(t[r]&&t[r]!=a.name)return!1;r--}}return!0}}function UU(e){return e.children.some(t=>t instanceof km||!t.type.isAnonymous||UU(t))}function $kt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=xTe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new BU(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,E,C,N,_){let{id:j,start:A,end:F,size:T}=l,P=d,R=u;if(T<0)if(l.next(),T==-1){let H=s[j];E.push(H),C.push(A-k);return}else if(T==-3){u=j;return}else if(T==-4){d=j;return}else throw new RangeError(`Unrecognized record size: ${T}`);let L=c[j],M,U,I=A-k;if(F-A<=r&&(U=v(l.pos-S,N))){let H=new Uint16Array(U.size-U.skip),K=l.pos-U.size,Q=H.length;for(;l.pos>K;)Q=y(U.start,H,Q);M=new km(H,F-U.start,i),I=U.start-k}else{let H=l.pos-T;l.next();let K=[],Q=[],q=j>=a?j:-1,B=0,ee=F;for(;l.pos>H;)q>=0&&l.id==q&&l.size>=0?(l.end<=ee-r&&(g(K,Q,A,B,l.end,ee,q,P,R),B=K.length,ee=l.end),l.next()):_>2500?h(A,H,K,Q):f(A,H,K,Q,q,_+1);if(q>=0&&B>0&&B-1&&B>0){let le=m(L,R);M=QU(L,K,Q,0,K.length,0,F-A,le,le)}else M=b(L,K,Q,F-A,P-F,R)}E.push(M),C.push(I)}function h(k,S,E,C){let N=[],_=0,j=-1;for(;l.pos>S;){let{id:A,start:F,end:T,size:P}=l;if(P>4)l.next();else{if(j>-1&&F=0;T-=3)A[P++]=N[T],A[P++]=N[T+1]-F,A[P++]=N[T+2]-F,A[P++]=P;E.push(new km(A,N[2]-F,i)),C.push(F-k)}}function m(k,S){return(E,C,N)=>{let _=0,j=E.length-1,A,F;if(j>=0&&(A=E[j])instanceof hi){if(!j&&A.type==k&&A.length==N)return A;(F=A.prop(Ln.lookAhead))&&(_=C[j]+A.length+F)}return b(k,E,C,N,_,S)}}function g(k,S,E,C,N,_,j,A,F){let T=[],P=[];for(;k.length>C;)T.push(k.pop()),P.push(S.pop()+E-N);k.push(b(i.types[j],T,P,_-N,A-_,F)),S.push(N-E)}function b(k,S,E,C,N,_,j){if(_){let A=[Ln.contextHash,_];j=j?[A].concat(j):[A]}if(N>25){let A=[Ln.lookAhead,N];j=j?[A].concat(j):[A]}return new hi(k,S,E,C,j)}function v(k,S){let E=l.fork(),C=0,N=0,_=0,j=E.end-r,A={size:0,start:0,skip:0};e:for(let F=E.pos-k;E.pos>F;){let T=E.size;if(E.id==S&&T>=0){A.size=C,A.start=N,A.skip=_,_+=4,C+=4,E.next();continue}let P=E.pos-T;if(T<0||P=a?4:0,L=E.start;for(E.next();E.pos>P;){if(E.size<0)if(E.size==-3||E.size==-4)R+=4;else break e;else E.id>=a&&(R+=4);E.next()}N=L,C+=T,_+=R}return(S<0||C==k)&&(A.size=C,A.start=N,A.skip=_),A.size>4?A:void 0}function y(k,S,E){let{id:C,start:N,end:_,size:j}=l;if(l.next(),j>=0&&C4){let F=l.pos-(j-4);for(;l.pos>F;)E=y(k,S,E)}S[--E]=A,S[--E]=_-k,S[--E]=N-k,S[--E]=C}else j==-3?u=C:j==-4&&(d=C);return E}let x=[],O=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,x,O,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:x.length?O[0]+x[0].length:0;return new hi(c[e.topID],x.reverse(),O.reverse(),w)}const uZ=new WeakMap;function TA(e,t){if(!e.isAnonymous||t instanceof km||t.type!=e)return 1;let n=uZ.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof hi)){n=1;break}n+=TA(e,i)}uZ.set(t,n)}return n}function QU(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;S+=E}if(O==w+1){if(S>d){let E=g[w];m(E.children,E.positions,0,E.children.length,b[w]+x);continue}f.push(g[w])}else{let E=b[O-1]+g[O-1].length-k;f.push(QU(e,g,b,w,O,k,E,null,c))}h.push(k+x-s)}}return m(t,n,i,r,0),(l||c)(f,h,a)}class zU{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof Td?this.setBuffer(t.context.buffer,t.index,n):t instanceof wo&&this.map.set(t.tree,n)}get(t){return t instanceof Td?this.getBuffer(t.context.buffer,t.index):t instanceof wo?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class uh{constructor(t,n,i,r,s=!1,a=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new uh(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,a=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;a&&a.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new uh(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew Wc(r.from,r.to)):[new Wc(0,0)]:[new Wc(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class Fkt{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 kTe(e){return(t,n,i,r)=>new Ukt(t,e,n,i,r)}class dZ{constructor(t,n,i,r,s,a){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=a}}function fZ(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Bkt{constructor(t,n,i,r,s,a,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=a,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const d$=new Ln({perNode:!0});class Ukt{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([[d$,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[Ln.mounted.id]=new lv(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=Qkt(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Wc(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new Wc(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=mZ(this.ranges,n.ranges);u.length&&(fZ(u),this.inner.splice(n.index,0,new dZ(n.parser,n.parser.startParse(this.input,gZ(n.mounts,u),u),n.ranges.map(d=>new Wc(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function Qkt(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 hZ(e,t,n,i,r,s){if(t=t&&n.enter(i,1,er.IgnoreOverlays|er.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof hi)n=n.children[0];else break}return!1}}let Vkt=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(d$))!==null&&n!==void 0?n:i.to,this.inner=new pZ(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(d$))!==null&&t!==void 0?t:n.to,this.inner=new pZ(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(i=s.tree)===null||i===void 0?void 0:i.prop(Ln.mounted);if(a&&a.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:a})}}}return r}};function mZ(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=a||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new Wc(l,c.to))):c.to>l?n[s--]=new Wc(l,c.to):n.splice(s--,1))}}return i}function Hkt(e,t,n,i){let r=0,s=0,a=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:a?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew Wc(h.from+i,h.to+i)),f=Hkt(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 uh(m,b,r.tree,-a,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new uh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let f$=[],ETe=[];(()=>{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=ETe[i])t=i+1;else return!0;if(t==n)return!1}}function bZ(e){return e>=127462&&e<=127487}const yZ=8205;function Wkt(e,t,n=!0,i=!0){return(n?CTe:Gkt)(e,t,i)}function CTe(e,t,n){if(t==e.length)return t;t&&TTe(e.charCodeAt(t))&&ATe(e.charCodeAt(t-1))&&t--;let i=i5(e,t);for(t+=vZ(i);t=0&&bZ(i5(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function Gkt(e,t,n){for(;t>1;){let i=CTe(e,t-2,n);if(i=56320&&e<57344}function ATe(e){return e>=55296&&e<56320}function vZ(e){return e<65536?1:2}let Gi=class _Te{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=ix(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),yd.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ix(this,t,n);let i=[];return this.decompose(t,n,i,0),yd.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new LO(this),s=new LO(t);for(let a=n,l=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new LO(this,t)}iterRange(t,n=this.length){return new NTe(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 jTe(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]?_Te.empty:t.length<=32?new Ps(t):yd.from(Ps.split(t,[]))}};class Ps extends Gi{constructor(t,n=Kkt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((n?i:l)>=t)return new Xkt(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Ps(xZ(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=AA(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new Ps(l,a.length+s.length));else{let c=l.length>>1;i.push(new Ps(l.slice(0,c)),new Ps(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Ps))return super.replace(t,n,i);[t,n]=ix(this,t,n);let r=AA(this.text,AA(i.text,xZ(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Ps(r,s):yd.from(Ps.split(r,[]),s)}sliceString(t,n=this.length,i=` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function Rkt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Nkt||null,prettyErrors:t}}function xTe(e,t={}){const{lineCounter:n,prettyErrors:i}=Rkt(t),r=new jkt(n==null?void 0:n.addNewLine),s=new Ekt(t);let a=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Qw(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(nZ(e,n)),a.warnings.forEach(nZ(e,n))),a}function Ikt(e,t,n){let i;const r=xTe(e,n);if(!r)return null;if(r.warnings.forEach(s=>VCe(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 FU(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return AE(e)&&!i?e.toString(n):new RE(e,i,n).toString(n)}const wTe=1024;let Pkt=0,Wc=class{constructor(t,n){this.from=t,this.to=n}};class Ln{constructor(t={}){this.id=Pkt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ea.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}Ln.closedBy=new Ln({deserialize:e=>e.split(" ")});Ln.openedBy=new Ln({deserialize:e=>e.split(" ")});Ln.group=new Ln({deserialize:e=>e.split(" ")});Ln.isolate=new Ln({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ln.contextHash=new Ln({perNode:!0});Ln.lookAhead=new Ln({perNode:!0});Ln.mounted=new Ln({perNode:!0});class lv{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[Ln.mounted.id]}}const Dkt=Object.create(null);class ea{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Dkt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new ea(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ln.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(Ln.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}ea.none=new ea("",Object.create(null),0,8);class t1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|er.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:QU(ea.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new hi(ea.none,n,i,r)))}static build(t){return Fkt(t)}}hi.empty=new hi(ea.none,[],[],0);class BU{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 BU(this.buffer,this.index)}}class km{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return ea.none}toString(){let t=[];for(let n=0;n0));c=a[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),a=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function XS(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+a.from,h;if(!(!(s&er.EnterBracketed&&d instanceof hi&&(h=lv.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!OTe(r,i,f,f+d.length))){if(d instanceof km){if(s&er.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new Td(new Mkt(a,d,t,f),null,m)}else if(s&er.IncludeAnonymous||!d.type.isAnonymous||UU(d)){let m;if(!(s&er.IgnoreMounts)&&(m=lv.get(d))&&!m.overlay)return new wo(m.tree,f,t,a);let g=new wo(d,f,t,a);return s&er.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&er.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&er.IgnoreOverlays)&&(r=lv.get(this._tree))&&r.overlay){let s=t-this.from,a=i&er.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new wo(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 cZ(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function u$(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 Mkt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Td extends STe{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new Td(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&er.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new Td(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Td(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Td(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let a=i.buffer[this.index+1];t.push(i.slice(r,s,a)),n.push(0)}return new hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function kTe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new wo(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(XS(l,t,n,!1))}}return r?kTe(r):i}class AN{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~er.EnterBracketed,t instanceof wo)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 wo?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&er.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&er.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&er.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,a=t<0?-1:i._tree.children.length;s!=a;s+=t){let l=i._tree.children[s];if(this.mode&er.IncludeAnonymous||l instanceof km||!l.type.isAnonymous||UU(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let a=t;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return u$(this._tree,t,r);let a=i[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(t[r]&&t[r]!=a.name)return!1;r--}}return!0}}function UU(e){return e.children.some(t=>t instanceof km||!t.type.isAnonymous||UU(t))}function Fkt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=wTe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new BU(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,E,C,N,_){let{id:j,start:A,end:F,size:T}=l,P=d,R=u;if(T<0)if(l.next(),T==-1){let H=s[j];E.push(H),C.push(A-k);return}else if(T==-3){u=j;return}else if(T==-4){d=j;return}else throw new RangeError(`Unrecognized record size: ${T}`);let L=c[j],M,U,I=A-k;if(F-A<=r&&(U=v(l.pos-S,N))){let H=new Uint16Array(U.size-U.skip),K=l.pos-U.size,Q=H.length;for(;l.pos>K;)Q=y(U.start,H,Q);M=new km(H,F-U.start,i),I=U.start-k}else{let H=l.pos-T;l.next();let K=[],Q=[],q=j>=a?j:-1,B=0,ee=F;for(;l.pos>H;)q>=0&&l.id==q&&l.size>=0?(l.end<=ee-r&&(g(K,Q,A,B,l.end,ee,q,P,R),B=K.length,ee=l.end),l.next()):_>2500?h(A,H,K,Q):f(A,H,K,Q,q,_+1);if(q>=0&&B>0&&B-1&&B>0){let le=m(L,R);M=QU(L,K,Q,0,K.length,0,F-A,le,le)}else M=b(L,K,Q,F-A,P-F,R)}E.push(M),C.push(I)}function h(k,S,E,C){let N=[],_=0,j=-1;for(;l.pos>S;){let{id:A,start:F,end:T,size:P}=l;if(P>4)l.next();else{if(j>-1&&F=0;T-=3)A[P++]=N[T],A[P++]=N[T+1]-F,A[P++]=N[T+2]-F,A[P++]=P;E.push(new km(A,N[2]-F,i)),C.push(F-k)}}function m(k,S){return(E,C,N)=>{let _=0,j=E.length-1,A,F;if(j>=0&&(A=E[j])instanceof hi){if(!j&&A.type==k&&A.length==N)return A;(F=A.prop(Ln.lookAhead))&&(_=C[j]+A.length+F)}return b(k,E,C,N,_,S)}}function g(k,S,E,C,N,_,j,A,F){let T=[],P=[];for(;k.length>C;)T.push(k.pop()),P.push(S.pop()+E-N);k.push(b(i.types[j],T,P,_-N,A-_,F)),S.push(N-E)}function b(k,S,E,C,N,_,j){if(_){let A=[Ln.contextHash,_];j=j?[A].concat(j):[A]}if(N>25){let A=[Ln.lookAhead,N];j=j?[A].concat(j):[A]}return new hi(k,S,E,C,j)}function v(k,S){let E=l.fork(),C=0,N=0,_=0,j=E.end-r,A={size:0,start:0,skip:0};e:for(let F=E.pos-k;E.pos>F;){let T=E.size;if(E.id==S&&T>=0){A.size=C,A.start=N,A.skip=_,_+=4,C+=4,E.next();continue}let P=E.pos-T;if(T<0||P=a?4:0,L=E.start;for(E.next();E.pos>P;){if(E.size<0)if(E.size==-3||E.size==-4)R+=4;else break e;else E.id>=a&&(R+=4);E.next()}N=L,C+=T,_+=R}return(S<0||C==k)&&(A.size=C,A.start=N,A.skip=_),A.size>4?A:void 0}function y(k,S,E){let{id:C,start:N,end:_,size:j}=l;if(l.next(),j>=0&&C4){let F=l.pos-(j-4);for(;l.pos>F;)E=y(k,S,E)}S[--E]=A,S[--E]=_-k,S[--E]=N-k,S[--E]=C}else j==-3?u=C:j==-4&&(d=C);return E}let x=[],O=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,x,O,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:x.length?O[0]+x[0].length:0;return new hi(c[e.topID],x.reverse(),O.reverse(),w)}const uZ=new WeakMap;function TA(e,t){if(!e.isAnonymous||t instanceof km||t.type!=e)return 1;let n=uZ.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof hi)){n=1;break}n+=TA(e,i)}uZ.set(t,n)}return n}function QU(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;S+=E}if(O==w+1){if(S>d){let E=g[w];m(E.children,E.positions,0,E.children.length,b[w]+x);continue}f.push(g[w])}else{let E=b[O-1]+g[O-1].length-k;f.push(QU(e,g,b,w,O,k,E,null,c))}h.push(k+x-s)}}return m(t,n,i,r,0),(l||c)(f,h,a)}class zU{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof Td?this.setBuffer(t.context.buffer,t.index,n):t instanceof wo&&this.map.set(t.tree,n)}get(t){return t instanceof Td?this.getBuffer(t.context.buffer,t.index):t instanceof wo?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class uh{constructor(t,n,i,r,s=!1,a=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new uh(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,a=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;a&&a.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new uh(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew Wc(r.from,r.to)):[new Wc(0,0)]:[new Wc(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class Bkt{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 ETe(e){return(t,n,i,r)=>new Qkt(t,e,n,i,r)}class dZ{constructor(t,n,i,r,s,a){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=a}}function fZ(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Ukt{constructor(t,n,i,r,s,a,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=a,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const d$=new Ln({perNode:!0});class Qkt{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([[d$,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[Ln.mounted.id]=new lv(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=zkt(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Wc(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new Wc(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=mZ(this.ranges,n.ranges);u.length&&(fZ(u),this.inner.splice(n.index,0,new dZ(n.parser,n.parser.startParse(this.input,gZ(n.mounts,u),u),n.ranges.map(d=>new Wc(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function zkt(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 hZ(e,t,n,i,r,s){if(t=t&&n.enter(i,1,er.IgnoreOverlays|er.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof hi)n=n.children[0];else break}return!1}}let Hkt=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(d$))!==null&&n!==void 0?n:i.to,this.inner=new pZ(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(d$))!==null&&t!==void 0?t:n.to,this.inner=new pZ(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(i=s.tree)===null||i===void 0?void 0:i.prop(Ln.mounted);if(a&&a.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:a})}}}return r}};function mZ(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=a||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new Wc(l,c.to))):c.to>l?n[s--]=new Wc(l,c.to):n.splice(s--,1))}}return i}function qkt(e,t,n,i){let r=0,s=0,a=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:a?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew Wc(h.from+i,h.to+i)),f=qkt(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 uh(m,b,r.tree,-a,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new uh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let f$=[],CTe=[];(()=>{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=CTe[i])t=i+1;else return!0;if(t==n)return!1}}function bZ(e){return e>=127462&&e<=127487}const yZ=8205;function Gkt(e,t,n=!0,i=!0){return(n?TTe:Kkt)(e,t,i)}function TTe(e,t,n){if(t==e.length)return t;t&&ATe(e.charCodeAt(t))&&_Te(e.charCodeAt(t-1))&&t--;let i=i5(e,t);for(t+=vZ(i);t=0&&bZ(i5(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function Kkt(e,t,n){for(;t>1;){let i=TTe(e,t-2,n);if(i=56320&&e<57344}function _Te(e){return e>=55296&&e<56320}function vZ(e){return e<65536?1:2}let Gi=class NTe{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=ix(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),yd.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ix(this,t,n);let i=[];return this.decompose(t,n,i,0),yd.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new LO(this),s=new LO(t);for(let a=n,l=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new LO(this,t)}iterRange(t,n=this.length){return new jTe(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 RTe(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]?NTe.empty:t.length<=32?new Ps(t):yd.from(Ps.split(t,[]))}};class Ps extends Gi{constructor(t,n=Xkt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((n?i:l)>=t)return new Ykt(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Ps(xZ(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=AA(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new Ps(l,a.length+s.length));else{let c=l.length>>1;i.push(new Ps(l.slice(0,c)),new Ps(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Ps))return super.replace(t,n,i);[t,n]=ix(this,t,n);let r=AA(this.text,AA(i.text,xZ(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Ps(r,s):yd.from(Ps.split(r,[]),s)}sliceString(t,n=this.length,i=` `){[t,n]=ix(this,t,n);let r="";for(let s=0,a=0;s<=n&&at&&a&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new Ps(i,r)),i=[],r=-1);return r>-1&&n.push(new Ps(i,r)),n}}class yd extends Gi{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.children[s],l=r+a.length,c=i+a.lines-1;if((n?c:l)>=t)return a.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,a=0;a<=n&&s=a){let u=r&((a<=t?1:0)|(c>=n?2:0));a>=t&&c<=n&&!u?i.push(l):l.decompose(t-a,n-a,i,u)}a=c+1}}replace(t,n,i){if([t,n]=ix(this,t,n),i.lines=s&&n<=l){let c=a.replace(t-s,n-s,i),u=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new yd(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` -`){[t,n]=ix(this,t,n);let r="";for(let s=0,a=0;st&&s&&(r+=i),ta&&(r+=l.sliceString(t-a,n-a,i)),a=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof yd))return 0;let i=0,[r,s,a,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==a||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new Ps(m,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof yd)for(let b of m.children)f(b);else m.lines>a&&(c>a||!c)?(h(),l.push(m)):m instanceof Ps&&c&&(g=d[d.length-1])instanceof Ps&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new Ps(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]:yd.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new yd(l,n)}}Gi.empty=new Ps([""],0);function Kkt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function AA(e,t,n=0,i=1e9){for(let r=0,s=0,a=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Ps?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,l=r instanceof Ps?r.text.length:r.children.length;if(a==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(r instanceof Ps){let c=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[a+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ps?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class NTe{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new LO(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class jTe{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Gi.prototype[Symbol.iterator]=function(){return this.iter()},LO.prototype[Symbol.iterator]=NTe.prototype[Symbol.iterator]=jTe.prototype[Symbol.iterator]=function(){return this});let Xkt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function ix(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function $a(e,t,n=!0,i=!0){return Wkt(e,t,n,i)}function Ykt(e){return e>=56320&&e<57344}function Zkt(e){return e>=55296&&e<56320}function ol(e,t){let n=e.charCodeAt(t);if(!Zkt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Ykt(i)?(n-55296<<10)+(i-56320)+65536:n}function VU(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function vd(e){return e<65536?1:2}const h$=/\r\n?|\n/;var eo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(eo||(eo={}));class Ld{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=eo.Simple&&u>=t&&(i==eo.TrackDel&&rt||i==eo.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ld(t)}static create(t){return new Ld(t)}}class ma extends Ld{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return p$(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return m$(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=a;let c=r>>1;for(;i.length0&&Qp(i,n,s.text),s.forward(d),l+=d}let u=t[a++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],a=0,l=null;function c(d=!1){if(!d&&!r.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Gi.of(m.split(i||h$)):m:Gi.empty,b=g.length;if(f==h&&b==0)return;fa&&po(r,f-a,-1),po(r,h-f,b),Qp(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new ma(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Qp(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(r,u,s,d,f),r=u,s=d}}}function m$(e,t,n,i=!1){let r=[],s=i?[]:null,a=new YS(e),l=new YS(t);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let u=Math.min(a.len,l.len);po(r,u,-1),a.forward(u),l.forward(u)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let u=0,d=a.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||i.length>u),s.forward2(c),a.forward(c)}}}}class YS{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Gi.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Gi.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class jp{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new jp(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return it.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return it.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 it.range(t.anchor,t.head)}static create(t,n,i,r){return new jp(t,n,i,r)}}class it{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:it.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 it(t.ranges.map(n=>jp.fromJSON(n)),t.main)}static single(t,n=t){return new it([it.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?it.range(c,l):it.range(l,c))}}return new it(t,n)}}function ITe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let HU=0;class Zt{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=HU++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new Zt(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:qU),!!t.static,t.enables)}of(t){return new _A([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function qU(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class _A{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=HU++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[a]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||g$(f,d)){let m=i(f);if(l?!wZ(m,f.values[a],r):!r(m,f.values[a]))return f.values[a]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=NN(h,g);if(this.dependencies.every(v=>v instanceof Zt?h.facet(v)===f.facet(v):v instanceof ro?h.field(v,!1)==f.field(v,!1):!0)||(l?wZ(m=i(f),b,r):r(m=i(f),b)))return f.values[a]=b,0}else m=i(f);return f.values[a]=m,1}}}get extension(){return this}}function wZ(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),a=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(qT).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(qT),a=r.facet(qT),l;return(l=s.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,qT.of({field:this,create:t})]}get extension(){return this}}const Ag={lowest:4,low:3,default:2,high:1,highest:0};function Y1(e){return t=>new PTe(t,e)}const zh={highest:Y1(Ag.highest),high:Y1(Ag.high),default:Y1(Ag.default),low:Y1(Ag.low),lowest:Y1(Ag.lowest)};class PTe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class vI{of(t){return new b$(this,t)}reconfigure(t){return vI.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class b${constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class _N{constructor(t,n,i,r,s,a){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),a=new Map;for(let h of eEt(t,n,a))h instanceof ro?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(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,qU(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=>Jkt(v,g,m))}}let f=u.map(h=>h(l));return new _N(t,a,f,l,c,s)}}function eEt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(a,l){let c=r.get(a);if(c!=null){if(c<=l)return;let u=i[c].indexOf(a);u>-1&&i[c].splice(u,1),a instanceof b$&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof b$){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(a.compartment)||a.inner;n.set(a.compartment,u),s(u,l)}else if(a instanceof PTe)s(a.inner,a.prec);else if(a instanceof ro)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof _A)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,Ag.default);else{let u=a.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(u==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,Ag.default),i.reduce((a,l)=>a.concat(l))}function $O(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function NN(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const DTe=Zt.define(),y$=Zt.define({combine:e=>e.some(t=>t),static:!0}),MTe=Zt.define({combine:e=>e.length?e[0]:void 0,static:!0}),LTe=Zt.define(),$Te=Zt.define(),FTe=Zt.define(),BTe=Zt.define({combine:e=>e.length?e[0]:!1});class Jd{constructor(t,n){this.type=t,this.value=n}static define(){return new tEt}}class tEt{of(t){return new Jd(this,t)}}class nEt{constructor(t){this.map=t}of(t){return new Fn(this,t)}}class Fn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Fn(this.type,n)}is(t){return this.type==t}static define(t={}){return new nEt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}Fn.reconfigure=Fn.define();Fn.appendConfig=Fn.define();class Js{constructor(t,n,i,r,s,a){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&ITe(i,n.newLength),s.some(l=>l.type==Js.time)||(this.annotations=s.concat(Js.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Js(t,n,i,r,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Js.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Js.time=Jd.define();Js.userEvent=Jd.define();Js.addToHistory=Jd.define();Js.remote=Jd.define();function iEt(e,t){let n=[];for(let i=0,r=0;;){let s,a;if(i=e[i]))s=e[i++],a=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Js?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Js?e=s[0]:e=QTe(t,cv(s),!1)}return e}function sEt(e){let t=e.startState,n=t.facet(FTe),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=UTe(i,v$(t,s,e.changes.newLength),!0))}return i==e?e:Js.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const aEt=[];function cv(e){return e==null?aEt:Array.isArray(e)?e:[e]}var ns=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ns||(ns={}));const oEt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let x$;try{x$=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function lEt(e){if(x$)return x$.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||oEt.test(n)))return!0}return!1}function cEt(e){return t=>{if(!/\S/.test(t))return ns.Space;if(lEt(t))return ns.Word;for(let n=0;n-1)return ns.Word;return ns.Other}}class Ti{constructor(t,n,i,r,s,a){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(Fn.reconfigure)?(n=null,i=l.value):l.is(Fn.appendConfig)&&(n=null,i=cv(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=_N.resolve(i,r,this),s=new Ti(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(y$)?t.newSelection:t.newSelection.asSingle();new Ti(n,t.newDoc,a,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:it.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=cv(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Ti.create({doc:t.doc,selection:it.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=_N.resolve(t.extensions||[],new Map),i=t.doc instanceof Gi?t.doc:Gi.of((t.doc||"").split(n.staticFacet(Ti.lineSeparator)||h$)),r=t.selection?t.selection instanceof it?t.selection:it.single(t.selection.anchor,t.selection.head):it.single(0);return ITe(r,i.length),n.staticFacet(y$)||(r=r.asSingle()),new Ti(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Ti.tabSize)}get lineBreak(){return this.facet(Ti.lineSeparator)||` -`}get readOnly(){return this.facet(BTe)}phrase(t,...n){for(let i of this.facet(Ti.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(DTe))for(let a of s(this,n,i))Object.prototype.hasOwnProperty.call(a,t)&&r.push(a[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return cEt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),a=t-i,l=t-i;for(;a>0;){let c=$a(n,a,!1);if(s(n.slice(c,a))!=ns.Word)break;a=c}for(;le.length?e[0]:4});Ti.lineSeparator=MTe;Ti.readOnly=BTe;Ti.phrases=Zt.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});Ti.languageData=DTe;Ti.changeFilter=LTe;Ti.transactionFilter=$Te;Ti.transactionExtender=FTe;vI.reconfigure=Fn.define();function ef(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let a=r[s],l=i[s];if(l===void 0)i[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class Em{eq(t){return this==t}range(t,n=t){return ZS.create(t,n,this)}}Em.prototype.startSide=Em.prototype.endSide=0;Em.prototype.point=!1;Em.prototype.mapMode=eo.TrackDel;function WU(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class ZS{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new ZS(t,n,i)}}function w$(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class GU{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let c=a+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return u>=0?a:l;u>=0?l=c:a=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-a),s.push(m-a))}return{mapped:i.length?new GU(r,s,i,l):null,pos:a}}}class xi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new xi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,a=t.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(w$)),this.isEmpty)return n.length?xi.of(n):this;let l=new zTe(this,null,-1).goto(0),c=0,u=[],d=new Ah;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+a.length&&a.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return JS.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return JS.from(t).goto(n)}static compare(t,n,i,r,s=-1){let a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=OZ(a,l,i),u=new Z1(a,c,s),d=new Z1(l,c,s);i.iterGaps((f,h,m)=>SZ(u,f,d,h,m,r)),i.empty&&i.length==0&&SZ(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),a=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=OZ(s,a),c=new Z1(s,l,0).goto(i),u=new Z1(a,l,0).goto(i);for(;;){if(c.to!=u.to||!O$(c.active,u.active)||c.point&&(!u.point||!WU(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let a=new Z1(t,null,s).goto(n),l=n,c=a.openStart;for(;;){let u=Math.min(a.to,i);if(a.point){let d=a.activeForPoint(a.to),f=a.pointFroml&&(r.span(l,u,a.active,c),c=a.openEnd(u));if(a.to>i)return c+(a.point&&a.to>i?1:0);l=a.to,a.next()}}static of(t,n=!1){let i=new Ah;for(let r of t instanceof ZS?[t]:n?uEt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return xi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=xi.empty;r=r.nextLayer)n=new xi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}xi.empty=new xi([],[],null,-1);function uEt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(w$);t=i}return e}xi.empty.nextLayer=xi.empty;class Ah{finishChunk(t){this.chunks.push(new GU(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new Ah)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(xi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=xi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function OZ(e,t,n){let i=new Map;for(let s of e)for(let a=0;a=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new zTe(a,n,i,s));return r.length==1?r[0]:new JS(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)r5(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--)r5(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(),r5(this.heap,0)}}}function r5(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Z1{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=JS.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){WT(this.active,t),WT(this.activeTo,t),WT(this.activeRank,t),this.minActive=kZ(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;GT(this.active,n,i),GT(this.activeTo,n,r),GT(this.activeRank,n,s),t&>(t,n,this.cursor.from),this.minActive=kZ(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&WT(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function SZ(e,t,n,i,r,s){e.goto(t),n.goto(i);let a=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,a);if(e.point||n.point?(e.point&&n.point&&WU(e.point,n.point)&&O$(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!O$(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function O$(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 kZ(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=$a(e,r)}return i===!0?-1:e.length}const k$="ͼ",EZ=typeof Symbol>"u"?"__"+k$:Symbol.for(k$),E$=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),CZ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Cm{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,c,u){let d=[],f=/^@(\w+)\b/.exec(a[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(a[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>a.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?a.map(i):a).join(", ")+" {"+d.join(" ")+"}")}for(let a in t)s(r(a),t[a],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=CZ[EZ]||1;return CZ[EZ]=t+1,k$+t.toString(36)}static mount(t,n,i){let r=t[E$],s=i&&i.nonce;r?s&&r.setNonce(s):r=new dEt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let TZ=new Map;class dEt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=TZ.get(i);if(s)return t[E$]=s;this.sheet=new r.CSSStyleSheet,TZ.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[E$]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let a=0;a-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fEt=typeof navigator<"u"&&/Mac/.test(navigator.platform),hEt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ya=0;Ya<10;Ya++)Tm[48+Ya]=Tm[96+Ya]=String(Ya);for(var Ya=1;Ya<=24;Ya++)Tm[Ya+111]="F"+Ya;for(var Ya=65;Ya<=90;Ya++)Tm[Ya]=String.fromCharCode(Ya+32),ek[Ya]=String.fromCharCode(Ya);for(var s5 in Tm)ek.hasOwnProperty(s5)||(ek[s5]=Tm[s5]);function pEt(e){var t=fEt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||hEt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ek:Tm)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var Xt={mac:NZ||/Mac/.test(Do.platform),windows:/Win/.test(Do.platform),linux:/Linux|X11/.test(Do.platform),ie:xI,ie_version:HTe?C$.documentMode||6:A$?+A$[1]:T$?+T$[1]:0,gecko:AZ,gecko_version:AZ?+(/Firefox\/(\d+)/.exec(Do.userAgent)||[0,0])[1]:0,chrome:!!a5,chrome_version:a5?+a5[1]:0,ios:NZ,android:/Android\b/.test(Do.userAgent),webkit:_Z,webkit_version:_Z?+(/\bAppleWebKit\/(\d+)/.exec(Do.userAgent)||[0,0])[1]:0,safari:_$,safari_version:_$?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Do.userAgent)||[0,0])[1]:0,tabSize:C$.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function KU(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const jN=Object.create(null);function XU(e,t,n){if(e==t)return!0;e||(e=jN),t||(t=jN);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function mEt(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 jZ(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 gEt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Nb(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:a}=qTe(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Nb(t,i,r,n,t.widget||null,!0)}static line(t){return new DE(t)}static set(t,n=!1){return xi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gn.none=xi.empty;class PE extends gn{constructor(t){let{start:n,end:i}=qTe(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?KU(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||jN}eq(t){return this==t||t instanceof PE&&this.tagName==t.tagName&&XU(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}PE.prototype.point=!1;class DE extends gn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof DE&&this.spec.class==t.spec.class&&XU(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}DE.prototype.mapMode=eo.TrackBefore;DE.prototype.point=!0;class Nb extends gn{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?eo.TrackBefore:eo.TrackAfter:eo.TrackDel}get type(){return this.startSide!=this.endSide?io.WidgetRange:this.startSide<=0?io.WidgetBefore:io.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Nb&&bEt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Nb.prototype.point=!0;function qTe(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 bEt(e,t){return e==t||!!(e&&t&&e.compare(t))}function uv(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class tk extends Em{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof tk&&this.tagName==t.tagName&&XU(this.attributes,t.attributes)}static create(t){return new tk(t.tagName,t.attributes||jN,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return xi.of(t,n)}}tk.prototype.startSide=tk.prototype.endSide=-1;function nk(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function N$(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function FO(e,t){if(!t.anchorNode)return!1;try{return N$(e,t.anchorNode)}catch{return!1}}function BO(e){return e.nodeType==3?rk(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function UO(e,t,n,i){return n?RZ(e,t,n,i,-1)||RZ(e,t,n,i,1):!1}function Am(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function RN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function RZ(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:_h(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=Am(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?_h(e):0}else return!1}}function _h(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ik(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function yEt(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 WTe(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 vEt(e,t,n,i,r,s,a,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=yEt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let x=d.getBoundingClientRect();({scaleX:g,scaleY:b}=WTe(d,x)),h={left:x.left,right:x.left+d.clientWidth*g,top:x.top,bottom:x.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+a)):t.bottom>h.bottom-a&&(y=t.bottom-h.bottom+a,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function GTe(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 xEt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?_h(n):0),i,Math.min(t.focusOffset,i?_h(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let kg=null;Xt.safari&&Xt.safari_version>=26&&(kg=!1);function KTe(e){if(e.setActive)return e.setActive();if(kg)return e.focus(kg);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(kg==null?{get preventScroll(){return kg={preventScroll:!0},!0}}:void 0),!kg){kg=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function YTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=_h(n)}else if(n.parentNode&&!RN(n))i=Am(n),n=n.parentNode;else return null}}function ZTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return a;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function t2e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(od[b+1]==-m){let v=od[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Er[f]=Er[od[b]]=y),l=b;break}}else{if(od.length==189)break;od[l++]=f,od[l++]=h,od[l++]=c}else if((g=Er[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=od[v+2];if(y&2)break;if(b)od[v+2]|=2;else{if(y&4)break;od[v+2]|=4}}}}}function AEt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let a=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),Er[--g]=m;c=d}else s=u,c++}}}function R$(e,t,n,i,r,s,a){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&a.push(new Ad(c,b.from,m));let v=b.direction==jb!=!(m%2);I$(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Er[g]!=l:Er[g]==l))break;g++}h?R$(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Er[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,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(Er[v-1]==l)break e;break}}if(h)h.push(b);else{b.toEr.length;)Er[Er.length]=256;let i=[],r=t==jb?0:1;return I$(e,r,r,n,0,e.length,i),i}function n2e(e){return[new Ad(0,e,0)]}let i2e="";function NEt(e,t,n,i,r){var s;let a=i.head-e.from,l=Ad.find(t,a,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(a==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],a=c.side(!r,n),u=c.side(r,n)}let d=$a(e.text,a,c.forward(r,n));(dc.to)&&(d=u),i2e=e.text.slice(Math.min(a,d),Math.max(a,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),d2e=Zt.define({combine:e=>e.some(t=>t)}),f2e=Zt.define();class fv{constructor(t,n,i,r,s,a=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(t){return t.empty?this:new fv(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fv(it.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const KT=Fn.define({map:(e,t)=>e.map(t)}),h2e=Fn.define();function hl(e,t,n){let i=e.facet(o2e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const zf=Zt.define({combine:e=>e.length?e[0]:!0});let REt=0;const My=Zt.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(wI.of(u=>{let d=u.plugin(l);return d?a(d):gn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return Ts.define((i,r)=>new t(i,r),n)}}class o5{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(hl(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){hl(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){hl(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const p2e=Zt.define(),eQ=Zt.define(),wI=Zt.define(),m2e=Zt.define(),tQ=Zt.define(),ME=Zt.define(),g2e=Zt.define();function PZ(e,t){let n=e.state.facet(g2e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return xi.spans(i,t.from,t.to,{point(){},span(s,a,l,c){let u=s-t.from,d=a-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=jEt(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 b2e=Zt.define();function nQ(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(b2e)){let a=s(e);a&&(a.left!=null&&(t=Math.max(t,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}const zw=Zt.define();class Gc{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Gc(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Gc(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new IN(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const IEt=[];class Cs{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return IEt}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&&mEt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=Am(this.dom),r=this.length?t>0:n>0;return new Nu(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof SI)return t;return null}static get(t){return t.cmTile}}class OI extends Cs{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,a=0;for(let l of this.children){if(l.sync(t),a+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=DZ(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=DZ(r);this.length=a}}function DZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class SI extends OI{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Cs.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let a=i.children[r++];if(a instanceof dh)n.push(r),i=a,r=0;else{let l=s+a.length,c=t(a,s);if(c!==void 0)return c;s=l+a.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,a=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:a}}}class dh extends OI{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new dh(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class rx extends OI{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new rx(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,a=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&DEt(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-m):(mr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?Xt.chrome||Xt.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return Xt.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:ik(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Qg(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Rb extends Cs{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return ik(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;a=s[c],!(t>0?c==0:c==s.length-1||a.top0==i)}}class MEt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(a){if(!t)break;i&&i.break(),t--,a=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof ul&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(l5(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=Cs.get(c.dom);f&&f.setDOM(l5(c.dom))}let d=ul.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=Cs.get(t.text);s&&this.cache.reused.set(s,2);let a=new Qg(t.text,t.text.nodeValue);a.flags|=8,this.pos=t.range.toB,r.append(a)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=y2e);let r=rx.start(t,n||((i=this.cache.find(rx))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let a=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof ul&&l.mark.eq(a))r=l,n--;else{let c=ul.of(a,(i=this.cache.find(ul,u=>u.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!MZ(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Xt.ios&&MZ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(c5,0,32)||new Rb(c5.toDOM(),0,c5,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 LEt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.froma.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(PN,void 0,1);return i&&(i.flags=n),i||new PN(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class FEt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const DN=[Rb,rx,Qg,ul,PN,dh,SI];for(let e=0;e[]),this.index=DN.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],a=this.index[r];for(let l=0;l{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,a=0;;){let l=ar){let u=c-r;this.preserve(u,!a,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof ul&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof ul&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,a=xi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Nb){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?sx.block:sx.inline),g=QEt(u),b=this.cache.findWidget(m,c-l,g)||Rb.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=zEt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=a>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=Cs.get(r);if(r==this.view.contentDOM)break;s instanceof ul?n.push(s):s!=null&&s.isLine()?i=s:s instanceof dh||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new rx(r,y2e):i||n.push(ul.of(new PE({tagName:r.nodeName.toLowerCase(),attributes:gEt(r)}),r)))}return{line:i,marks:n}}}function MZ(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 QEt(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 y2e={class:"cm-line"};function zEt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&KU(n,e),i&&(e.class+=" "+i)),e}function VEt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof ul&&t.push(i.mark)}return t}function l5(e){let t=Cs.get(e);return t&&t.setDOM(e.cloneNode()),e}class sx extends Yu{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sx.inline=new sx("span");sx.block=new sx("div");const c5=new class extends Yu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class LZ{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=gn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new SI(t,t.contentDOM),this.updateInner([new Gc(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!JEt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?qEt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Gc(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Xt.ie||Xt.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let c=KEt(a,this.decorations,t.changes);c.length&&(i=Gc.extendWithRanges(i,c));let u=YEt(l,this.blockWrappers,t.changes);return u.length&&(i=Gc.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let a=this.tile,l=new UEt(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Cs.get(n.text)&&l.cache.reused.set(Cs.get(n.text),2),this.tile=l.run(t,n),D$(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Xt.chrome||Xt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&FO(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Xt.gecko&&c.empty&&!this.hasComposition&&HEt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Nu(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!UO(u.node,u.offset,f.anchorNode,f.anchorOffset)||!UO(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{Xt.android&&Xt.chrome&&i.contains(f.focusNode)&&ZEt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=nk(this.view.root);if(h)if(c.empty){if(Xt.gecko){let m=WEt(u.node,u.offset);if(m&&m!=3){let g=(m==1?YTe:ZTe)(u.node,u.offset);g&&(u=new Nu(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Nu(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Nu(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&UO(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=nk(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let a=_h(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;a==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?a=-1:a=1),t=l}a<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Cs.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let a=0,l=r;;a++){let c=i.children[a];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,a,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!a&&(a=u,l=t-d,c=d>t),d>t&&a)return!0}}),!i&&!a?this.domAtPos(t,n):(s&&a?i=null:c&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof u5?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let c=r(l,a);if(c)return c}if(a-=l.length,a<0)break}else if(s.isText()&&aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==Cr.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:x}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof dh)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(x+u),u=0,a)){let O=b.dom.lastChild,w=O?BO(O):[];if(w.length){let k=w[w.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}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"?Cr.RTL:Cr.LTR}measureTextSize(){let t=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,c;for(let u of a.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=BO(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=BO(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>i){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(gn.replace({widget:new u5(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return gn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(wI).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(tQ).map((s,a)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(xi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(f2e))try{if(u(this.view,t.range,t))return!0}catch(d){hl(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=nQ(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(vEt(this.view.scrollDOM,a,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){D$(this.tile)}}function D$(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)D$(i,t)}}function HEt(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 v2e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=YTe(n.focusNode,n.focusOffset),r=ZTe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Cs.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=Cs.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let a=t-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function qEt(e,t,n){let i=v2e(e,n);if(!i)return null;let{node:r,from:s,to:a}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new Gc(c.mapPos(s),c.mapPos(a),s,a),text:r}}function WEt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class u5 extends Yu{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function eCt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return it.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=$a(r.text,s,!1):l=$a(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=$a(r.text,a,!1);if(i(r.text.slice(u,a))!=c)break;a=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+S$(a,s,e.state.tabSize)}function M$(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==io.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function nCt(e,t,n,i){let r=M$(e,t.head,t.assoc||-1),s=!i||r.type!=io.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let a=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==Cr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return it.cursor(c,n?-1:1)}return it.cursor(n?r.to:r.from,n?-1:1)}function $Z(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=NEt(r,s,a,l,n),d=i2e;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 iCt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let a=i(s);return r==ns.Space&&(r=a),r==a}}function rCt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return it.cursor(r,t.assoc);let a=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)a==null&&(a=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);a==null&&(a=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+a,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=L$(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:x{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:it.cursor(i,ie.viewState.docHeight)return new xd(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==io.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==io.Text){let f=tCt(e,r,u,a,l);return new xd(f,f==u.from?1:-1)}}if(u.type!=io.Text)return c<(u.top+u.bottom)/2?new xd(u.from,1):new xd(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new sCt(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class sCt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(a.has(b)){let y=r+Math.floor(Math.random()*g);for(let x=0;x1)){if(x.bottomthis.y)(!u||u.top>x.top)&&(u=x),O=-1;else{let w=x.left>this.x?this.x-x.left:x.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==Cr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return rk(t.dom,a,l).getClientRects()});return r.after?new xd(i[r.i+1],-1):new xd(i[r.i],1)}scanTile(t,n){if(!t.length)return new xd(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:rk(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],a=i[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new xd(i[r.i+1],-1):new xd(a,1)}}const sy="￿";class aCt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ti.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=sy}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let a=Cs.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=Cs.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:RN(r))||RN(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!lCt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=a-1);i=s+a}}readNode(t){let n=Cs.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(oCt(t,i.node,i.offset)?n:0))}}function oCt(e,t,n){for(;;){if(!t||n<_h(t))return!1;if(t==e)return!0;n=Am(t)+1,t=t.parentNode}}function lCt(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let i=Cs.get(e);if(!(i!=null&&i.isWidget()))return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class FZ{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class cCt{constructor(t,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=w2e(t.docView.tile,n,i,0))){let c=s||a?[]:dCt(t),u=new aCt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=fCt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!N$(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!N$(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((Xt.ios||Xt.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(it.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=it.create([it.cursor(u,m)])}else this.newSel=it.single(d,u)}}}function w2e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let c=0,u=i,d=i;cn)return w2e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){a=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a=0?e.children[a].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function O2e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(a===8||Xt.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Gi.of(t.text.slice(s.from-l,h).split(sy))}:(m=S2e(f,t.text,u-l,d))&&(Xt.chrome&&a==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==sy+sy&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Gi.of(t.text.slice(m.from,m.toB).split(sy))})}else i&&(!e.hasFocus&&r.facet(zf)||MN(i,s))&&(i=null);if(!n&&!i)return!1;if((Xt.mac||Xt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=it.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Gi.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:Xt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=it.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Gi.of([" "])}),n)return iQ(e,n,i,a);if(i&&!MN(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=x2e(r.facet(ME).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function iQ(e,t,n,i=-1){if(Xt.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Xt.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&dv(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&dv(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&dv(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=uCt(e,t,n));return e.state.facet(l2e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function uCt(e,t,n){let i,r=e.state,s=r.selection.main,a=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(a=d)}if(a>-1)i={changes:t,selection:it.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&&v2e(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}),x=g.to-s.to;return{changes:y,range:u?it.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function S2e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(a,l));n-=a+c-s}if(a=a?s-n:0;s-=c,l=s+(l-a),a=s}else if(l=l?s-n:0;s-=c,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function dCt(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 FZ(n,i)),(r!=n||s!=i)&&t.push(new FZ(r,s))),t}function fCt(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?it.single(n+t,i+t):null}function MN(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class hCt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Xt.safari&&t.contentDOM.addEventListener("input",()=>null),Xt.gecko&&_Ct(t.contentDOM.ownerDocument)}handleEvent(t){!OCt(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=mCt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=i[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&E2e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Xt.android&&Xt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(Xt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(k2e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||gCt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&Xt.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&pCt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Xt.safari&&!Xt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function pCt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function BZ(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){hl(n.state,r)}}}function mCt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(BZ(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(BZ(i.value,c))}}for(let i in Qu)n(i).handlers.push(Qu[i]);for(let i in Vo)n(i).observers.push(Vo[i]);return t}const k2e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],gCt="dthko",E2e=[16,17,18,20,91,92,224,225],XT=6;function YT(e){return Math.max(0,e)*.7+8}function bCt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class yCt{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=GTe(t.contentDOM),this.atoms=t.state.facet(ME).map(a=>a(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Ti.allowMultipleSelections)&&vCt(t,n),this.dragging=wCt(t,n)&&A2e(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&&bCt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=nQ(this.view);t.clientX-c.left<=r+XT?n=-YT(r-t.clientX):t.clientX+c.right>=a-XT&&(n=YT(t.clientX-a)),t.clientY-c.top<=s+XT?i=-YT(s-t.clientY):t.clientY+c.bottom>=l-XT&&(i=YT(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=x2e(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 vCt(e,t){let n=e.state.facet(r2e);return n.length?n[0](t):Xt.mac?t.metaKey:t.ctrlKey}function xCt(e,t){let n=e.state.facet(s2e);return n.length?n[0](t):Xt.mac?!t.altKey:!t.ctrlKey}function wCt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=nk(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}function OCt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Cs.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Qu=Object.create(null),Vo=Object.create(null),C2e=Xt.ie&&Xt.ie_version<15||Xt.ios&&Xt.webkit_version<604;function SCt(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(),T2e(e,n.value)},50)}function kI(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function T2e(e,t){t=kI(e.state,ZU,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if($$!=null&&n.selection.ranges.every(c=>c.empty)&&$$==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((a?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:it.cursor(u.from+f.length)}})}else a?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:it.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Vo.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Xt.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vo.wheel=Vo.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Qu.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vo.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Vo.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vo.touchend=(e,t)=>{e.inputState.touchActive=!1};Qu.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(a2e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=ECt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new yCt(e,t,n,i)),i&&e.observer.ignore(()=>{KTe(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 UZ(e,t,n,i){if(i==1)return it.cursor(t,n);if(i==2)return eCt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(zZ+1)%3:1}function ECt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=A2e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,a,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=UZ(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=UZ(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=CCt(r,c.pos))?u:l?r.addRange(d):it.create([d])}}}function CCt(e,t){for(let n=0;n=t)return it.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Qu.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=n.to||a<=n.from)&&(n=it.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",kI(e.state,JU,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Qu.dragend=e=>(e.inputState.draggedContent=null,!1);function HZ(e,t,n,i){if(n=kI(e.state,ZU,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&xCt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Qu.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&HZ(e,t,i.filter(a=>a!=null).join(e.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return HZ(e,t,i,!0),!0}return!1};Qu.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=C2e?null:t.clipboardData;return n?(T2e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(SCt(e),!1)};function TCt(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 ACt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let a=e.doc.lineAt(s);a.number>r&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),r=a.number}i=!0}return{text:kI(e,JU,t.join(e.lineBreak)),ranges:n,linewise:i}}let $$=null;Qu.copy=Qu.cut=(e,t)=>{if(!FO(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=ACt(e.state);if(!n&&!r)return!1;$$=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=C2e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(TCt(e,n),!1)};const _2e=Jd.define();function N2e(e,t){let n=[];for(let i of e.facet(c2e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:_2e.of(!0)}):null}function j2e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=N2e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vo.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),j2e(e)};Vo.blur=e=>{e.observer.clearSelectionRange(),j2e(e)};Vo.compositionstart=Vo.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vo.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Xt.chrome&&Xt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vo.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Qu.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(s&&a.length){let l=a[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return iQ(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(Xt.chrome&&Xt.android&&(r=k2e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Xt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Xt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vo.compositionend(e,t),20),!1};const qZ=new Set;function _Ct(e){qZ.has(e)||(qZ.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const WZ=["pre-wrap","normal","pre-line","break-spaces"];let ax=!1;function GZ(){ax=!1}class NCt{constructor(t){this.lineWrapping=t,this.doc=Gi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return WZ.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>NA&&(ax=!0),this.height=t)}replace(t,n,i){return zo.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,a=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,Ir.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,Ir.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&a(this.lineAt(0,Ir.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Hl extends R2e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new Tu(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof Hl||r instanceof Ka&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ka?r=new Hl(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):zo.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ka extends zo{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,a,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);a=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else a=this.height/s;return{firstLine:i,lastLine:r,perLine:a,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Ka?i[i.length-1]=new Ka(s.length+r):i.push(null,new Ka(r-1))}if(t>0){let s=i[0];s instanceof Ka?i[0]=new Ka(t+s.length):i.unshift(new Ka(t-1),null)}return zo.of(i)}decomposeLeft(t,n){n.push(new Ka(t-1),null)}decomposeRight(t,n){n.push(null,new Ka(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&a.push(new Ka(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;a.length&&a.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=NA&&(c=-2);let m=new Hl(d,f,h);m.outdated=!1,a.push(m),l+=d+1}l<=s&&a.push(null,new Ka(s-l).updateHeight(t,l));let u=zo.of(a);return(c<0||Math.abs(u.height-this.height)>=NA||Math.abs(c-this.heightMetrics(t,n).perLine)>=NA)&&(ax=!0),LN(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ICt extends zo{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==Ir.ByPosNoHeight?Ir.ByPosNoHeight:Ir.ByPos;return c?u.join(this.right.lineAt(l,d,i,a,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,a){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,a);else{let u=this.lineAt(c,Ir.ByPos,i,r,s);t=t&&u.from<=n&&a(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,a)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let a=s.length;for(let l of i)s.push(l);if(t>0&&KZ(s,a-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?zo.of(this.break?[t,null,n]:[t,n]):(this.left=LN(this.left,t),this.right=LN(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:a}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+a.length&&r.more?c=a=a.updateHeight(t,l,i,r):a.updateHeight(t,l,i),c?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function KZ(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Ka&&(i=e[t+1])instanceof Ka&&e.splice(t-1,3,new Ka(n.length+1+i.length))}const PCt=5;class rQ{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Hl?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Hl(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=PCt)&&this.addLineDeco(r,s,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new Hl(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Ka(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Hl)return t;let n=new Hl(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Hl)&&!this.isCovered?this.nodes.push(new Hl(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),a=Math.min(a,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function $Ct(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function FCt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class f5{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 NCt(i),this.stateDeco=ZZ(n),this.heightMap=zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle.setDoc(n.doc),[new Gc(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);t.push(new ZT(s,a))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?YZ:new sQ(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Vw(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=ZZ(this.state);let r=t.changedRanges,s=Gc.extendWithRanges(r,DCt(i,this.stateDeco,t?t.changes:ma.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);GZ(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ax)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(d2e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Cr.RTL:Cr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=WTe(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,a=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=GTe(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=XTe(this.scrollParent||t.win);let b=(this.printing?FCt:LCt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(c=!0)),!this.inView&&!this.scrollTarget&&!$Ct(t.dom))return 0;let O=l.width;if((this.contentDOMWidth!=O||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(a=!0),a||r.lineWrapping&&Math.abs(O-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();a=S>0&&r.refresh(s,S,E,C,Math.max(5,O/E),k),a&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),GZ();for(let S of this.viewports){let E=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(a?zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle,[new Gc(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new jCt(S.from,E))}ax&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new ZT(r.lineAt(a-i*1e3,Ir.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ir.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,Ir.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&s>1,a=r<<1;if(this.defaultTextDirection!=Cr.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromx));if(!v){if(fO.from<=f&&O.to>=f)){let O=n.moveToLineBoundary(it.cursor(f),!1,!0).head;O>d&&(f=O)}let y=this.gapSize(h,d,f,m),x=i||y<2e6?y:2e6;v=new f5(d,f,y,x)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,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=[];xi.spans(n,this.viewport.from,this.viewport.to,{span(s,a){i.push({from:s,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||Vw(this.heightMap.lineAt(t,Ir.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||Vw(this.heightMap.lineAt(this.scaler.fromDOM(t),Ir.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return Vw(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ZT{constructor(t,n){this.from=t,this.to=n}}function UCt(e,t,n){let i=[],r=e,s=0;return xi.spans(n,e,t,{span(){},point(a,l){a>r&&(i.push({from:r,to:a}),s+=a-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:a}=t[r],l=a-s;if(i<=l)return s+i;i-=l}}function e2(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function QCt(e,t){for(let n of e)if(t(n))return n}const YZ={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ZZ(e){let t=e.facet(wI).filter(i=>typeof i!="function"),n=e.facet(tQ).filter(i=>typeof i!="function");return n.length&&t.push(xi.join(n)),t}class sQ{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Ir.ByPos,t,0,0).top,d=n.lineAt(c,Ir.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function Vw(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Tu(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>Vw(r,t)):e._content)}const t2=Zt.define({combine:e=>e.join(" ")}),F$=Zt.define({combine:e=>e.indexOf(!0)>-1}),B$=Cm.newName(),I2e=Cm.newName(),P2e=Cm.newName(),D2e={"&light":"."+I2e,"&dark":"."+P2e};function U$(e,t,n){return new Cm(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const zCt=U$("."+B$,{"&":{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"}},D2e),VCt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},h5=Xt.ie&&Xt.ie_version<=11;class HCt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new xEt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Xt.ie&&Xt.ie_version<=11||Xt.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Xt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Xt.chrome&&Xt.chrome_version<126)&&(this.editContext=new WCt(t),t.state.facet(zf)&&(t.contentDOM.editContext=this.editContext.editContext)),h5&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(zf)?i.root.activeElement!=this.dom:!FO(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Xt.ie&&Xt.ie_version<=11||Xt.android&&Xt.chrome)&&!i.state.selection.main.empty&&r.focusNode&&UO(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=nk(t.root);if(!n)return!1;let i=Xt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&qCt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=FO(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&dv(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&FO(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new cCt(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=O2e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!MN(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=JZ(n,t.previousSibling||t.target.previousSibling,-1),r=JZ(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(zf)!=t.state.facet(zf)&&(t.view.contentDOM.editContext=t.state.facet(zf)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function JZ(e,t,n){for(;t;){let i=Cs.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function eJ(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return UO(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function qCt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return eJ(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?eJ(e,n):null}class WCt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=S2e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=it.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));MN(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Gi.of(i.text.slice(d.from,d.toB).split(` -`))};if((Xt.mac||Xt.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Gi.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);iQ(t,f,it.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let a=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);a{let r=[];for(let s of i.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=nk(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,a,l,c,u)=>{if(i)return;let d=u.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Ft{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||wEt(t.parent)||document,this.viewState=new XZ(this,t.state||Ti.create(t)),t.scrollTo&&t.scrollTo.is(KT)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(My).map(r=>new o5(r));for(let r of this.plugins)r.update(this);this.observer=new HCt(this),this.inputState=new hCt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new LZ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Js?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(_2e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=N2e(s,a),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ti.phrases)!=this.state.facet(Ti.phrases))return this.setState(s);r=IN.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Ft.cursorScrollMargin);f=new fv(m.empty?m:it.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(KT)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=$N.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(zw)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(t2)!=r.state.facet(t2)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(P$))try{h(r)}catch(m){hl(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!O2e(this,d)&&u.force&&dv(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new XZ(this,t),this.plugins=t.facet(My).map(i=>new o5(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new LZ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(My),i=t.state.facet(My);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new o5(s));else{let l=this.plugins[a];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(XTe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,a=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return hl(this.state,g),tJ}}),f=IN.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(Xt.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(P$))l(n)}get themeClasses(){return B$+" "+(this.state.facet(F$)?P2e:I2e)+" "+this.state.facet(t2)}updateAttrs(){let t=nJ(this,p2e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zf)?"true":"false",class:"cm-content",style:`${Xt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),nJ(this,eQ,n);let i=this.observer.ignore(()=>{let r=jZ(this.contentDOM,this.contentAttrs,n),s=jZ(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(Ft.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(zw);let t=this.state.facet(Ft.cspNonce);Cm.mount(this.root,this.styleModules.concat(zCt).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 d5(this,t,$Z(this,t,n,i))}moveByGroup(t,n){return d5(this,t,$Z(this,t,n,i=>iCt(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 it.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return nCt(this,t,n,i)}moveVertically(t,n,i){return d5(this,t,rCt(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=L$(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),L$(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Ad.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==Cr.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(u2e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>GCt)return n2e(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||t2e(s.isolates,i=PZ(this,t))))return s.order;i||(i=PZ(this,t));let r=_Et(t.text,n,i);return this.bidiCache.push(new $N(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Xt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{KTe(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,a;return KT.of(new fv(typeof t=="number"?it.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return KT.of(new fv(it.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ts.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ts.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=Cm.newName(),r=[t2.of(i),zw.of(U$(`.${i}`,t))];return n&&n.dark&&r.push(F$.of(!0)),r}static baseTheme(t){return zh.lowest(zw.of(U$("."+B$,t,D2e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&Cs.get(i)||Cs.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Ft.styleModule=zw;Ft.inputHandler=l2e;Ft.clipboardInputFilter=ZU;Ft.clipboardOutputFilter=JU;Ft.scrollHandler=f2e;Ft.focusChangeEffect=c2e;Ft.perLineTextDirection=u2e;Ft.exceptionSink=o2e;Ft.updateListener=P$;Ft.editable=zf;Ft.mouseSelectionStyle=a2e;Ft.dragMovesSelection=s2e;Ft.clickAddsSelectionRange=r2e;Ft.decorations=wI;Ft.blockWrappers=m2e;Ft.outerDecorations=tQ;Ft.atomicRanges=ME;Ft.bidiIsolatedRanges=g2e;Ft.cursorScrollMargin=Zt.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Ft.scrollMargins=b2e;Ft.darkTheme=F$;Ft.cspNonce=Zt.define({combine:e=>e.length?e[0]:""});Ft.contentAttributes=eQ;Ft.editorAttributes=p2e;Ft.lineWrapping=Ft.contentAttributes.of({class:"cm-lineWrapping"});Ft.announce=Fn.define();const GCt=4096,tJ={};class $N{constructor(t,n,i,r,s,a){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=a}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:Cr.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],a=typeof s=="function"?s(e):s;a&&KU(a,n)}return n}const KCt=Xt.mac?"mac":Xt.windows?"win":Xt.linux?"linux":"key";function XCt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,a,l;for(let c=0;ci.concat(r),[]))),n}function ZCt(e,t,n){return L2e(M2e(e.state),t,e,n)}let Rp=null;const JCt=4e3;function eTt(e,t=KCt){let n=Object.create(null),i=Object.create(null),r=(a,l)=>{let c=i[a];if(c==null)i[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,c,u,d)=>{var f,h;let m=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>XCt(y,t));for(let y=1;y{let w=Rp={view:O,prefix:x,scope:a};return setTimeout(()=>{Rp==w&&(Rp=null)},JCt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let a of e){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(m=>f(m,Q$))}let c=a[t]||a.key;if(c)for(let u of l)s(u,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(u,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let Q$=null;function L2e(e,t,n,i){Q$=t;let r=pEt(t),s=ol(r,0),a=vd(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;Rp&&Rp.view==n&&Rp.scope==i&&(l=Rp.prefix+" ",E2e.indexOf(t.keyCode)<0&&(u=!0,Rp=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+n2(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Xt.windows&&t.ctrlKey&&t.altKey)&&!(Xt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=Tm[t.keyCode])&&g!=r?(h(m[l+n2(g,t,!0)])||t.shiftKey&&(b=ek[t.keyCode])!=r&&b!=g&&h(m[l+n2(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(m[l+n2(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),Q$=null,c}class ob{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=$2e(t);return[new ob(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return tTt(t,n,i)}}function $2e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Cr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function rJ(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:a}),c=e.posAtCoords({x:s.right-1,y:a});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function tTt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==Cr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=$2e(e),u=a.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=M$(e,i,1),g=M$(e,r,-1),b=m.type==io.Text?m:null,v=g.type==io.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=rJ(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=rJ(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return x(O(n.from,n.to,b));{let k=b?O(n.from,null,b):w(m,!1),S=v?O(null,n.to,v):w(g,!0),E=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&T.from=R)break;I>P&&j(Math.max(U,P),k==null&&U<=A,Math.min(I,R),S==null&&I>=F,M.dir)}if(P=L.to+1,P>=R)break}return _.length==0&&j(A,k==null,F,S==null,e.textDirection),{top:C,bottom:N,horizontal:_}}function w(k,S){let E=l.top+(S?k.top:k.bottom);return{top:E,bottom:E,horizontal:[]}}}function nTt(e,t){return e.constructor==t.constructor&&e.eq(t)}class iTt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(jA)!=t.state.facet(jA)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(jA);for(;n!nTt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,Xt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const jA=Zt.define();function F2e(e){return[Ts.define(t=>new iTt(t,e)),jA.of(e)]}const ox=Zt.define({combine(e){return ef(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function rTt(e={}){return[ox.of(e),sTt,aTt,oTt,d2e.of(!0)]}function B2e(e){return e.startState.facet(ox)!=e.state.facet(ox)}const sTt=F2e({above:!0,markers(e){let{state:t}=e,n=t.facet(ox),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&Xt.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:it.cursor(r.head,r.assoc);for(let c of ob.forRange(e,a,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=B2e(e);return n&&sJ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){sJ(t.state,e)},class:"cm-cursorLayer"});function sJ(e,t){t.style.animationDuration=e.facet(ox).cursorBlinkRate+"ms"}const aTt=F2e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of ob.forRange(e,"cm-selectionBackground",r))t.push(s);if(Xt.ios&&!n.empty&&e.state.facet(ox).iosSelectionHandles){for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-start",it.cursor(n.from,1)))t.push(r);for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-end",it.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||B2e(e)},class:"cm-selectionLayer"}),oTt=zh.highest(Ft.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"}}}})),U2e=Fn.define({map(e,t){return e==null?null:t.mapPos(e)}}),Hw=ro.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(U2e)?i.value:n,e)}}),lTt=Ts.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Hw);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Hw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Hw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Hw)!=e&&this.view.dispatch({effects:U2e.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 cTt(){return[Hw,lTt]}function aJ(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),a=n,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(a+l.index,l)}function uTt(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 dTt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:a=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(t){let n=new Ah,i=n.add.bind(n);for(let{from:r,to:s}of uTt(t,this.maxLength))aJ(t.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,t,a,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,a,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let a=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=a){let c=t.state.doc.lineAt(a),u=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){d=a;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const z$=/x/.unicode!=null?"gu":"g",fTt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,z$),hTt={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 p5=null;function pTt(){var e;if(p5==null&&typeof document<"u"&&document.body){let t=document.body.style;p5=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return p5||!1}const RA=Zt.define({combine(e){let t=ef(e,{render:null,specialChars:fTt,addSpecialChars:null});return(t.replaceTabs=!pTt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,z$)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,z$)),t}});function mTt(e={}){return[RA.of(e),gTt()]}let oJ=null;function gTt(){return oJ||(oJ=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=gn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(RA)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new dTt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=ol(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=Uu(a.text,l,i-a.from);return gn.replace({widget:new xTt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=gn.replace({widget:new vTt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(RA);e.startState.facet(RA)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const bTt="•";function yTt(e){return e>=32?bTt:e==10?"␤":String.fromCharCode(9216+e)}class vTt extends Yu{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=yTt(this.code),i=t.state.phrase("Control character")+" "+(hTt[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 xTt extends Yu{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function wTt(){return STt}const OTt=gn.line({class:"cm-activeLine"}),STt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(OTt.range(r.from)),t=r.from)}return gn.set(n)}},{decorations:e=>e.decorations});class kTt extends Yu{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?BO(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=ik(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function ETt(e){let t=Ts.fromClass(class{constructor(n){this.view=n,this.placeholder=e?gn.set([gn.widget({widget:new kTt(e),side:1}).range(0)]):gn.none}get decorations(){return this.view.state.doc.length?gn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Ft.contentAttributes.of({"aria-placeholder":e})]:t}const V$=2e3;function CTt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>V$||n.off>V$||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(it.range(u.from+a,u.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=S$(u.text,a,e.tabSize,!0);if(d<0)s.push(it.cursor(u.to));else{let f=S$(u.text,l,e.tabSize);s.push(it.range(u.from+d,u.from+f))}}}return s}function TTt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function lJ(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>V$?-1:r==i.length?TTt(e,t.clientX):Uu(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function ATt(e,t){let n=lJ(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),a=r.state.doc.lineAt(s);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},i=i.map(r.changes)}},get(r,s,a){let l=lJ(e,r);if(!l)return i;let c=CTt(e.state,n,l);return c.length?a?it.create(c.concat(i.ranges)):it.create(c):i}}:null}function _Tt(e){let t=n=>n.altKey&&n.button==0;return Ft.mouseSelectionStyle.of((n,i)=>t(i)?ATt(n,i):null)}const NTt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},jTt={style:"cursor: crosshair"};function RTt(e={}){let[t,n]=NTt[e.key||"Alt"],i=Ts.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Ft.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?jTt:null})]}const i2="-10000px";class Q2e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=i(a,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let a=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function ITt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const m5=Zt.define({combine:e=>{var t,n,i;return{position:Xt.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||ITt}}}),cJ=new WeakMap,aQ=Ts.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(m5);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 Q2e(e,oQ,(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(m5);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=i2,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Xt.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=nQ(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(m5).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,a=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=i2;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=cJ.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||DTt,x=this.view.textDirection==Cr.LTR,O=h.width>i.right-i.left?x?i.left:i.right-h.width:x?Math.max(i.left,Math.min(f.left-(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),w=this.above[l];!c.strictSide&&(w?f.top-v-g-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let k=(w?f.top-i.top:i.bottom-f.bottom)-g;if(kO&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",uJ(d,(O-e.parent.left)/r)):(d.style.top=S/s+"px",uJ(d,O/r)),m){let C=f.left+(x?y.x:-y.x)-(O+14-7);m.style.left=C/r+"px"}u.overlap!==!0&&a.push({left:O,top:S,right:E,bottom:S+v}),d.classList.toggle("cm-tooltip-above",w),d.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=i2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function uJ(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const PTt=Ft.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"}}}),DTt={x:0,y:0},oQ=Zt.define({enables:[aQ,PTt]}),FN=Zt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class EI{static create(t){return new EI(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Q2e(t,FN,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const MTt=oQ.compute([FN],e=>{let t=e.facet(FN);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:EI.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),z2e=Zt.define();class LTt{constructor(t,n,i,r,s,a){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==Cr.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,a(c))},c=>hl(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(aQ),n=t?t.manager.tooltips.findIndex(i=>i.create==EI.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!$Tt(s.dom,t)||this.pending){let{pos:a}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!FTt(this.view,a,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const r2=4;function $Tt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-r2&&t.clientX<=i+r2&&t.clientY>=r-r2&&t.clientY<=s+r2}function FTt(e,t,n,i,r,s){let a=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(a.left>i||a.rightr||Math.min(a.bottom,l)=t&&c<=n}function BTt(e,t={}){let n=Fn.define(),i=new WeakMap,r=ro.define({create(){return[]},update(a,l){let c=i.get(a);if(a.length&&(t.hideOnChange&&(l.docChanged||l.selection)?a=[]:c&&c(l)?a=[]:t.hideOn&&(a=a.filter(u=>!t.hideOn(l,u)))),l.docChanged&&a.length){let u=[];for(let d of a){let f=l.changes.mapPos(d.pos,-1,eo.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}a=u}for(let u of l.effects)u.is(n)&&(a=u.value,c=void 0),(u.is(QTt)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>FN.from(a)});const s=Ts.define(a=>new LTt(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,z2e.of(s),MTt]}}function UTt(e,t,n,i={}){var r;let s=e.state.facet(z2e).map(a=>e.plugin(a)).filter(a=>!!a);if(i.tooltip&&i.tooltip.active){let a=s.find(l=>l.field==i.tooltip.active);a&&(s=[a])}for(let a of s)a.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function V2e(e,t){let n=e.plugin(aQ);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const QTt=Fn.define(),dJ=Zt.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function lQ(e,t){let n=e.plugin(H2e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const H2e=Ts.fromClass(class{constructor(e){this.input=e.state.facet(sk),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(dJ);this.top=new s2(e,!0,t.topContainer),this.bottom=new s2(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(dJ);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new s2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new s2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(sk);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],a=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:a).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Ft.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class s2{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=fJ(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=fJ(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 fJ(e){let t=e.nextSibling;return e.remove(),t}const sk=Zt.define({enables:H2e});function zTt(e,t){let n,i=new Promise(a=>n=a),r=a=>VTt(a,t,n);e.state.field(g5,!1)?e.dispatch({effects:q2e.of(r)}):e.dispatch({effects:Fn.appendConfig.of(g5.init(()=>[r]))});let s=W2e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(g5).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const g5=ro.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(q2e)?e=[n.value].concat(e):n.is(W2e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>sk.computeN([e],t=>t.field(e))}),q2e=Fn.define(),W2e=Fn.define();function VTt(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=yr("form"),t.input){let l=yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),a(null)):u.keyCode==13&&(u.preventDefault(),a(c))}),c.addEventListener("submit",u=>{u.preventDefault(),a(c)})}let s=yr("div",i,yr("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function a(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Nh extends Em{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Nh.prototype.elementClass="";Nh.prototype.toDOM=void 0;Nh.prototype.mapMode=eo.TrackBefore;Nh.prototype.startSide=Nh.prototype.endSide=-1;Nh.prototype.point=!0;const IA=Zt.define(),HTt=Zt.define(),qTt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>xi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},zO=Zt.define();function WTt(e){return[G2e(),zO.of({...qTt,...e})]}const hJ=Zt.define({combine:e=>e.some(t=>t)});function G2e(e){return[GTt]}const GTt=Ts.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(zO).map(t=>new mJ(e,t)),this.fixed=!e.state.facet(hJ);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(hJ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=xi.iter(this.view.state.facet(IA),this.view.viewport.from),i=[],r=this.gutters.map(s=>new KTt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==io.Text&&a){H$(n,i,l.from);for(let c of r)c.line(this.view,l,i);a=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==io.Text){H$(n,i,s.from);for(let a of r)a.line(this.view,s,i)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(zO),n=e.state.facet(zO),i=e.docChanged||e.heightChanged||e.viewportChanged||!xi.eq(e.startState.facet(IA),e.state.facet(IA),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let a=t.indexOf(s);a<0?r.push(new mJ(this.view,s)):(this.gutters[a].update(e),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Ft.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Cr.LTR?{left:i,right:r}:{right:i,left:r}})});function pJ(e){return Array.isArray(e)?e:[e]}function H$(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class KTt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=xi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,a=n.height/t.scaleY;if(this.i==r.elements.length){let l=new K2e(t,a,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,a,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];H$(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(HTt)){let a=s(t,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class mJ{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=r.clientY;let l=t.lineBlockAtHeight(a-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=pJ(n.markers(t)),n.initialSpacer&&(this.spacer=new K2e(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=pJ(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!xi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class K2e{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":""),XTt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,c=ss(l,c,u)||a(l,c,u):a}return i}})}});class b5 extends Nh{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function y5(e,t){return e.state.facet(Ly).formatNumber(t,e.state)}const JTt=zO.compute([Ly],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(YTt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new b5(y5(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(ZTt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ly)!=t.state.facet(Ly),initialSpacer(t){return new b5(y5(t,gJ(t.state.doc.lines)))},updateSpacer(t,n){let i=y5(n.view,gJ(n.view.state.doc.lines));return i==t.number?t:new b5(i)},domEventHandlers:e.facet(Ly).domEventHandlers,side:"before"}));function X2e(e={}){return[Ly.of(e),G2e(),JTt]}function gJ(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(e2t.range(r)))}return xi.of(t)});function n2t(){return t2t}let i2t=0,gd=class q${constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=i2t++}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 q$&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new q$(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new BN(t);return i=>i.modified.indexOf(n)>-1?i:BN.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},r2t=0;class BN{constructor(t){this.name=t,this.instances=[],this.id=r2t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&s2t(n,l.modified));if(i)return i;let r=[],s=new gd(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=a2t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(BN.get(l,c));return s}}function s2t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function a2t(e){let t=[[]];for(let n=0;ni.length-n.length)}function Vh(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],a=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){a=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new ak(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return Y2e.add(t)}const Y2e=new Ln({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new ak(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let ak=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let a=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){a=a?a+" "+u:u;break}}return a},scope:i}}function o2t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function l2t(e,t,n,i=0,r=e.length){let s=new c2t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class c2t{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:a,from:l,to:c}=t;if(l>=i||c<=n)return;a.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(a)));let u=r,d=u2t(t)||ak.empty,f=o2t(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(Ln.mounted);if(h&&h.overlay){let 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 x=v=O||!t.nextSibling())););if(!x||O>i)break;y=x.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,x.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function u2t(e){let t=e.type.prop(Y2e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const Vt=gd.define,a2=Vt(),Sp=Vt(),bJ=Vt(Sp),yJ=Vt(Sp),kp=Vt(),o2=Vt(kp),v5=Vt(kp),fd=Vt(),ag=Vt(fd),ld=Vt(),cd=Vt(),W$=Vt(),J1=Vt(W$),l2=Vt(),ne={comment:a2,lineComment:Vt(a2),blockComment:Vt(a2),docComment:Vt(a2),name:Sp,variableName:Vt(Sp),typeName:bJ,tagName:Vt(bJ),propertyName:yJ,attributeName:Vt(yJ),className:Vt(Sp),labelName:Vt(Sp),namespace:Vt(Sp),macroName:Vt(Sp),literal:kp,string:o2,docString:Vt(o2),character:Vt(o2),attributeValue:Vt(o2),number:v5,integer:Vt(v5),float:Vt(v5),bool:Vt(kp),regexp:Vt(kp),escape:Vt(kp),color:Vt(kp),url:Vt(kp),keyword:ld,self:Vt(ld),null:Vt(ld),atom:Vt(ld),unit:Vt(ld),modifier:Vt(ld),operatorKeyword:Vt(ld),controlKeyword:Vt(ld),definitionKeyword:Vt(ld),moduleKeyword:Vt(ld),operator:cd,derefOperator:Vt(cd),arithmeticOperator:Vt(cd),logicOperator:Vt(cd),bitwiseOperator:Vt(cd),compareOperator:Vt(cd),updateOperator:Vt(cd),definitionOperator:Vt(cd),typeOperator:Vt(cd),controlOperator:Vt(cd),punctuation:W$,separator:Vt(W$),bracket:J1,angleBracket:Vt(J1),squareBracket:Vt(J1),paren:Vt(J1),brace:Vt(J1),content:fd,heading:ag,heading1:Vt(ag),heading2:Vt(ag),heading3:Vt(ag),heading4:Vt(ag),heading5:Vt(ag),heading6:Vt(ag),contentSeparator:Vt(fd),list:Vt(fd),quote:Vt(fd),emphasis:Vt(fd),strong:Vt(fd),link:Vt(fd),monospace:Vt(fd),strikethrough:Vt(fd),inserted:Vt(),deleted:Vt(),changed:Vt(),invalid:Vt(),meta:l2,documentMeta:Vt(l2),annotation:Vt(l2),processingInstruction:Vt(l2),definition:gd.defineModifier("definition"),constant:gd.defineModifier("constant"),function:gd.defineModifier("function"),standard:gd.defineModifier("standard"),local:gd.defineModifier("local"),special:gd.defineModifier("special")};for(let e in ne){let t=ne[e];t instanceof gd&&(t.name=e)}Z2e([{tag:ne.link,class:"tok-link"},{tag:ne.heading,class:"tok-heading"},{tag:ne.emphasis,class:"tok-emphasis"},{tag:ne.strong,class:"tok-strong"},{tag:ne.keyword,class:"tok-keyword"},{tag:ne.atom,class:"tok-atom"},{tag:ne.bool,class:"tok-bool"},{tag:ne.url,class:"tok-url"},{tag:ne.labelName,class:"tok-labelName"},{tag:ne.inserted,class:"tok-inserted"},{tag:ne.deleted,class:"tok-deleted"},{tag:ne.literal,class:"tok-literal"},{tag:ne.string,class:"tok-string"},{tag:ne.number,class:"tok-number"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],class:"tok-string2"},{tag:ne.variableName,class:"tok-variableName"},{tag:ne.local(ne.variableName),class:"tok-variableName tok-local"},{tag:ne.definition(ne.variableName),class:"tok-variableName tok-definition"},{tag:ne.special(ne.variableName),class:"tok-variableName2"},{tag:ne.definition(ne.propertyName),class:"tok-propertyName tok-definition"},{tag:ne.typeName,class:"tok-typeName"},{tag:ne.namespace,class:"tok-namespace"},{tag:ne.className,class:"tok-className"},{tag:ne.macroName,class:"tok-macroName"},{tag:ne.propertyName,class:"tok-propertyName"},{tag:ne.operator,class:"tok-operator"},{tag:ne.comment,class:"tok-comment"},{tag:ne.meta,class:"tok-meta"},{tag:ne.invalid,class:"tok-invalid"},{tag:ne.punctuation,class:"tok-punctuation"}]);var x5;const zp=new Ln;function CI(e){return Zt.define({combine:e?t=>t.concat(e):void 0})}const cQ=new Ln;class ec{constructor(t,n,i=[],r=""){this.data=t,this.name=r,Ti.prototype.hasOwnProperty("tree")||Object.defineProperty(Ti.prototype,"tree",{get(){return Or(this)}}),this.parser=n,this.extension=[_m.of(this),Ti.languageData.of((s,a,l)=>{let c=vJ(s,a,l),u=c.type.prop(zp);if(!u)return[];let d=s.facet(u),f=c.type.prop(cQ);if(f){let h=c.resolve(a-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return vJ(t,n,i).type.prop(zp)==this.data}findRegions(t){let n=t.facet(_m);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,a)=>{if(s.prop(zp)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(Ln.mounted);if(l){if(l.tree.prop(zp)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+a,to:c.to+a});else i.push({from:a,to:a+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+a),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new jh(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Or(e){let t=e.field(ec.state,!1);return t?t.tree:hi.empty}class d2t{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let ew=null;class Ib{constructor(t,n,i=[],r,s,a,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new Ib(t,n,[],hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new d2t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(uh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=ew;ew=this;try{return t()}finally{ew=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=xJ(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=uh.applyChanges(i,c),r=hi.empty,s=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=xJ(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends yI{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=ew;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=a,new hi(ea.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return ew}}function xJ(e,t,n){return uh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class lx{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new lx(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Ib.create(t.facet(_m).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new lx(i)}}ec.state=ro.define({create:lx.init,update(e,t){for(let n of t.effects)if(n.is(ec.setState))return n.value;return t.startState.facet(_m)!=t.state.facet(_m)?lx.init(t.state):e.apply(t)}});let J2e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(J2e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const w5=typeof navigator<"u"&&(!((x5=navigator.scheduling)===null||x5===void 0)&&x5.isInputPending)?()=>navigator.scheduling.isInputPending():null,f2t=Ts.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ec.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ec.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=J2e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>w5&&w5()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ec.setState.of(new lx(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hl(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_m=Zt.define({combine(e){return e.length?e[0]:null},enables:e=>[ec.state,f2t,Ft.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Nm{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class UN{constructor(t,n,i,r,s,a=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new UN(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return r}return null}}const h2t=Zt.define(),i1=Zt.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Pb(e){let t=e.facet(i1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function ok(e,t){let n="",i=e.tabSize,r=e.facet(i1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?p2t(e,n,t):null}class TI{constructor(t,n={}){this.state=t,this.options=n,this.unit=Pb(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=a-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Uu(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Hh=new Ln;function p2t(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let a=r;a&&!(a.fromi.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)i={node:s[a],next:i}}return eAe(i,e,n)}function eAe(e,t,n){for(let i=e;i;i=i.next){let r=g2t(i.node);if(r)return r(dQ.create(t,n,i))}return 0}function m2t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function g2t(e){let t=e.type.prop(Hh);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Ln.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>tAe(a,!0,1,void 0,s&&!m2t(a)?r.from:void 0)}return e.parent==null?b2t:null}function b2t(){return 0}class dQ extends TI{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new dQ(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(y2t(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return eAe(this.context.next,this.base,this.pos)}}function y2t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function v2t(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function hv({closing:e,align:t=!0,units:n=1}){return i=>tAe(i,t,n,e)}function tAe(e,t,n,i,r){let s=e.textAfter,a=s.match(/^\s*/)[0].length,l=i&&s.slice(a,a+i.length)==i||r==e.pos+a,c=t?v2t(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const x2t=e=>e.baseIndent;function pv({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const w2t=200;function O2t(){return Ti.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+w2t)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:a}=e,l=-1,c=[];for(let{head:u}of a.selection.ranges){let d=a.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=uQ(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=ok(a,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const nAe=Zt.define(),qh=new Ln;function LE(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function k2t(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function QN(e,t,n){for(let i of e.facet(nAe)){let r=i(e,t,n);if(r)return r}return S2t(e,t,n)}function iAe(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const AI=Fn.define({map:iAe}),$E=Fn.define({map:iAe});function rAe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const Db=ro.define({create(){return gn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=wJ(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(AI)&&!E2t(e,i.value.from,i.value.to)?n.push(i.value):i.is($E)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(oAe),r=n.map(s=>(i?gn.replace({widget:new R2t(i(t.state,s))}):OJ).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=wJ(e,t.selection.main.head)),e},provide:e=>Ft.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function zN(e,t,n){var i;let r=null;return(i=e.field(Db,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function E2t(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function sAe(e,t){return e.field(Db,!1)?t:t.concat(Fn.appendConfig.of(lAe()))}const C2t=e=>{for(let t of rAe(e)){let n=QN(e.state,t.from,t.to);if(n)return e.dispatch({effects:sAe(e.state,[AI.of(n),aAe(e,n)])}),!0}return!1},T2t=e=>{if(!e.state.field(Db,!1))return!1;let t=[];for(let n of rAe(e)){let i=zN(e.state,n.from,n.to);i&&t.push($E.of(i),aAe(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function aAe(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Ft.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const A2t=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Db,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push($E.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},N2t=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:C2t},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:T2t},{key:"Ctrl-Alt-[",run:A2t},{key:"Ctrl-Alt-]",run:_2t}],j2t={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},oAe=Zt.define({combine(e){return ef(e,j2t)}});function lAe(e){return[Db,D2t]}function cAe(e,t){let{state:n}=e,i=n.facet(oAe),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=zN(e.state,l.from,l.to);c&&e.dispatch({effects:$E.of(c)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const OJ=gn.replace({widget:new class extends Yu{toDOM(e){return cAe(e,null)}}});class R2t extends Yu{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return cAe(t,this.value)}}const I2t={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class O5 extends Nh{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function P2t(e={}){let t={...I2t,...e},n=new O5(t,!0),i=new O5(t,!1),r=Ts.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(_m)!=a.state.facet(_m)||a.startState.field(Db,!1)!=a.state.field(Db,!1)||Or(a.startState)!=Or(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Ah;for(let c of a.viewportLineBlocks){let u=zN(a.state,c.from,c.to)?i:QN(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,WTt({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||xi.empty},initialSpacer(){return new O5(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=zN(a.state,l.from,l.to);if(u)return a.dispatch({effects:$E.of(u)}),!0;let d=QN(a.state,l.from,l.to);return d?(a.dispatch({effects:AI.of(d)}),!0):!1}}}),lAe()]}const D2t=Ft.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class FE{constructor(t,n){this.specs=t;let i;function r(l){let c=Cm.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof ec?l=>l.prop(zp)==a.data:a?l=>l==a:void 0,this.style=Z2e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Cm(i):null,this.themeType=n.themeType}static define(t,n){return new FE(t,n||{})}}const G$=Zt.define(),uAe=Zt.define({combine(e){return e.length?[e[0]]:null}});function PA(e){let t=e.facet(G$);return t.length?t:e.facet(uAe)}function dAe(e,t){let n=[L2t],i;return e instanceof FE&&(e.module&&n.push(Ft.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(uAe.of(e)):i?n.push(G$.computeN([Ft.darkTheme],r=>r.facet(Ft.darkTheme)==(i=="dark")?[e]:[])):n.push(G$.of(e)),n}function SHt(e,t,n){let i=PA(e),r=null;if(i){for(let s of i)if(!s.scope||n){let a=s.style(t);a&&(r=r?r+" "+a:a)}}return r}class M2t{constructor(t){this.markCache=Object.create(null),this.tree=Or(t.state),this.decorations=this.buildDeco(t,PA(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Or(t.state),i=PA(t.state),r=i!=PA(t.startState),{viewport:s}=t.view,a=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=a):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return gn.none;let i=new Ah;for(let{from:r,to:s}of t.visibleRanges)l2t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=gn.mark({class:c})))},r,s);return i.finish()}}const L2t=zh.high(Ts.fromClass(M2t,{decorations:e=>e.decorations})),$2t=FE.define([{tag:ne.meta,color:"#404740"},{tag:ne.link,textDecoration:"underline"},{tag:ne.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strong,fontWeight:"bold"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.keyword,color:"#708"},{tag:[ne.atom,ne.bool,ne.url,ne.contentSeparator,ne.labelName],color:"#219"},{tag:[ne.literal,ne.inserted],color:"#164"},{tag:[ne.string,ne.deleted],color:"#a11"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],color:"#e40"},{tag:ne.definition(ne.variableName),color:"#00f"},{tag:ne.local(ne.variableName),color:"#30a"},{tag:[ne.typeName,ne.namespace],color:"#085"},{tag:ne.className,color:"#167"},{tag:[ne.special(ne.variableName),ne.macroName],color:"#256"},{tag:ne.definition(ne.propertyName),color:"#00c"},{tag:ne.comment,color:"#940"},{tag:ne.invalid,color:"#f00"}]),F2t=Ft.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),fAe=1e4,hAe="()[]{}",pAe=Zt.define({combine(e){return ef(e,{afterCursor:!0,brackets:hAe,maxScanDistance:fAe,renderMatch:Q2t})}}),B2t=gn.mark({class:"cm-matchingBracket"}),U2t=gn.mark({class:"cm-nonmatchingBracket"});function Q2t(e){let t=[],n=e.matched?B2t:U2t;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 SJ(e){let t=[],n=e.facet(pAe);for(let i of e.selection.ranges){if(!i.empty)continue;let r=_d(e,i.head,-1,n)||i.head>0&&_d(e,i.head-1,1,n)||n.afterCursor&&(_d(e,i.head,1,n)||i.heade.decorations}),V2t=[z2t,F2t];function H2t(e={}){return[pAe.of(e),V2t]}const mAe=new Ln;function K$(e,t,n){let i=e.prop(t<0?Ln.openedBy:Ln.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function X$(e){let t=e.type.prop(mAe);return t?t(e.node):e}function _d(e,t,n,i={}){let r=i.maxScanDistance||fAe,s=i.brackets||hAe,a=Or(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=K$(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return q2t(e,t,n,c,d,u,s)}}return W2t(e,t,n,a,l.type,r,s)}function q2t(e,t,n,i,r,s,a){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=a.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function kJ(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let a=i;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?a.toLowerCase():a,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function G2t(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||K2t,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||pQ,mergeTokens:e.mergeTokens!==!1}}function K2t(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 EJ=new WeakMap;class fQ extends ec{constructor(t){let n=CI(t.languageData),i=G2t(t),r,s=new class extends yI{createParse(a,l,c){return new Y2t(r,a,l,c)}};super(n,s,[],t.name),this.topNode=eAt(n,this),r=this,this.streamParser=i,this.stateAfter=new Ln({perNode:!0}),this.tokenTable=t.tokenTable?new xAe(i.tokenTable):J2t}static define(t){return new fQ(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=EJ.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let l=t.children[a],c=n+t.positions[a],u=l instanceof hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let a=t.positions[s],l=t.children[s],c;if(an&&hQ(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=bAe(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?Pb(r):4),tree:hi.empty}}let Y2t=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Ib.get(),a=r[0].from,{state:l,tree:c}=X2t(t,i,a,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Pb(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Ib.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` +`){[t,n]=ix(this,t,n);let r="";for(let s=0,a=0;st&&s&&(r+=i),ta&&(r+=l.sliceString(t-a,n-a,i)),a=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof yd))return 0;let i=0,[r,s,a,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==a||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new Ps(m,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof yd)for(let b of m.children)f(b);else m.lines>a&&(c>a||!c)?(h(),l.push(m)):m instanceof Ps&&c&&(g=d[d.length-1])instanceof Ps&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new Ps(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]:yd.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new yd(l,n)}}Gi.empty=new Ps([""],0);function Xkt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function AA(e,t,n=0,i=1e9){for(let r=0,s=0,a=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Ps?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,l=r instanceof Ps?r.text.length:r.children.length;if(a==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(r instanceof Ps){let c=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[a+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ps?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class jTe{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new LO(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class RTe{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Gi.prototype[Symbol.iterator]=function(){return this.iter()},LO.prototype[Symbol.iterator]=jTe.prototype[Symbol.iterator]=RTe.prototype[Symbol.iterator]=function(){return this});let Ykt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function ix(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function $a(e,t,n=!0,i=!0){return Gkt(e,t,n,i)}function Zkt(e){return e>=56320&&e<57344}function Jkt(e){return e>=55296&&e<56320}function ol(e,t){let n=e.charCodeAt(t);if(!Jkt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Zkt(i)?(n-55296<<10)+(i-56320)+65536:n}function VU(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function vd(e){return e<65536?1:2}const h$=/\r\n?|\n/;var eo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(eo||(eo={}));class Ld{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=eo.Simple&&u>=t&&(i==eo.TrackDel&&rt||i==eo.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ld(t)}static create(t){return new Ld(t)}}class ma extends Ld{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return p$(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return m$(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=a;let c=r>>1;for(;i.length0&&Qp(i,n,s.text),s.forward(d),l+=d}let u=t[a++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],a=0,l=null;function c(d=!1){if(!d&&!r.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Gi.of(m.split(i||h$)):m:Gi.empty,b=g.length;if(f==h&&b==0)return;fa&&po(r,f-a,-1),po(r,h-f,b),Qp(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new ma(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Qp(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(r,u,s,d,f),r=u,s=d}}}function m$(e,t,n,i=!1){let r=[],s=i?[]:null,a=new YS(e),l=new YS(t);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let u=Math.min(a.len,l.len);po(r,u,-1),a.forward(u),l.forward(u)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let u=0,d=a.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||i.length>u),s.forward2(c),a.forward(c)}}}}class YS{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Gi.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Gi.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class jp{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new jp(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return it.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return it.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 it.range(t.anchor,t.head)}static create(t,n,i,r){return new jp(t,n,i,r)}}class it{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:it.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 it(t.ranges.map(n=>jp.fromJSON(n)),t.main)}static single(t,n=t){return new it([it.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?it.range(c,l):it.range(l,c))}}return new it(t,n)}}function PTe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let HU=0;class Zt{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=HU++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new Zt(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:qU),!!t.static,t.enables)}of(t){return new _A([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function qU(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class _A{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=HU++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[a]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||g$(f,d)){let m=i(f);if(l?!wZ(m,f.values[a],r):!r(m,f.values[a]))return f.values[a]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=NN(h,g);if(this.dependencies.every(v=>v instanceof Zt?h.facet(v)===f.facet(v):v instanceof ro?h.field(v,!1)==f.field(v,!1):!0)||(l?wZ(m=i(f),b,r):r(m=i(f),b)))return f.values[a]=b,0}else m=i(f);return f.values[a]=m,1}}}get extension(){return this}}function wZ(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),a=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(qT).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(qT),a=r.facet(qT),l;return(l=s.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,qT.of({field:this,create:t})]}get extension(){return this}}const Ag={lowest:4,low:3,default:2,high:1,highest:0};function Y1(e){return t=>new DTe(t,e)}const zh={highest:Y1(Ag.highest),high:Y1(Ag.high),default:Y1(Ag.default),low:Y1(Ag.low),lowest:Y1(Ag.lowest)};class DTe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class vI{of(t){return new b$(this,t)}reconfigure(t){return vI.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class b${constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class _N{constructor(t,n,i,r,s,a){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),a=new Map;for(let h of tEt(t,n,a))h instanceof ro?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(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,qU(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=>eEt(v,g,m))}}let f=u.map(h=>h(l));return new _N(t,a,f,l,c,s)}}function tEt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(a,l){let c=r.get(a);if(c!=null){if(c<=l)return;let u=i[c].indexOf(a);u>-1&&i[c].splice(u,1),a instanceof b$&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof b$){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(a.compartment)||a.inner;n.set(a.compartment,u),s(u,l)}else if(a instanceof DTe)s(a.inner,a.prec);else if(a instanceof ro)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof _A)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,Ag.default);else{let u=a.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(u==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,Ag.default),i.reduce((a,l)=>a.concat(l))}function $O(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function NN(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const MTe=Zt.define(),y$=Zt.define({combine:e=>e.some(t=>t),static:!0}),LTe=Zt.define({combine:e=>e.length?e[0]:void 0,static:!0}),$Te=Zt.define(),FTe=Zt.define(),BTe=Zt.define(),UTe=Zt.define({combine:e=>e.length?e[0]:!1});class Jd{constructor(t,n){this.type=t,this.value=n}static define(){return new nEt}}class nEt{of(t){return new Jd(this,t)}}class iEt{constructor(t){this.map=t}of(t){return new Fn(this,t)}}class Fn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Fn(this.type,n)}is(t){return this.type==t}static define(t={}){return new iEt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}Fn.reconfigure=Fn.define();Fn.appendConfig=Fn.define();class Js{constructor(t,n,i,r,s,a){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&PTe(i,n.newLength),s.some(l=>l.type==Js.time)||(this.annotations=s.concat(Js.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Js(t,n,i,r,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Js.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Js.time=Jd.define();Js.userEvent=Jd.define();Js.addToHistory=Jd.define();Js.remote=Jd.define();function rEt(e,t){let n=[];for(let i=0,r=0;;){let s,a;if(i=e[i]))s=e[i++],a=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Js?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Js?e=s[0]:e=zTe(t,cv(s),!1)}return e}function aEt(e){let t=e.startState,n=t.facet(BTe),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=QTe(i,v$(t,s,e.changes.newLength),!0))}return i==e?e:Js.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const oEt=[];function cv(e){return e==null?oEt:Array.isArray(e)?e:[e]}var ns=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ns||(ns={}));const lEt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let x$;try{x$=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function cEt(e){if(x$)return x$.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||lEt.test(n)))return!0}return!1}function uEt(e){return t=>{if(!/\S/.test(t))return ns.Space;if(cEt(t))return ns.Word;for(let n=0;n-1)return ns.Word;return ns.Other}}class Ti{constructor(t,n,i,r,s,a){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(Fn.reconfigure)?(n=null,i=l.value):l.is(Fn.appendConfig)&&(n=null,i=cv(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=_N.resolve(i,r,this),s=new Ti(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(y$)?t.newSelection:t.newSelection.asSingle();new Ti(n,t.newDoc,a,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:it.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=cv(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Ti.create({doc:t.doc,selection:it.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=_N.resolve(t.extensions||[],new Map),i=t.doc instanceof Gi?t.doc:Gi.of((t.doc||"").split(n.staticFacet(Ti.lineSeparator)||h$)),r=t.selection?t.selection instanceof it?t.selection:it.single(t.selection.anchor,t.selection.head):it.single(0);return PTe(r,i.length),n.staticFacet(y$)||(r=r.asSingle()),new Ti(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Ti.tabSize)}get lineBreak(){return this.facet(Ti.lineSeparator)||` +`}get readOnly(){return this.facet(UTe)}phrase(t,...n){for(let i of this.facet(Ti.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(MTe))for(let a of s(this,n,i))Object.prototype.hasOwnProperty.call(a,t)&&r.push(a[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return uEt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),a=t-i,l=t-i;for(;a>0;){let c=$a(n,a,!1);if(s(n.slice(c,a))!=ns.Word)break;a=c}for(;le.length?e[0]:4});Ti.lineSeparator=LTe;Ti.readOnly=UTe;Ti.phrases=Zt.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});Ti.languageData=MTe;Ti.changeFilter=$Te;Ti.transactionFilter=FTe;Ti.transactionExtender=BTe;vI.reconfigure=Fn.define();function ef(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let a=r[s],l=i[s];if(l===void 0)i[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class Em{eq(t){return this==t}range(t,n=t){return ZS.create(t,n,this)}}Em.prototype.startSide=Em.prototype.endSide=0;Em.prototype.point=!1;Em.prototype.mapMode=eo.TrackDel;function WU(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class ZS{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new ZS(t,n,i)}}function w$(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class GU{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let c=a+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return u>=0?a:l;u>=0?l=c:a=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-a),s.push(m-a))}return{mapped:i.length?new GU(r,s,i,l):null,pos:a}}}class xi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new xi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,a=t.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(w$)),this.isEmpty)return n.length?xi.of(n):this;let l=new VTe(this,null,-1).goto(0),c=0,u=[],d=new Ah;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+a.length&&a.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return JS.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return JS.from(t).goto(n)}static compare(t,n,i,r,s=-1){let a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=OZ(a,l,i),u=new Z1(a,c,s),d=new Z1(l,c,s);i.iterGaps((f,h,m)=>SZ(u,f,d,h,m,r)),i.empty&&i.length==0&&SZ(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),a=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=OZ(s,a),c=new Z1(s,l,0).goto(i),u=new Z1(a,l,0).goto(i);for(;;){if(c.to!=u.to||!O$(c.active,u.active)||c.point&&(!u.point||!WU(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let a=new Z1(t,null,s).goto(n),l=n,c=a.openStart;for(;;){let u=Math.min(a.to,i);if(a.point){let d=a.activeForPoint(a.to),f=a.pointFroml&&(r.span(l,u,a.active,c),c=a.openEnd(u));if(a.to>i)return c+(a.point&&a.to>i?1:0);l=a.to,a.next()}}static of(t,n=!1){let i=new Ah;for(let r of t instanceof ZS?[t]:n?dEt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return xi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=xi.empty;r=r.nextLayer)n=new xi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}xi.empty=new xi([],[],null,-1);function dEt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(w$);t=i}return e}xi.empty.nextLayer=xi.empty;class Ah{finishChunk(t){this.chunks.push(new GU(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new Ah)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(xi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=xi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function OZ(e,t,n){let i=new Map;for(let s of e)for(let a=0;a=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new VTe(a,n,i,s));return r.length==1?r[0]:new JS(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)r5(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--)r5(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(),r5(this.heap,0)}}}function r5(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Z1{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=JS.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){WT(this.active,t),WT(this.activeTo,t),WT(this.activeRank,t),this.minActive=kZ(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;GT(this.active,n,i),GT(this.activeTo,n,r),GT(this.activeRank,n,s),t&>(t,n,this.cursor.from),this.minActive=kZ(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&WT(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function SZ(e,t,n,i,r,s){e.goto(t),n.goto(i);let a=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,a);if(e.point||n.point?(e.point&&n.point&&WU(e.point,n.point)&&O$(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!O$(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function O$(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 kZ(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=$a(e,r)}return i===!0?-1:e.length}const k$="ͼ",EZ=typeof Symbol>"u"?"__"+k$:Symbol.for(k$),E$=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),CZ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Cm{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,c,u){let d=[],f=/^@(\w+)\b/.exec(a[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(a[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>a.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?a.map(i):a).join(", ")+" {"+d.join(" ")+"}")}for(let a in t)s(r(a),t[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=CZ[EZ]||1;return CZ[EZ]=t+1,k$+t.toString(36)}static mount(t,n,i){let r=t[E$],s=i&&i.nonce;r?s&&r.setNonce(s):r=new fEt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let TZ=new Map;class fEt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=TZ.get(i);if(s)return t[E$]=s;this.sheet=new r.CSSStyleSheet,TZ.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[E$]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let a=0;a-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},hEt=typeof navigator<"u"&&/Mac/.test(navigator.platform),pEt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ya=0;Ya<10;Ya++)Tm[48+Ya]=Tm[96+Ya]=String(Ya);for(var Ya=1;Ya<=24;Ya++)Tm[Ya+111]="F"+Ya;for(var Ya=65;Ya<=90;Ya++)Tm[Ya]=String.fromCharCode(Ya+32),ek[Ya]=String.fromCharCode(Ya);for(var s5 in Tm)ek.hasOwnProperty(s5)||(ek[s5]=Tm[s5]);function mEt(e){var t=hEt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||pEt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ek:Tm)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var Xt={mac:NZ||/Mac/.test(Do.platform),windows:/Win/.test(Do.platform),linux:/Linux|X11/.test(Do.platform),ie:xI,ie_version:qTe?C$.documentMode||6:A$?+A$[1]:T$?+T$[1]:0,gecko:AZ,gecko_version:AZ?+(/Firefox\/(\d+)/.exec(Do.userAgent)||[0,0])[1]:0,chrome:!!a5,chrome_version:a5?+a5[1]:0,ios:NZ,android:/Android\b/.test(Do.userAgent),webkit:_Z,webkit_version:_Z?+(/\bAppleWebKit\/(\d+)/.exec(Do.userAgent)||[0,0])[1]:0,safari:_$,safari_version:_$?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Do.userAgent)||[0,0])[1]:0,tabSize:C$.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function KU(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const jN=Object.create(null);function XU(e,t,n){if(e==t)return!0;e||(e=jN),t||(t=jN);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function gEt(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 jZ(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 bEt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Nb(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:a}=WTe(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Nb(t,i,r,n,t.widget||null,!0)}static line(t){return new DE(t)}static set(t,n=!1){return xi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gn.none=xi.empty;class PE extends gn{constructor(t){let{start:n,end:i}=WTe(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?KU(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||jN}eq(t){return this==t||t instanceof PE&&this.tagName==t.tagName&&XU(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}PE.prototype.point=!1;class DE extends gn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof DE&&this.spec.class==t.spec.class&&XU(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}DE.prototype.mapMode=eo.TrackBefore;DE.prototype.point=!0;class Nb extends gn{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?eo.TrackBefore:eo.TrackAfter:eo.TrackDel}get type(){return this.startSide!=this.endSide?io.WidgetRange:this.startSide<=0?io.WidgetBefore:io.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Nb&&yEt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Nb.prototype.point=!0;function WTe(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 yEt(e,t){return e==t||!!(e&&t&&e.compare(t))}function uv(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class tk extends Em{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof tk&&this.tagName==t.tagName&&XU(this.attributes,t.attributes)}static create(t){return new tk(t.tagName,t.attributes||jN,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return xi.of(t,n)}}tk.prototype.startSide=tk.prototype.endSide=-1;function nk(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function N$(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function FO(e,t){if(!t.anchorNode)return!1;try{return N$(e,t.anchorNode)}catch{return!1}}function BO(e){return e.nodeType==3?rk(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function UO(e,t,n,i){return n?RZ(e,t,n,i,-1)||RZ(e,t,n,i,1):!1}function Am(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function RN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function RZ(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:_h(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=Am(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?_h(e):0}else return!1}}function _h(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ik(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function vEt(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 GTe(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 xEt(e,t,n,i,r,s,a,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=vEt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let x=d.getBoundingClientRect();({scaleX:g,scaleY:b}=GTe(d,x)),h={left:x.left,right:x.left+d.clientWidth*g,top:x.top,bottom:x.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+a)):t.bottom>h.bottom-a&&(y=t.bottom-h.bottom+a,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function KTe(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 wEt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?_h(n):0),i,Math.min(t.focusOffset,i?_h(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let kg=null;Xt.safari&&Xt.safari_version>=26&&(kg=!1);function XTe(e){if(e.setActive)return e.setActive();if(kg)return e.focus(kg);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(kg==null?{get preventScroll(){return kg={preventScroll:!0},!0}}:void 0),!kg){kg=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function ZTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=_h(n)}else if(n.parentNode&&!RN(n))i=Am(n),n=n.parentNode;else return null}}function JTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return a;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function n2e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(od[b+1]==-m){let v=od[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Er[f]=Er[od[b]]=y),l=b;break}}else{if(od.length==189)break;od[l++]=f,od[l++]=h,od[l++]=c}else if((g=Er[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=od[v+2];if(y&2)break;if(b)od[v+2]|=2;else{if(y&4)break;od[v+2]|=4}}}}}function _Et(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let a=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),Er[--g]=m;c=d}else s=u,c++}}}function R$(e,t,n,i,r,s,a){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&a.push(new Ad(c,b.from,m));let v=b.direction==jb!=!(m%2);I$(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Er[g]!=l:Er[g]==l))break;g++}h?R$(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Er[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,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(Er[v-1]==l)break e;break}}if(h)h.push(b);else{b.toEr.length;)Er[Er.length]=256;let i=[],r=t==jb?0:1;return I$(e,r,r,n,0,e.length,i),i}function i2e(e){return[new Ad(0,e,0)]}let r2e="";function jEt(e,t,n,i,r){var s;let a=i.head-e.from,l=Ad.find(t,a,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(a==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],a=c.side(!r,n),u=c.side(r,n)}let d=$a(e.text,a,c.forward(r,n));(dc.to)&&(d=u),r2e=e.text.slice(Math.min(a,d),Math.max(a,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),f2e=Zt.define({combine:e=>e.some(t=>t)}),h2e=Zt.define();class fv{constructor(t,n,i,r,s,a=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(t){return t.empty?this:new fv(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fv(it.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const KT=Fn.define({map:(e,t)=>e.map(t)}),p2e=Fn.define();function hl(e,t,n){let i=e.facet(l2e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const zf=Zt.define({combine:e=>e.length?e[0]:!0});let IEt=0;const My=Zt.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(wI.of(u=>{let d=u.plugin(l);return d?a(d):gn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return Ts.define((i,r)=>new t(i,r),n)}}class o5{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(hl(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){hl(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){hl(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const m2e=Zt.define(),eQ=Zt.define(),wI=Zt.define(),g2e=Zt.define(),tQ=Zt.define(),ME=Zt.define(),b2e=Zt.define();function PZ(e,t){let n=e.state.facet(b2e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return xi.spans(i,t.from,t.to,{point(){},span(s,a,l,c){let u=s-t.from,d=a-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=REt(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 y2e=Zt.define();function nQ(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(y2e)){let a=s(e);a&&(a.left!=null&&(t=Math.max(t,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}const zw=Zt.define();class Gc{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Gc(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Gc(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new IN(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const PEt=[];class Cs{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return PEt}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&&gEt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=Am(this.dom),r=this.length?t>0:n>0;return new Nu(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof SI)return t;return null}static get(t){return t.cmTile}}class OI extends Cs{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,a=0;for(let l of this.children){if(l.sync(t),a+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=DZ(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=DZ(r);this.length=a}}function DZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class SI extends OI{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Cs.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let a=i.children[r++];if(a instanceof dh)n.push(r),i=a,r=0;else{let l=s+a.length,c=t(a,s);if(c!==void 0)return c;s=l+a.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,a=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:a}}}class dh extends OI{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new dh(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class rx extends OI{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new rx(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,a=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&MEt(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-m):(mr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?Xt.chrome||Xt.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return Xt.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:ik(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Qg(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Rb extends Cs{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return ik(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;a=s[c],!(t>0?c==0:c==s.length-1||a.top0==i)}}class LEt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(a){if(!t)break;i&&i.break(),t--,a=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof ul&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(l5(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=Cs.get(c.dom);f&&f.setDOM(l5(c.dom))}let d=ul.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=Cs.get(t.text);s&&this.cache.reused.set(s,2);let a=new Qg(t.text,t.text.nodeValue);a.flags|=8,this.pos=t.range.toB,r.append(a)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=v2e);let r=rx.start(t,n||((i=this.cache.find(rx))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let a=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof ul&&l.mark.eq(a))r=l,n--;else{let c=ul.of(a,(i=this.cache.find(ul,u=>u.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!MZ(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Xt.ios&&MZ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(c5,0,32)||new Rb(c5.toDOM(),0,c5,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 $Et(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.froma.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(PN,void 0,1);return i&&(i.flags=n),i||new PN(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class BEt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const DN=[Rb,rx,Qg,ul,PN,dh,SI];for(let e=0;e[]),this.index=DN.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],a=this.index[r];for(let l=0;l{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,a=0;;){let l=ar){let u=c-r;this.preserve(u,!a,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof ul&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof ul&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,a=xi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Nb){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?sx.block:sx.inline),g=zEt(u),b=this.cache.findWidget(m,c-l,g)||Rb.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=VEt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=a>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=Cs.get(r);if(r==this.view.contentDOM)break;s instanceof ul?n.push(s):s!=null&&s.isLine()?i=s:s instanceof dh||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new rx(r,v2e):i||n.push(ul.of(new PE({tagName:r.nodeName.toLowerCase(),attributes:bEt(r)}),r)))}return{line:i,marks:n}}}function MZ(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 zEt(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 v2e={class:"cm-line"};function VEt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&KU(n,e),i&&(e.class+=" "+i)),e}function HEt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof ul&&t.push(i.mark)}return t}function l5(e){let t=Cs.get(e);return t&&t.setDOM(e.cloneNode()),e}class sx extends Yu{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sx.inline=new sx("span");sx.block=new sx("div");const c5=new class extends Yu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class LZ{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=gn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new SI(t,t.contentDOM),this.updateInner([new Gc(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!eCt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?WEt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Gc(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Xt.ie||Xt.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let c=XEt(a,this.decorations,t.changes);c.length&&(i=Gc.extendWithRanges(i,c));let u=ZEt(l,this.blockWrappers,t.changes);return u.length&&(i=Gc.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let a=this.tile,l=new QEt(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Cs.get(n.text)&&l.cache.reused.set(Cs.get(n.text),2),this.tile=l.run(t,n),D$(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Xt.chrome||Xt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&FO(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Xt.gecko&&c.empty&&!this.hasComposition&&qEt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Nu(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!UO(u.node,u.offset,f.anchorNode,f.anchorOffset)||!UO(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{Xt.android&&Xt.chrome&&i.contains(f.focusNode)&&JEt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=nk(this.view.root);if(h)if(c.empty){if(Xt.gecko){let m=GEt(u.node,u.offset);if(m&&m!=3){let g=(m==1?ZTe:JTe)(u.node,u.offset);g&&(u=new Nu(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Nu(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Nu(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&UO(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=nk(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let a=_h(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;a==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?a=-1:a=1),t=l}a<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Cs.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let a=0,l=r;;a++){let c=i.children[a];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,a,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!a&&(a=u,l=t-d,c=d>t),d>t&&a)return!0}}),!i&&!a?this.domAtPos(t,n):(s&&a?i=null:c&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof u5?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let c=r(l,a);if(c)return c}if(a-=l.length,a<0)break}else if(s.isText()&&aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==Cr.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:x}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof dh)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(x+u),u=0,a)){let O=b.dom.lastChild,w=O?BO(O):[];if(w.length){let k=w[w.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}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"?Cr.RTL:Cr.LTR}measureTextSize(){let t=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,c;for(let u of a.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=BO(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=BO(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>i){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(gn.replace({widget:new u5(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return gn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(wI).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(tQ).map((s,a)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(xi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(h2e))try{if(u(this.view,t.range,t))return!0}catch(d){hl(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=nQ(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(xEt(this.view.scrollDOM,a,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){D$(this.tile)}}function D$(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)D$(i,t)}}function qEt(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 x2e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=ZTe(n.focusNode,n.focusOffset),r=JTe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Cs.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=Cs.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let a=t-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function WEt(e,t,n){let i=x2e(e,n);if(!i)return null;let{node:r,from:s,to:a}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new Gc(c.mapPos(s),c.mapPos(a),s,a),text:r}}function GEt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class u5 extends Yu{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function tCt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return it.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=$a(r.text,s,!1):l=$a(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=$a(r.text,a,!1);if(i(r.text.slice(u,a))!=c)break;a=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+S$(a,s,e.state.tabSize)}function M$(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==io.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function iCt(e,t,n,i){let r=M$(e,t.head,t.assoc||-1),s=!i||r.type!=io.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let a=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==Cr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return it.cursor(c,n?-1:1)}return it.cursor(n?r.to:r.from,n?-1:1)}function $Z(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=jEt(r,s,a,l,n),d=r2e;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 rCt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let a=i(s);return r==ns.Space&&(r=a),r==a}}function sCt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return it.cursor(r,t.assoc);let a=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)a==null&&(a=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);a==null&&(a=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+a,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=L$(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:x{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:it.cursor(i,ie.viewState.docHeight)return new xd(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==io.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==io.Text){let f=nCt(e,r,u,a,l);return new xd(f,f==u.from?1:-1)}}if(u.type!=io.Text)return c<(u.top+u.bottom)/2?new xd(u.from,1):new xd(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new aCt(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class aCt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(a.has(b)){let y=r+Math.floor(Math.random()*g);for(let x=0;x1)){if(x.bottomthis.y)(!u||u.top>x.top)&&(u=x),O=-1;else{let w=x.left>this.x?this.x-x.left:x.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==Cr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return rk(t.dom,a,l).getClientRects()});return r.after?new xd(i[r.i+1],-1):new xd(i[r.i],1)}scanTile(t,n){if(!t.length)return new xd(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:rk(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],a=i[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new xd(i[r.i+1],-1):new xd(a,1)}}const sy="￿";class oCt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ti.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=sy}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let a=Cs.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=Cs.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:RN(r))||RN(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!cCt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=a-1);i=s+a}}readNode(t){let n=Cs.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(lCt(t,i.node,i.offset)?n:0))}}function lCt(e,t,n){for(;;){if(!t||n<_h(t))return!1;if(t==e)return!0;n=Am(t)+1,t=t.parentNode}}function cCt(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let i=Cs.get(e);if(!(i!=null&&i.isWidget()))return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class FZ{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class uCt{constructor(t,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=O2e(t.docView.tile,n,i,0))){let c=s||a?[]:fCt(t),u=new oCt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=hCt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!N$(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!N$(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((Xt.ios||Xt.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(it.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=it.create([it.cursor(u,m)])}else this.newSel=it.single(d,u)}}}function O2e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let c=0,u=i,d=i;cn)return O2e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){a=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a=0?e.children[a].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function S2e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(a===8||Xt.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Gi.of(t.text.slice(s.from-l,h).split(sy))}:(m=k2e(f,t.text,u-l,d))&&(Xt.chrome&&a==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==sy+sy&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Gi.of(t.text.slice(m.from,m.toB).split(sy))})}else i&&(!e.hasFocus&&r.facet(zf)||MN(i,s))&&(i=null);if(!n&&!i)return!1;if((Xt.mac||Xt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=it.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Gi.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:Xt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=it.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Gi.of([" "])}),n)return iQ(e,n,i,a);if(i&&!MN(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=w2e(r.facet(ME).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function iQ(e,t,n,i=-1){if(Xt.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Xt.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&dv(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&dv(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&dv(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=dCt(e,t,n));return e.state.facet(c2e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function dCt(e,t,n){let i,r=e.state,s=r.selection.main,a=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(a=d)}if(a>-1)i={changes:t,selection:it.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&&x2e(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}),x=g.to-s.to;return{changes:y,range:u?it.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function k2e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(a,l));n-=a+c-s}if(a=a?s-n:0;s-=c,l=s+(l-a),a=s}else if(l=l?s-n:0;s-=c,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function fCt(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 FZ(n,i)),(r!=n||s!=i)&&t.push(new FZ(r,s))),t}function hCt(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?it.single(n+t,i+t):null}function MN(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class pCt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Xt.safari&&t.contentDOM.addEventListener("input",()=>null),Xt.gecko&&NCt(t.contentDOM.ownerDocument)}handleEvent(t){!SCt(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=gCt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=i[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&C2e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Xt.android&&Xt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(Xt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(E2e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||bCt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&Xt.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&mCt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Xt.safari&&!Xt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function mCt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function BZ(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){hl(n.state,r)}}}function gCt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(BZ(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(BZ(i.value,c))}}for(let i in Qu)n(i).handlers.push(Qu[i]);for(let i in Vo)n(i).observers.push(Vo[i]);return t}const E2e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],bCt="dthko",C2e=[16,17,18,20,91,92,224,225],XT=6;function YT(e){return Math.max(0,e)*.7+8}function yCt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class vCt{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=KTe(t.contentDOM),this.atoms=t.state.facet(ME).map(a=>a(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Ti.allowMultipleSelections)&&xCt(t,n),this.dragging=OCt(t,n)&&_2e(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&&yCt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=nQ(this.view);t.clientX-c.left<=r+XT?n=-YT(r-t.clientX):t.clientX+c.right>=a-XT&&(n=YT(t.clientX-a)),t.clientY-c.top<=s+XT?i=-YT(s-t.clientY):t.clientY+c.bottom>=l-XT&&(i=YT(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=w2e(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 xCt(e,t){let n=e.state.facet(s2e);return n.length?n[0](t):Xt.mac?t.metaKey:t.ctrlKey}function wCt(e,t){let n=e.state.facet(a2e);return n.length?n[0](t):Xt.mac?!t.altKey:!t.ctrlKey}function OCt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=nk(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}function SCt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Cs.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Qu=Object.create(null),Vo=Object.create(null),T2e=Xt.ie&&Xt.ie_version<15||Xt.ios&&Xt.webkit_version<604;function kCt(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(),A2e(e,n.value)},50)}function kI(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function A2e(e,t){t=kI(e.state,ZU,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if($$!=null&&n.selection.ranges.every(c=>c.empty)&&$$==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((a?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:it.cursor(u.from+f.length)}})}else a?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:it.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Vo.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Xt.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vo.wheel=Vo.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Qu.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vo.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Vo.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vo.touchend=(e,t)=>{e.inputState.touchActive=!1};Qu.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(o2e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=CCt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new vCt(e,t,n,i)),i&&e.observer.ignore(()=>{XTe(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 UZ(e,t,n,i){if(i==1)return it.cursor(t,n);if(i==2)return tCt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(zZ+1)%3:1}function CCt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=_2e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,a,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=UZ(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=UZ(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=TCt(r,c.pos))?u:l?r.addRange(d):it.create([d])}}}function TCt(e,t){for(let n=0;n=t)return it.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Qu.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=n.to||a<=n.from)&&(n=it.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",kI(e.state,JU,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Qu.dragend=e=>(e.inputState.draggedContent=null,!1);function HZ(e,t,n,i){if(n=kI(e.state,ZU,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&wCt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Qu.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&HZ(e,t,i.filter(a=>a!=null).join(e.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return HZ(e,t,i,!0),!0}return!1};Qu.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=T2e?null:t.clipboardData;return n?(A2e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(kCt(e),!1)};function ACt(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 _Ct(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let a=e.doc.lineAt(s);a.number>r&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),r=a.number}i=!0}return{text:kI(e,JU,t.join(e.lineBreak)),ranges:n,linewise:i}}let $$=null;Qu.copy=Qu.cut=(e,t)=>{if(!FO(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=_Ct(e.state);if(!n&&!r)return!1;$$=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=T2e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(ACt(e,n),!1)};const N2e=Jd.define();function j2e(e,t){let n=[];for(let i of e.facet(u2e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:N2e.of(!0)}):null}function R2e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=j2e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vo.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),R2e(e)};Vo.blur=e=>{e.observer.clearSelectionRange(),R2e(e)};Vo.compositionstart=Vo.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vo.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Xt.chrome&&Xt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vo.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Qu.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(s&&a.length){let l=a[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return iQ(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(Xt.chrome&&Xt.android&&(r=E2e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Xt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Xt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vo.compositionend(e,t),20),!1};const qZ=new Set;function NCt(e){qZ.has(e)||(qZ.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const WZ=["pre-wrap","normal","pre-line","break-spaces"];let ax=!1;function GZ(){ax=!1}class jCt{constructor(t){this.lineWrapping=t,this.doc=Gi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return WZ.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>NA&&(ax=!0),this.height=t)}replace(t,n,i){return zo.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,a=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,Ir.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,Ir.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&a(this.lineAt(0,Ir.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Hl extends I2e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new Tu(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof Hl||r instanceof Ka&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ka?r=new Hl(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):zo.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ka extends zo{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,a,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);a=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else a=this.height/s;return{firstLine:i,lastLine:r,perLine:a,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Ka?i[i.length-1]=new Ka(s.length+r):i.push(null,new Ka(r-1))}if(t>0){let s=i[0];s instanceof Ka?i[0]=new Ka(t+s.length):i.unshift(new Ka(t-1),null)}return zo.of(i)}decomposeLeft(t,n){n.push(new Ka(t-1),null)}decomposeRight(t,n){n.push(null,new Ka(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&a.push(new Ka(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;a.length&&a.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=NA&&(c=-2);let m=new Hl(d,f,h);m.outdated=!1,a.push(m),l+=d+1}l<=s&&a.push(null,new Ka(s-l).updateHeight(t,l));let u=zo.of(a);return(c<0||Math.abs(u.height-this.height)>=NA||Math.abs(c-this.heightMetrics(t,n).perLine)>=NA)&&(ax=!0),LN(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class PCt extends zo{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==Ir.ByPosNoHeight?Ir.ByPosNoHeight:Ir.ByPos;return c?u.join(this.right.lineAt(l,d,i,a,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,a){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,a);else{let u=this.lineAt(c,Ir.ByPos,i,r,s);t=t&&u.from<=n&&a(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,a)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let a=s.length;for(let l of i)s.push(l);if(t>0&&KZ(s,a-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?zo.of(this.break?[t,null,n]:[t,n]):(this.left=LN(this.left,t),this.right=LN(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:a}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+a.length&&r.more?c=a=a.updateHeight(t,l,i,r):a.updateHeight(t,l,i),c?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function KZ(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Ka&&(i=e[t+1])instanceof Ka&&e.splice(t-1,3,new Ka(n.length+1+i.length))}const DCt=5;class rQ{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Hl?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Hl(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=DCt)&&this.addLineDeco(r,s,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new Hl(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Ka(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Hl)return t;let n=new Hl(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Hl)&&!this.isCovered?this.nodes.push(new Hl(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),a=Math.min(a,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function FCt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function BCt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class f5{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 jCt(i),this.stateDeco=ZZ(n),this.heightMap=zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle.setDoc(n.doc),[new Gc(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);t.push(new ZT(s,a))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?YZ:new sQ(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Vw(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=ZZ(this.state);let r=t.changedRanges,s=Gc.extendWithRanges(r,MCt(i,this.stateDeco,t?t.changes:ma.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);GZ(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ax)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(f2e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Cr.RTL:Cr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=GTe(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,a=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=KTe(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=YTe(this.scrollParent||t.win);let b=(this.printing?BCt:$Ct)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(c=!0)),!this.inView&&!this.scrollTarget&&!FCt(t.dom))return 0;let O=l.width;if((this.contentDOMWidth!=O||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(a=!0),a||r.lineWrapping&&Math.abs(O-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();a=S>0&&r.refresh(s,S,E,C,Math.max(5,O/E),k),a&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),GZ();for(let S of this.viewports){let E=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(a?zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle,[new Gc(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new RCt(S.from,E))}ax&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new ZT(r.lineAt(a-i*1e3,Ir.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ir.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,Ir.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&s>1,a=r<<1;if(this.defaultTextDirection!=Cr.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromx));if(!v){if(fO.from<=f&&O.to>=f)){let O=n.moveToLineBoundary(it.cursor(f),!1,!0).head;O>d&&(f=O)}let y=this.gapSize(h,d,f,m),x=i||y<2e6?y:2e6;v=new f5(d,f,y,x)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,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=[];xi.spans(n,this.viewport.from,this.viewport.to,{span(s,a){i.push({from:s,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||Vw(this.heightMap.lineAt(t,Ir.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||Vw(this.heightMap.lineAt(this.scaler.fromDOM(t),Ir.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return Vw(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ZT{constructor(t,n){this.from=t,this.to=n}}function QCt(e,t,n){let i=[],r=e,s=0;return xi.spans(n,e,t,{span(){},point(a,l){a>r&&(i.push({from:r,to:a}),s+=a-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:a}=t[r],l=a-s;if(i<=l)return s+i;i-=l}}function e2(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function zCt(e,t){for(let n of e)if(t(n))return n}const YZ={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function ZZ(e){let t=e.facet(wI).filter(i=>typeof i!="function"),n=e.facet(tQ).filter(i=>typeof i!="function");return n.length&&t.push(xi.join(n)),t}class sQ{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Ir.ByPos,t,0,0).top,d=n.lineAt(c,Ir.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function Vw(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Tu(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>Vw(r,t)):e._content)}const t2=Zt.define({combine:e=>e.join(" ")}),F$=Zt.define({combine:e=>e.indexOf(!0)>-1}),B$=Cm.newName(),P2e=Cm.newName(),D2e=Cm.newName(),M2e={"&light":"."+P2e,"&dark":"."+D2e};function U$(e,t,n){return new Cm(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const VCt=U$("."+B$,{"&":{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"}},M2e),HCt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},h5=Xt.ie&&Xt.ie_version<=11;class qCt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new wEt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Xt.ie&&Xt.ie_version<=11||Xt.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Xt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Xt.chrome&&Xt.chrome_version<126)&&(this.editContext=new GCt(t),t.state.facet(zf)&&(t.contentDOM.editContext=this.editContext.editContext)),h5&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(zf)?i.root.activeElement!=this.dom:!FO(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Xt.ie&&Xt.ie_version<=11||Xt.android&&Xt.chrome)&&!i.state.selection.main.empty&&r.focusNode&&UO(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=nk(t.root);if(!n)return!1;let i=Xt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&WCt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=FO(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&dv(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&FO(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new uCt(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=S2e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!MN(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=JZ(n,t.previousSibling||t.target.previousSibling,-1),r=JZ(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(zf)!=t.state.facet(zf)&&(t.view.contentDOM.editContext=t.state.facet(zf)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function JZ(e,t,n){for(;t;){let i=Cs.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function eJ(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return UO(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function WCt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return eJ(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?eJ(e,n):null}class GCt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=k2e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=it.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));MN(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Gi.of(i.text.slice(d.from,d.toB).split(` +`))};if((Xt.mac||Xt.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Gi.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);iQ(t,f,it.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let a=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);a{let r=[];for(let s of i.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=nk(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,a,l,c,u)=>{if(i)return;let d=u.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Ft{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||OEt(t.parent)||document,this.viewState=new XZ(this,t.state||Ti.create(t)),t.scrollTo&&t.scrollTo.is(KT)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(My).map(r=>new o5(r));for(let r of this.plugins)r.update(this);this.observer=new qCt(this),this.inputState=new pCt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new LZ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Js?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(N2e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=j2e(s,a),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ti.phrases)!=this.state.facet(Ti.phrases))return this.setState(s);r=IN.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Ft.cursorScrollMargin);f=new fv(m.empty?m:it.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(KT)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=$N.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(zw)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(t2)!=r.state.facet(t2)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(P$))try{h(r)}catch(m){hl(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!S2e(this,d)&&u.force&&dv(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new XZ(this,t),this.plugins=t.facet(My).map(i=>new o5(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new LZ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(My),i=t.state.facet(My);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new o5(s));else{let l=this.plugins[a];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(YTe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,a=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return hl(this.state,g),tJ}}),f=IN.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(Xt.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(P$))l(n)}get themeClasses(){return B$+" "+(this.state.facet(F$)?D2e:P2e)+" "+this.state.facet(t2)}updateAttrs(){let t=nJ(this,m2e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zf)?"true":"false",class:"cm-content",style:`${Xt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),nJ(this,eQ,n);let i=this.observer.ignore(()=>{let r=jZ(this.contentDOM,this.contentAttrs,n),s=jZ(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(Ft.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(zw);let t=this.state.facet(Ft.cspNonce);Cm.mount(this.root,this.styleModules.concat(VCt).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 d5(this,t,$Z(this,t,n,i))}moveByGroup(t,n){return d5(this,t,$Z(this,t,n,i=>rCt(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 it.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return iCt(this,t,n,i)}moveVertically(t,n,i){return d5(this,t,sCt(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=L$(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),L$(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Ad.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==Cr.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(d2e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>KCt)return i2e(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||n2e(s.isolates,i=PZ(this,t))))return s.order;i||(i=PZ(this,t));let r=NEt(t.text,n,i);return this.bidiCache.push(new $N(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Xt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{XTe(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,a;return KT.of(new fv(typeof t=="number"?it.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return KT.of(new fv(it.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ts.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ts.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=Cm.newName(),r=[t2.of(i),zw.of(U$(`.${i}`,t))];return n&&n.dark&&r.push(F$.of(!0)),r}static baseTheme(t){return zh.lowest(zw.of(U$("."+B$,t,M2e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&Cs.get(i)||Cs.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Ft.styleModule=zw;Ft.inputHandler=c2e;Ft.clipboardInputFilter=ZU;Ft.clipboardOutputFilter=JU;Ft.scrollHandler=h2e;Ft.focusChangeEffect=u2e;Ft.perLineTextDirection=d2e;Ft.exceptionSink=l2e;Ft.updateListener=P$;Ft.editable=zf;Ft.mouseSelectionStyle=o2e;Ft.dragMovesSelection=a2e;Ft.clickAddsSelectionRange=s2e;Ft.decorations=wI;Ft.blockWrappers=g2e;Ft.outerDecorations=tQ;Ft.atomicRanges=ME;Ft.bidiIsolatedRanges=b2e;Ft.cursorScrollMargin=Zt.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Ft.scrollMargins=y2e;Ft.darkTheme=F$;Ft.cspNonce=Zt.define({combine:e=>e.length?e[0]:""});Ft.contentAttributes=eQ;Ft.editorAttributes=m2e;Ft.lineWrapping=Ft.contentAttributes.of({class:"cm-lineWrapping"});Ft.announce=Fn.define();const KCt=4096,tJ={};class $N{constructor(t,n,i,r,s,a){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=a}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:Cr.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],a=typeof s=="function"?s(e):s;a&&KU(a,n)}return n}const XCt=Xt.mac?"mac":Xt.windows?"win":Xt.linux?"linux":"key";function YCt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,a,l;for(let c=0;ci.concat(r),[]))),n}function JCt(e,t,n){return $2e(L2e(e.state),t,e,n)}let Rp=null;const eTt=4e3;function tTt(e,t=XCt){let n=Object.create(null),i=Object.create(null),r=(a,l)=>{let c=i[a];if(c==null)i[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,c,u,d)=>{var f,h;let m=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>YCt(y,t));for(let y=1;y{let w=Rp={view:O,prefix:x,scope:a};return setTimeout(()=>{Rp==w&&(Rp=null)},eTt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let a of e){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(m=>f(m,Q$))}let c=a[t]||a.key;if(c)for(let u of l)s(u,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(u,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let Q$=null;function $2e(e,t,n,i){Q$=t;let r=mEt(t),s=ol(r,0),a=vd(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;Rp&&Rp.view==n&&Rp.scope==i&&(l=Rp.prefix+" ",C2e.indexOf(t.keyCode)<0&&(u=!0,Rp=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+n2(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Xt.windows&&t.ctrlKey&&t.altKey)&&!(Xt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=Tm[t.keyCode])&&g!=r?(h(m[l+n2(g,t,!0)])||t.shiftKey&&(b=ek[t.keyCode])!=r&&b!=g&&h(m[l+n2(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(m[l+n2(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),Q$=null,c}class ob{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=F2e(t);return[new ob(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return nTt(t,n,i)}}function F2e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Cr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function rJ(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:a}),c=e.posAtCoords({x:s.right-1,y:a});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function nTt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==Cr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=F2e(e),u=a.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=M$(e,i,1),g=M$(e,r,-1),b=m.type==io.Text?m:null,v=g.type==io.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=rJ(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=rJ(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return x(O(n.from,n.to,b));{let k=b?O(n.from,null,b):w(m,!1),S=v?O(null,n.to,v):w(g,!0),E=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&T.from=R)break;I>P&&j(Math.max(U,P),k==null&&U<=A,Math.min(I,R),S==null&&I>=F,M.dir)}if(P=L.to+1,P>=R)break}return _.length==0&&j(A,k==null,F,S==null,e.textDirection),{top:C,bottom:N,horizontal:_}}function w(k,S){let E=l.top+(S?k.top:k.bottom);return{top:E,bottom:E,horizontal:[]}}}function iTt(e,t){return e.constructor==t.constructor&&e.eq(t)}class rTt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(jA)!=t.state.facet(jA)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(jA);for(;n!iTt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,Xt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const jA=Zt.define();function B2e(e){return[Ts.define(t=>new rTt(t,e)),jA.of(e)]}const ox=Zt.define({combine(e){return ef(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function sTt(e={}){return[ox.of(e),aTt,oTt,lTt,f2e.of(!0)]}function U2e(e){return e.startState.facet(ox)!=e.state.facet(ox)}const aTt=B2e({above:!0,markers(e){let{state:t}=e,n=t.facet(ox),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&Xt.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:it.cursor(r.head,r.assoc);for(let c of ob.forRange(e,a,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=U2e(e);return n&&sJ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){sJ(t.state,e)},class:"cm-cursorLayer"});function sJ(e,t){t.style.animationDuration=e.facet(ox).cursorBlinkRate+"ms"}const oTt=B2e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of ob.forRange(e,"cm-selectionBackground",r))t.push(s);if(Xt.ios&&!n.empty&&e.state.facet(ox).iosSelectionHandles){for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-start",it.cursor(n.from,1)))t.push(r);for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-end",it.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||U2e(e)},class:"cm-selectionLayer"}),lTt=zh.highest(Ft.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"}}}})),Q2e=Fn.define({map(e,t){return e==null?null:t.mapPos(e)}}),Hw=ro.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(Q2e)?i.value:n,e)}}),cTt=Ts.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Hw);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Hw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Hw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Hw)!=e&&this.view.dispatch({effects:Q2e.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 uTt(){return[Hw,cTt]}function aJ(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),a=n,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(a+l.index,l)}function dTt(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 fTt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:a=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(t){let n=new Ah,i=n.add.bind(n);for(let{from:r,to:s}of dTt(t,this.maxLength))aJ(t.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,t,a,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,a,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let a=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=a){let c=t.state.doc.lineAt(a),u=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){d=a;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const z$=/x/.unicode!=null?"gu":"g",hTt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,z$),pTt={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 p5=null;function mTt(){var e;if(p5==null&&typeof document<"u"&&document.body){let t=document.body.style;p5=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return p5||!1}const RA=Zt.define({combine(e){let t=ef(e,{render:null,specialChars:hTt,addSpecialChars:null});return(t.replaceTabs=!mTt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,z$)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,z$)),t}});function gTt(e={}){return[RA.of(e),bTt()]}let oJ=null;function bTt(){return oJ||(oJ=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=gn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(RA)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new fTt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=ol(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=Uu(a.text,l,i-a.from);return gn.replace({widget:new wTt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=gn.replace({widget:new xTt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(RA);e.startState.facet(RA)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const yTt="•";function vTt(e){return e>=32?yTt:e==10?"␤":String.fromCharCode(9216+e)}class xTt extends Yu{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=vTt(this.code),i=t.state.phrase("Control character")+" "+(pTt[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 wTt extends Yu{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function OTt(){return kTt}const STt=gn.line({class:"cm-activeLine"}),kTt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(STt.range(r.from)),t=r.from)}return gn.set(n)}},{decorations:e=>e.decorations});class ETt extends Yu{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?BO(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=ik(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function CTt(e){let t=Ts.fromClass(class{constructor(n){this.view=n,this.placeholder=e?gn.set([gn.widget({widget:new ETt(e),side:1}).range(0)]):gn.none}get decorations(){return this.view.state.doc.length?gn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Ft.contentAttributes.of({"aria-placeholder":e})]:t}const V$=2e3;function TTt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>V$||n.off>V$||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(it.range(u.from+a,u.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=S$(u.text,a,e.tabSize,!0);if(d<0)s.push(it.cursor(u.to));else{let f=S$(u.text,l,e.tabSize);s.push(it.range(u.from+d,u.from+f))}}}return s}function ATt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function lJ(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>V$?-1:r==i.length?ATt(e,t.clientX):Uu(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function _Tt(e,t){let n=lJ(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),a=r.state.doc.lineAt(s);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},i=i.map(r.changes)}},get(r,s,a){let l=lJ(e,r);if(!l)return i;let c=TTt(e.state,n,l);return c.length?a?it.create(c.concat(i.ranges)):it.create(c):i}}:null}function NTt(e){let t=n=>n.altKey&&n.button==0;return Ft.mouseSelectionStyle.of((n,i)=>t(i)?_Tt(n,i):null)}const jTt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},RTt={style:"cursor: crosshair"};function ITt(e={}){let[t,n]=jTt[e.key||"Alt"],i=Ts.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Ft.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?RTt:null})]}const i2="-10000px";class z2e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=i(a,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let a=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function PTt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const m5=Zt.define({combine:e=>{var t,n,i;return{position:Xt.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||PTt}}}),cJ=new WeakMap,aQ=Ts.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(m5);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 z2e(e,oQ,(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(m5);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=i2,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Xt.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=nQ(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(m5).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,a=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=i2;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=cJ.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||MTt,x=this.view.textDirection==Cr.LTR,O=h.width>i.right-i.left?x?i.left:i.right-h.width:x?Math.max(i.left,Math.min(f.left-(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),w=this.above[l];!c.strictSide&&(w?f.top-v-g-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let k=(w?f.top-i.top:i.bottom-f.bottom)-g;if(kO&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",uJ(d,(O-e.parent.left)/r)):(d.style.top=S/s+"px",uJ(d,O/r)),m){let C=f.left+(x?y.x:-y.x)-(O+14-7);m.style.left=C/r+"px"}u.overlap!==!0&&a.push({left:O,top:S,right:E,bottom:S+v}),d.classList.toggle("cm-tooltip-above",w),d.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=i2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function uJ(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const DTt=Ft.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"}}}),MTt={x:0,y:0},oQ=Zt.define({enables:[aQ,DTt]}),FN=Zt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class EI{static create(t){return new EI(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new z2e(t,FN,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const LTt=oQ.compute([FN],e=>{let t=e.facet(FN);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:EI.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),V2e=Zt.define();class $Tt{constructor(t,n,i,r,s,a){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==Cr.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,a(c))},c=>hl(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(aQ),n=t?t.manager.tooltips.findIndex(i=>i.create==EI.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!FTt(s.dom,t)||this.pending){let{pos:a}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!BTt(this.view,a,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const r2=4;function FTt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-r2&&t.clientX<=i+r2&&t.clientY>=r-r2&&t.clientY<=s+r2}function BTt(e,t,n,i,r,s){let a=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(a.left>i||a.rightr||Math.min(a.bottom,l)=t&&c<=n}function UTt(e,t={}){let n=Fn.define(),i=new WeakMap,r=ro.define({create(){return[]},update(a,l){let c=i.get(a);if(a.length&&(t.hideOnChange&&(l.docChanged||l.selection)?a=[]:c&&c(l)?a=[]:t.hideOn&&(a=a.filter(u=>!t.hideOn(l,u)))),l.docChanged&&a.length){let u=[];for(let d of a){let f=l.changes.mapPos(d.pos,-1,eo.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}a=u}for(let u of l.effects)u.is(n)&&(a=u.value,c=void 0),(u.is(zTt)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>FN.from(a)});const s=Ts.define(a=>new $Tt(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,V2e.of(s),LTt]}}function QTt(e,t,n,i={}){var r;let s=e.state.facet(V2e).map(a=>e.plugin(a)).filter(a=>!!a);if(i.tooltip&&i.tooltip.active){let a=s.find(l=>l.field==i.tooltip.active);a&&(s=[a])}for(let a of s)a.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function H2e(e,t){let n=e.plugin(aQ);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const zTt=Fn.define(),dJ=Zt.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function lQ(e,t){let n=e.plugin(q2e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const q2e=Ts.fromClass(class{constructor(e){this.input=e.state.facet(sk),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(dJ);this.top=new s2(e,!0,t.topContainer),this.bottom=new s2(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(dJ);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new s2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new s2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(sk);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],a=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:a).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Ft.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class s2{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=fJ(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=fJ(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 fJ(e){let t=e.nextSibling;return e.remove(),t}const sk=Zt.define({enables:q2e});function VTt(e,t){let n,i=new Promise(a=>n=a),r=a=>HTt(a,t,n);e.state.field(g5,!1)?e.dispatch({effects:W2e.of(r)}):e.dispatch({effects:Fn.appendConfig.of(g5.init(()=>[r]))});let s=G2e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(g5).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const g5=ro.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(W2e)?e=[n.value].concat(e):n.is(G2e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>sk.computeN([e],t=>t.field(e))}),W2e=Fn.define(),G2e=Fn.define();function HTt(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=yr("form"),t.input){let l=yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),a(null)):u.keyCode==13&&(u.preventDefault(),a(c))}),c.addEventListener("submit",u=>{u.preventDefault(),a(c)})}let s=yr("div",i,yr("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function a(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Nh extends Em{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Nh.prototype.elementClass="";Nh.prototype.toDOM=void 0;Nh.prototype.mapMode=eo.TrackBefore;Nh.prototype.startSide=Nh.prototype.endSide=-1;Nh.prototype.point=!0;const IA=Zt.define(),qTt=Zt.define(),WTt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>xi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},zO=Zt.define();function GTt(e){return[K2e(),zO.of({...WTt,...e})]}const hJ=Zt.define({combine:e=>e.some(t=>t)});function K2e(e){return[KTt]}const KTt=Ts.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(zO).map(t=>new mJ(e,t)),this.fixed=!e.state.facet(hJ);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(hJ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=xi.iter(this.view.state.facet(IA),this.view.viewport.from),i=[],r=this.gutters.map(s=>new XTt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==io.Text&&a){H$(n,i,l.from);for(let c of r)c.line(this.view,l,i);a=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==io.Text){H$(n,i,s.from);for(let a of r)a.line(this.view,s,i)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(zO),n=e.state.facet(zO),i=e.docChanged||e.heightChanged||e.viewportChanged||!xi.eq(e.startState.facet(IA),e.state.facet(IA),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let a=t.indexOf(s);a<0?r.push(new mJ(this.view,s)):(this.gutters[a].update(e),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Ft.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Cr.LTR?{left:i,right:r}:{right:i,left:r}})});function pJ(e){return Array.isArray(e)?e:[e]}function H$(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class XTt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=xi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,a=n.height/t.scaleY;if(this.i==r.elements.length){let l=new X2e(t,a,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,a,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];H$(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(qTt)){let a=s(t,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class mJ{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=r.clientY;let l=t.lineBlockAtHeight(a-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=pJ(n.markers(t)),n.initialSpacer&&(this.spacer=new X2e(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=pJ(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!xi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class X2e{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":""),YTt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,c=ss(l,c,u)||a(l,c,u):a}return i}})}});class b5 extends Nh{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function y5(e,t){return e.state.facet(Ly).formatNumber(t,e.state)}const e2t=zO.compute([Ly],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(ZTt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new b5(y5(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(JTt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ly)!=t.state.facet(Ly),initialSpacer(t){return new b5(y5(t,gJ(t.state.doc.lines)))},updateSpacer(t,n){let i=y5(n.view,gJ(n.view.state.doc.lines));return i==t.number?t:new b5(i)},domEventHandlers:e.facet(Ly).domEventHandlers,side:"before"}));function Y2e(e={}){return[Ly.of(e),K2e(),e2t]}function gJ(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(t2t.range(r)))}return xi.of(t)});function i2t(){return n2t}let r2t=0,gd=class q${constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=r2t++}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 q$&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new q$(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new BN(t);return i=>i.modified.indexOf(n)>-1?i:BN.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},s2t=0;class BN{constructor(t){this.name=t,this.instances=[],this.id=s2t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&a2t(n,l.modified));if(i)return i;let r=[],s=new gd(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=o2t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(BN.get(l,c));return s}}function a2t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function o2t(e){let t=[[]];for(let n=0;ni.length-n.length)}function Vh(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],a=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){a=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new ak(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return Z2e.add(t)}const Z2e=new Ln({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new ak(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let ak=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let a=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){a=a?a+" "+u:u;break}}return a},scope:i}}function l2t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function c2t(e,t,n,i=0,r=e.length){let s=new u2t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class u2t{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:a,from:l,to:c}=t;if(l>=i||c<=n)return;a.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(a)));let u=r,d=d2t(t)||ak.empty,f=l2t(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(Ln.mounted);if(h&&h.overlay){let 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 x=v=O||!t.nextSibling())););if(!x||O>i)break;y=x.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,x.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function d2t(e){let t=e.type.prop(Z2e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const Vt=gd.define,a2=Vt(),Sp=Vt(),bJ=Vt(Sp),yJ=Vt(Sp),kp=Vt(),o2=Vt(kp),v5=Vt(kp),fd=Vt(),ag=Vt(fd),ld=Vt(),cd=Vt(),W$=Vt(),J1=Vt(W$),l2=Vt(),ne={comment:a2,lineComment:Vt(a2),blockComment:Vt(a2),docComment:Vt(a2),name:Sp,variableName:Vt(Sp),typeName:bJ,tagName:Vt(bJ),propertyName:yJ,attributeName:Vt(yJ),className:Vt(Sp),labelName:Vt(Sp),namespace:Vt(Sp),macroName:Vt(Sp),literal:kp,string:o2,docString:Vt(o2),character:Vt(o2),attributeValue:Vt(o2),number:v5,integer:Vt(v5),float:Vt(v5),bool:Vt(kp),regexp:Vt(kp),escape:Vt(kp),color:Vt(kp),url:Vt(kp),keyword:ld,self:Vt(ld),null:Vt(ld),atom:Vt(ld),unit:Vt(ld),modifier:Vt(ld),operatorKeyword:Vt(ld),controlKeyword:Vt(ld),definitionKeyword:Vt(ld),moduleKeyword:Vt(ld),operator:cd,derefOperator:Vt(cd),arithmeticOperator:Vt(cd),logicOperator:Vt(cd),bitwiseOperator:Vt(cd),compareOperator:Vt(cd),updateOperator:Vt(cd),definitionOperator:Vt(cd),typeOperator:Vt(cd),controlOperator:Vt(cd),punctuation:W$,separator:Vt(W$),bracket:J1,angleBracket:Vt(J1),squareBracket:Vt(J1),paren:Vt(J1),brace:Vt(J1),content:fd,heading:ag,heading1:Vt(ag),heading2:Vt(ag),heading3:Vt(ag),heading4:Vt(ag),heading5:Vt(ag),heading6:Vt(ag),contentSeparator:Vt(fd),list:Vt(fd),quote:Vt(fd),emphasis:Vt(fd),strong:Vt(fd),link:Vt(fd),monospace:Vt(fd),strikethrough:Vt(fd),inserted:Vt(),deleted:Vt(),changed:Vt(),invalid:Vt(),meta:l2,documentMeta:Vt(l2),annotation:Vt(l2),processingInstruction:Vt(l2),definition:gd.defineModifier("definition"),constant:gd.defineModifier("constant"),function:gd.defineModifier("function"),standard:gd.defineModifier("standard"),local:gd.defineModifier("local"),special:gd.defineModifier("special")};for(let e in ne){let t=ne[e];t instanceof gd&&(t.name=e)}J2e([{tag:ne.link,class:"tok-link"},{tag:ne.heading,class:"tok-heading"},{tag:ne.emphasis,class:"tok-emphasis"},{tag:ne.strong,class:"tok-strong"},{tag:ne.keyword,class:"tok-keyword"},{tag:ne.atom,class:"tok-atom"},{tag:ne.bool,class:"tok-bool"},{tag:ne.url,class:"tok-url"},{tag:ne.labelName,class:"tok-labelName"},{tag:ne.inserted,class:"tok-inserted"},{tag:ne.deleted,class:"tok-deleted"},{tag:ne.literal,class:"tok-literal"},{tag:ne.string,class:"tok-string"},{tag:ne.number,class:"tok-number"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],class:"tok-string2"},{tag:ne.variableName,class:"tok-variableName"},{tag:ne.local(ne.variableName),class:"tok-variableName tok-local"},{tag:ne.definition(ne.variableName),class:"tok-variableName tok-definition"},{tag:ne.special(ne.variableName),class:"tok-variableName2"},{tag:ne.definition(ne.propertyName),class:"tok-propertyName tok-definition"},{tag:ne.typeName,class:"tok-typeName"},{tag:ne.namespace,class:"tok-namespace"},{tag:ne.className,class:"tok-className"},{tag:ne.macroName,class:"tok-macroName"},{tag:ne.propertyName,class:"tok-propertyName"},{tag:ne.operator,class:"tok-operator"},{tag:ne.comment,class:"tok-comment"},{tag:ne.meta,class:"tok-meta"},{tag:ne.invalid,class:"tok-invalid"},{tag:ne.punctuation,class:"tok-punctuation"}]);var x5;const zp=new Ln;function CI(e){return Zt.define({combine:e?t=>t.concat(e):void 0})}const cQ=new Ln;class ec{constructor(t,n,i=[],r=""){this.data=t,this.name=r,Ti.prototype.hasOwnProperty("tree")||Object.defineProperty(Ti.prototype,"tree",{get(){return Or(this)}}),this.parser=n,this.extension=[_m.of(this),Ti.languageData.of((s,a,l)=>{let c=vJ(s,a,l),u=c.type.prop(zp);if(!u)return[];let d=s.facet(u),f=c.type.prop(cQ);if(f){let h=c.resolve(a-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return vJ(t,n,i).type.prop(zp)==this.data}findRegions(t){let n=t.facet(_m);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,a)=>{if(s.prop(zp)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(Ln.mounted);if(l){if(l.tree.prop(zp)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+a,to:c.to+a});else i.push({from:a,to:a+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+a),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new jh(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Or(e){let t=e.field(ec.state,!1);return t?t.tree:hi.empty}class f2t{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let ew=null;class Ib{constructor(t,n,i=[],r,s,a,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new Ib(t,n,[],hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new f2t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(uh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=ew;ew=this;try{return t()}finally{ew=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=xJ(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=uh.applyChanges(i,c),r=hi.empty,s=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=xJ(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends yI{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=ew;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=a,new hi(ea.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return ew}}function xJ(e,t,n){return uh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class lx{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new lx(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Ib.create(t.facet(_m).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new lx(i)}}ec.state=ro.define({create:lx.init,update(e,t){for(let n of t.effects)if(n.is(ec.setState))return n.value;return t.startState.facet(_m)!=t.state.facet(_m)?lx.init(t.state):e.apply(t)}});let eAe=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(eAe=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const w5=typeof navigator<"u"&&(!((x5=navigator.scheduling)===null||x5===void 0)&&x5.isInputPending)?()=>navigator.scheduling.isInputPending():null,h2t=Ts.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ec.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ec.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=eAe(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>w5&&w5()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ec.setState.of(new lx(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hl(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_m=Zt.define({combine(e){return e.length?e[0]:null},enables:e=>[ec.state,h2t,Ft.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Nm{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class UN{constructor(t,n,i,r,s,a=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new UN(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return r}return null}}const p2t=Zt.define(),i1=Zt.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Pb(e){let t=e.facet(i1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function ok(e,t){let n="",i=e.tabSize,r=e.facet(i1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?m2t(e,n,t):null}class TI{constructor(t,n={}){this.state=t,this.options=n,this.unit=Pb(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=a-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Uu(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Hh=new Ln;function m2t(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let a=r;a&&!(a.fromi.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)i={node:s[a],next:i}}return tAe(i,e,n)}function tAe(e,t,n){for(let i=e;i;i=i.next){let r=b2t(i.node);if(r)return r(dQ.create(t,n,i))}return 0}function g2t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function b2t(e){let t=e.type.prop(Hh);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Ln.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>nAe(a,!0,1,void 0,s&&!g2t(a)?r.from:void 0)}return e.parent==null?y2t:null}function y2t(){return 0}class dQ extends TI{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new dQ(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(v2t(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return tAe(this.context.next,this.base,this.pos)}}function v2t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function x2t(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function hv({closing:e,align:t=!0,units:n=1}){return i=>nAe(i,t,n,e)}function nAe(e,t,n,i,r){let s=e.textAfter,a=s.match(/^\s*/)[0].length,l=i&&s.slice(a,a+i.length)==i||r==e.pos+a,c=t?x2t(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const w2t=e=>e.baseIndent;function pv({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const O2t=200;function S2t(){return Ti.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+O2t)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:a}=e,l=-1,c=[];for(let{head:u}of a.selection.ranges){let d=a.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=uQ(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=ok(a,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const iAe=Zt.define(),qh=new Ln;function LE(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function E2t(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function QN(e,t,n){for(let i of e.facet(iAe)){let r=i(e,t,n);if(r)return r}return k2t(e,t,n)}function rAe(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const AI=Fn.define({map:rAe}),$E=Fn.define({map:rAe});function sAe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const Db=ro.define({create(){return gn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=wJ(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(AI)&&!C2t(e,i.value.from,i.value.to)?n.push(i.value):i.is($E)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(lAe),r=n.map(s=>(i?gn.replace({widget:new I2t(i(t.state,s))}):OJ).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=wJ(e,t.selection.main.head)),e},provide:e=>Ft.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function zN(e,t,n){var i;let r=null;return(i=e.field(Db,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function C2t(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function aAe(e,t){return e.field(Db,!1)?t:t.concat(Fn.appendConfig.of(cAe()))}const T2t=e=>{for(let t of sAe(e)){let n=QN(e.state,t.from,t.to);if(n)return e.dispatch({effects:aAe(e.state,[AI.of(n),oAe(e,n)])}),!0}return!1},A2t=e=>{if(!e.state.field(Db,!1))return!1;let t=[];for(let n of sAe(e)){let i=zN(e.state,n.from,n.to);i&&t.push($E.of(i),oAe(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function oAe(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Ft.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const _2t=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Db,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push($E.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},j2t=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:T2t},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:A2t},{key:"Ctrl-Alt-[",run:_2t},{key:"Ctrl-Alt-]",run:N2t}],R2t={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},lAe=Zt.define({combine(e){return ef(e,R2t)}});function cAe(e){return[Db,M2t]}function uAe(e,t){let{state:n}=e,i=n.facet(lAe),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=zN(e.state,l.from,l.to);c&&e.dispatch({effects:$E.of(c)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const OJ=gn.replace({widget:new class extends Yu{toDOM(e){return uAe(e,null)}}});class I2t extends Yu{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return uAe(t,this.value)}}const P2t={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class O5 extends Nh{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function D2t(e={}){let t={...P2t,...e},n=new O5(t,!0),i=new O5(t,!1),r=Ts.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(_m)!=a.state.facet(_m)||a.startState.field(Db,!1)!=a.state.field(Db,!1)||Or(a.startState)!=Or(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Ah;for(let c of a.viewportLineBlocks){let u=zN(a.state,c.from,c.to)?i:QN(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,GTt({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||xi.empty},initialSpacer(){return new O5(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=zN(a.state,l.from,l.to);if(u)return a.dispatch({effects:$E.of(u)}),!0;let d=QN(a.state,l.from,l.to);return d?(a.dispatch({effects:AI.of(d)}),!0):!1}}}),cAe()]}const M2t=Ft.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class FE{constructor(t,n){this.specs=t;let i;function r(l){let c=Cm.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof ec?l=>l.prop(zp)==a.data:a?l=>l==a:void 0,this.style=J2e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Cm(i):null,this.themeType=n.themeType}static define(t,n){return new FE(t,n||{})}}const G$=Zt.define(),dAe=Zt.define({combine(e){return e.length?[e[0]]:null}});function PA(e){let t=e.facet(G$);return t.length?t:e.facet(dAe)}function fAe(e,t){let n=[$2t],i;return e instanceof FE&&(e.module&&n.push(Ft.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(dAe.of(e)):i?n.push(G$.computeN([Ft.darkTheme],r=>r.facet(Ft.darkTheme)==(i=="dark")?[e]:[])):n.push(G$.of(e)),n}function SHt(e,t,n){let i=PA(e),r=null;if(i){for(let s of i)if(!s.scope||n){let a=s.style(t);a&&(r=r?r+" "+a:a)}}return r}class L2t{constructor(t){this.markCache=Object.create(null),this.tree=Or(t.state),this.decorations=this.buildDeco(t,PA(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Or(t.state),i=PA(t.state),r=i!=PA(t.startState),{viewport:s}=t.view,a=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=a):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return gn.none;let i=new Ah;for(let{from:r,to:s}of t.visibleRanges)c2t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=gn.mark({class:c})))},r,s);return i.finish()}}const $2t=zh.high(Ts.fromClass(L2t,{decorations:e=>e.decorations})),F2t=FE.define([{tag:ne.meta,color:"#404740"},{tag:ne.link,textDecoration:"underline"},{tag:ne.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strong,fontWeight:"bold"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.keyword,color:"#708"},{tag:[ne.atom,ne.bool,ne.url,ne.contentSeparator,ne.labelName],color:"#219"},{tag:[ne.literal,ne.inserted],color:"#164"},{tag:[ne.string,ne.deleted],color:"#a11"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],color:"#e40"},{tag:ne.definition(ne.variableName),color:"#00f"},{tag:ne.local(ne.variableName),color:"#30a"},{tag:[ne.typeName,ne.namespace],color:"#085"},{tag:ne.className,color:"#167"},{tag:[ne.special(ne.variableName),ne.macroName],color:"#256"},{tag:ne.definition(ne.propertyName),color:"#00c"},{tag:ne.comment,color:"#940"},{tag:ne.invalid,color:"#f00"}]),B2t=Ft.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),hAe=1e4,pAe="()[]{}",mAe=Zt.define({combine(e){return ef(e,{afterCursor:!0,brackets:pAe,maxScanDistance:hAe,renderMatch:z2t})}}),U2t=gn.mark({class:"cm-matchingBracket"}),Q2t=gn.mark({class:"cm-nonmatchingBracket"});function z2t(e){let t=[],n=e.matched?U2t:Q2t;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 SJ(e){let t=[],n=e.facet(mAe);for(let i of e.selection.ranges){if(!i.empty)continue;let r=_d(e,i.head,-1,n)||i.head>0&&_d(e,i.head-1,1,n)||n.afterCursor&&(_d(e,i.head,1,n)||i.heade.decorations}),H2t=[V2t,B2t];function q2t(e={}){return[mAe.of(e),H2t]}const gAe=new Ln;function K$(e,t,n){let i=e.prop(t<0?Ln.openedBy:Ln.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function X$(e){let t=e.type.prop(gAe);return t?t(e.node):e}function _d(e,t,n,i={}){let r=i.maxScanDistance||hAe,s=i.brackets||pAe,a=Or(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=K$(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return W2t(e,t,n,c,d,u,s)}}return G2t(e,t,n,a,l.type,r,s)}function W2t(e,t,n,i,r,s,a){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=a.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function kJ(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let a=i;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?a.toLowerCase():a,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function K2t(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||X2t,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||pQ,mergeTokens:e.mergeTokens!==!1}}function X2t(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 EJ=new WeakMap;class fQ extends ec{constructor(t){let n=CI(t.languageData),i=K2t(t),r,s=new class extends yI{createParse(a,l,c){return new Z2t(r,a,l,c)}};super(n,s,[],t.name),this.topNode=tAt(n,this),r=this,this.streamParser=i,this.stateAfter=new Ln({perNode:!0}),this.tokenTable=t.tokenTable?new wAe(i.tokenTable):eAt}static define(t){return new fQ(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=EJ.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let l=t.children[a],c=n+t.positions[a],u=l instanceof hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let a=t.positions[s],l=t.children[s],c;if(an&&hQ(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=yAe(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?Pb(r):4),tree:hi.empty}}let Z2t=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Ib.get(),a=r[0].from,{state:l,tree:c}=Y2t(t,i,a,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Pb(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Ib.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` `&&(n="");else{let i=n.indexOf(` -`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,l=this.lineAfter(a);n+=l,i=a+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&a>=0&&this.chunk[a]==t&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,a=new gAe(n,t?t.state.tabSize:4,t?Pb(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=yAe(s.token,a,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const pQ=Object.create(null),lk=[ea.none],Z2t=new t1(lk),CJ=[],TJ=Object.create(null),vAe=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"]])vAe[e]=wAe(pQ,t);class xAe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),vAe)}resolve(t){return t?this.table[t]||(this.table[t]=wAe(this.extra,t)):0}}const J2t=new xAe(pQ);function S5(e,t){CJ.indexOf(e)>-1||(CJ.push(e),console.warn(t))}function wAe(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||ne[u];d?typeof d=="function"?c.length?c=c.map(d):S5(u,`Modifier ${u} used at start of tag`):c.length?S5(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:S5(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=TJ[r];if(s)return s.id;let a=TJ[r]=ea.define({id:lk.length,name:i,props:[Vh({[i]:n})]});return lk.push(a),a.id}function eAt(e,t){let n=ea.define({id:lk.length,name:"Document",props:[zp.add(()=>e),Hh.add(()=>i=>t.getIndent(i))],top:!0});return lk.push(n),n}Cr.RTL,Cr.LTR;var AJ={};class VN{constructor(t,n,i,r,s,a,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new VN(t,[],n,i,i,0,[],0,r?new _J(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(n==i)return;if(this.buffer[a-2]>=n){this.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=t,this.buffer[a+1]=n,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>i||n<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=a.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new VN(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new tAt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,a;sc&1&&l==a)||r.push(n[s],a)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let c=a&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(a,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class _J{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class tAt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class HN{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new HN(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new HN(this.stack,this.pos,this.index)}}function qw(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class DA{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const NJ=new DA;class nAt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=NJ,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-i.to,i=a}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=NJ,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class mv{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;OAe(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}mv.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class qN{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?qw(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(OAe(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,a==null)break;t.reset(a,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}qN.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class zs{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function OAe(e,t,n,i,r,s){let a=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||iAt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[a+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){a=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{a=e[g+2],t.advance();continue e}}break}}function jJ(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function iAt(e,t,n,i){let r=jJ(n,i,t);return r<0||jJ(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 rAt=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?RJ(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?RJ(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=a,null;if(s instanceof hi){if(a==t){if(a=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}};class sAt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new DA)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,a=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new DA,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new DA,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let a=0;a=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new rAt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[a]=t;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let a=r&&lAt(r);if(a)return Dl&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Dl&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(a)return Dl&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((l,c)=>c.score-l.score);i.length>a;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let a=0;a500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,l)=>l.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Ln.contextHash)||0)==d))return t.useNode(f,h),Dl&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof hi)||f.children.length==0||f.positions[0]>0)break;let 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),Dl&&console.log(a+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return IJ(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let a=0;a ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Dl&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(Dl&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)Dl&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))Dl&&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),Dl&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),IJ(l,i)):(!r||r.scoree;class _I{constructor(t){this.start=t.start,this.shift=t.shift||E5,this.reduce=t.reduce||E5,this.reuse=t.reuse||E5,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Rh extends yI{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new t1(n.map((l,c)=>ea.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=xTe;let a=qw(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new mv(a,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new aAt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let a=r[s++],l=a&1,c=r[s++];if(l&&i)return c;for(let u=s+(a>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Lf(this.data,s+2);else break;r=n(Lf(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Lf(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,a)=>a&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(Rh.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let a=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=PJ(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let a=n.indexOf(s);a>=0&&(i[a]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const cAt=316,uAt=317,DJ=1,dAt=2,fAt=3,hAt=4,pAt=318,mAt=320,gAt=321,bAt=5,yAt=6,vAt=0,Y$=[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],SAe=125,xAt=59,Z$=47,wAt=42,OAt=43,SAt=45,kAt=60,EAt=44,CAt=63,TAt=46,AAt=91,_At=new _I({start:!1,shift(e,t){return t==bAt||t==yAt||t==mAt?e:t==gAt},strict:!1}),NAt=new zs((e,t)=>{let{next:n}=e;(n==SAe||n==-1||t.context)&&e.acceptToken(pAt)},{contextual:!0,fallback:!0}),jAt=new zs((e,t)=>{let{next:n}=e,i;Y$.indexOf(n)>-1||n==Z$&&((i=e.peek(1))==Z$||i==wAt)||n!=SAe&&n!=xAt&&n!=-1&&!t.context&&e.acceptToken(cAt)},{contextual:!0}),RAt=new zs((e,t)=>{e.next==AAt&&!t.context&&e.acceptToken(uAt)},{contextual:!0}),IAt=new zs((e,t)=>{let{next:n}=e;if(n==OAt||n==SAt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(DJ);e.acceptToken(i?DJ:dAt)}}else n==CAt&&e.peek(1)==TAt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(fAt))},{contextual:!0});function C5(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const PAt=new zs((e,t)=>{if(e.next!=kAt||!t.dialectEnabled(vAt)||(e.advance(),e.next==Z$))return;let n=0;for(;Y$.indexOf(e.next)>-1;)e.advance(),n++;if(C5(e.next,!0)){for(e.advance(),n++;C5(e.next,!1);)e.advance(),n++;for(;Y$.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==EAt)return;for(let i=0;;i++){if(i==7){if(!C5(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(hAt,-n)}),DAt=Vh({"get set async static":ne.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ne.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ne.operatorKeyword,"let var const using function class extends":ne.definitionKeyword,"import export from":ne.moduleKeyword,"with debugger new":ne.keyword,TemplateString:ne.special(ne.string),super:ne.atom,BooleanLiteral:ne.bool,this:ne.self,null:ne.null,Star:ne.modifier,VariableName:ne.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ne.function(ne.variableName),VariableDefinition:ne.definition(ne.variableName),Label:ne.labelName,PropertyName:ne.propertyName,PrivatePropertyName:ne.special(ne.propertyName),"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),"FunctionDeclaration/VariableDefinition":ne.function(ne.definition(ne.variableName)),"ClassDeclaration/VariableDefinition":ne.definition(ne.className),"NewExpression/VariableName":ne.className,PropertyDefinition:ne.definition(ne.propertyName),PrivatePropertyDefinition:ne.definition(ne.special(ne.propertyName)),UpdateOp:ne.updateOperator,"LineComment Hashbang":ne.lineComment,BlockComment:ne.blockComment,Number:ne.number,String:ne.string,Escape:ne.escape,ArithOp:ne.arithmeticOperator,LogicOp:ne.logicOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,RegExp:ne.regexp,Equals:ne.definitionOperator,Arrow:ne.function(ne.punctuation),": Spread":ne.punctuation,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,"InterpolationStart InterpolationEnd":ne.special(ne.brace),".":ne.derefOperator,", ;":ne.separator,"@":ne.meta,TypeName:ne.typeName,TypeDefinition:ne.definition(ne.typeName),"type enum interface implements namespace module declare":ne.definitionKeyword,"abstract global Privacy readonly override":ne.modifier,"is keyof unique infer asserts":ne.operatorKeyword,JSXAttributeValue:ne.attributeValue,JSXText:ne.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ne.angleBracket,"JSXIdentifier JSXNameSpacedName":ne.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ne.attributeName,"JSXBuiltin/JSXIdentifier":ne.standard(ne.tagName)}),MAt={__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},LAt={__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},$At={__proto__:null,"<":193},FAt=Rh.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_At,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:[DAt],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:[jAt,RAt,IAt,PAt,2,3,4,5,6,7,8,9,10,11,12,13,14,NAt,new qN("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new qN("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>MAt[e]||-1},{term:343,get:e=>LAt[e]||-1},{term:95,get:e=>$At[e]||-1}],tokenPrec:15201});class mQ{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Or(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(EAe(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 MJ(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 BAt(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+$/]:BAt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function kAe(e,t){return n=>{for(let i=Or(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class LJ{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function lb(e){return e.selection.main.from}function EAe(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 bQ=Jd.define();function UAt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,a=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:c},range:it.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const $J=new WeakMap;function QAt(e){if(!Array.isArray(e))return e;let t=$J.get(e);return t||$J.set(e,t=gQ(e)),t}const WN=Fn.define(),ck=Fn.define();class zAt{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=VU(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!x||E==1&&v||w==0&&E!=0)&&(n[f]==k||i[f]==k&&(h=!0)?a[f++]=x:a.length&&(y=!1)),w=E,x+=vd(k)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),a,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let a of n){let l=a+(this.astral?vd(ol(i,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(t-i.length,r)}}class VAt{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:HAt,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=>FJ(t(i),n(i)),optionClass:(t,n)=>i=>FJ(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function FJ(e,t){return e?t?e+" "+t:e:t}function HAt(e,t,n,i,r,s){let a=e.textDirection==Cr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||x>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}const yQ=Fn.define();function qAt(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&a.appendChild(document.createTextNode(l.slice(c,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function T5(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 WAt{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:a}=r.open,l=t.state.facet(Ma);this.optionContent=qAt(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=T5(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:yQ.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Ma).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:ck.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:a,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=T5(s.length,a,t.state.facet(Ma).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=T5(n.options.length,n.selected,this.view.state.facet(Ma).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>hl(this.view.state,l,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&KAt(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{a.target==r&&a.preventDefault()});let s=null;for(let a=i.from;ai.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew WAt(n,e,t)}function KAt(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 BJ(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function XAt(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(Ma);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new LJ(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=a.filterStrict?new VAt(h):new zAt(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 LJ(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:x}=b.section;r||(r=Object.create(null)),r[x]=Math.max(y,r[x]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(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):BJ(d.completion)>BJ(c)&&(l[l.length-1]=d),c=d.completion}return l}class $y{constructor(t,n,i,r,s,a){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new $y(this.options,UJ(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,a){if(r&&!a&&t.some(u=>u.isPending))return r.setDisabled();let l=XAt(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Ma).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:n_t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new $y(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $y(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class GN{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new GN(e_t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Ma),s=(i.override||n.languageDataAt("autocomplete",lb(n)).map(QAt)).map(c=>(this.active.find(d=>d.source==c)||new Kc(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let a=this.open,l=t.effects.some(c=>c.is(vQ));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!YAt(s,this.active)||l?a=$y.build(s,n,this.id,a,i,l):a&&a.disabled&&!s.some(c=>c.isPending)&&(a=null),!a&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Kc(c.source,0):c));for(let c of t.effects)c.is(yQ)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new GN(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ZAt:JAt}}function YAt(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const e_t=[];function CAe(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(bQ);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Kc{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=CAe(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Kc(r.source,0)),i&4&&r.state==0&&(r=new Kc(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(WN))r=new Kc(r.source,1,s.value);else if(s.is(ck))r=new Kc(r.source,0);else if(s.is(vQ))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(lb(t.state))}}class gv extends Kc{constructor(t,n,i,r,s,a){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),l=lb(t.state);if(l>a||!r||n&2&&(lb(t.startState)==this.from||ln.map(t))}}),ll=ro.define({create(){return GN.start()},update(e,t){return e.update(t)},provide:e=>[oQ.from(e,t=>t.tooltip),Ft.contentAttributes.from(e,t=>t.attrs)]});function xQ(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(ll).active.find(r=>r.source==t.source);return i instanceof gv?(typeof n=="string"?e.dispatch({...UAt(e.state,n,i.from,i.to),annotations:bQ.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const n_t=GAt(ll,xQ);function c2(e,t="option"){return n=>{let i=n.state.field(ll,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:a-1;return l<0?l=t=="page"?0:a-1:l>=a&&(l=t=="page"?a-1:0),n.dispatch({effects:yQ.of(l)}),!0}}const i_t=e=>{let t=e.state.field(ll,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(ll,!1)?(e.dispatch({effects:WN.of(!0)}),!0):!1,r_t=e=>{let t=e.state.field(ll,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:ck.of(null)}),!0)};class s_t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const a_t=50,o_t=1e3,l_t=Ts.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ll).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ll),n=e.state.facet(Ma);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ll)==t)return;let i=e.transactions.some(s=>{let a=CAe(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;sa_t&&Date.now()-a.time>o_t){for(let l of a.context.abortListeners)try{l()}catch(c){hl(this.view.state,c)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(a=>a.is(WN)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ll);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=lb(t),i=new mQ(t,n,e.explicit,this.view),r=new s_t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ck.of(null)}),hl(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ma),i=this.view.state.field(ll);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Kc(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:vQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ll,!1);if(t&&t.tooltip&&this.view.state.facet(Ma).closeOnBlur){let n=t.open&&V2e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ck.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:WN.of(!1)}),20),this.composing=0}}}),c_t=typeof navigator=="object"&&/Win/.test(navigator.platform),u_t=zh.highest(Ft.domEventHandlers({keydown(e,t){let n=t.state.field(ll,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(c_t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(a=>a.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&xQ(t,i),!1}})),TAe=Ft.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 d_t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class wQ{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,eo.TrackDel),i=t.mapPos(this.to,1,eo.TrackDel);return n==null||i==null?null:new wQ(this.field,n,i)}}class OQ{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=a,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew wQ(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let a of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new d_t(u,i.length,s.index,s.index+d.length)),a=a.slice(0,s.index)+c+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(a)}return new OQ(i,r)}}let f_t=gn.widget({widget:new class extends Yu{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),h_t=gn.mark({class:"cm-snippetField"});class r1{constructor(t,n){this.ranges=t,this.active=n,this.deco=gn.set(t.map(i=>(i.from==i.to?f_t:h_t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new r1(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const BE=Fn.define({map(e,t){return e&&e.map(t)}}),p_t=Fn.define(),uk=ro.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(BE))return n.value;if(n.is(p_t)&&e)return new r1(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Ft.decorations.from(e,t=>t?t.deco:gn.none)});function SQ(e,t){return it.create(e.filter(n=>n.field==t).map(n=>it.range(n.from,n.to)))}function m_t(e){let t=OQ.parse(e);return(n,i,r,s)=>{let{text:a,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Gi.of(a)},scrollIntoView:!0,annotations:i?[bQ.of(i),Js.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=SQ(l,0)),l.some(d=>d.field>0)){let d=new r1(l,0),f=u.effects=[BE.of(d)];n.state.field(uk,!1)===void 0&&f.push(Fn.appendConfig.of([uk,x_t,w_t,TAe]))}n.dispatch(n.state.update(u))}}function AAe(e){return({state:t,dispatch:n})=>{let i=t.field(uk,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(a=>a.field==r+e);return n(t.update({selection:SQ(i.ranges,r),effects:BE.of(s?null:new r1(i.ranges,r)),scrollIntoView:!0})),!0}}const g_t=({state:e,dispatch:t})=>e.field(uk,!1)?(t(e.update({effects:BE.of(null)})),!0):!1,b_t=AAe(1),y_t=AAe(-1),v_t=[{key:"Tab",run:b_t,shift:y_t},{key:"Escape",run:g_t}],QJ=Zt.define({combine(e){return e.length?e[0]:v_t}}),x_t=zh.highest(n1.compute([QJ],e=>e.facet(QJ)));function ys(e,t){return{...t,apply:m_t(e)}}const w_t=Ft.domEventHandlers({mousedown(e,t){let n=t.state.field(uk,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:SQ(n.ranges,r.field),effects:BE.of(n.ranges.some(s=>s.field>r.field)?new r1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),dk={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zg=Fn.define({map(e,t){let n=t.mapPos(e,-1,eo.TrackAfter);return n??void 0}}),kQ=new class extends Em{};kQ.startSide=1;kQ.endSide=-1;const _Ae=ro.define({create(){return xi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(zg)&&(e=e.update({add:[kQ.range(n.value,n.value+1)]}));return e}});function O_t(){return[k_t,_Ae]}const _5="()[]{}<>«»»«[]{}";function NAe(e){for(let t=0;t<_5.length;t+=2)if(_5.charCodeAt(t)==e)return _5.charAt(t+1);return VU(e<128?e:e+1)}function jAe(e,t){return e.languageDataAt("closeBrackets",t)[0]||dk}const S_t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),k_t=Ft.inputHandler.of((e,t,n,i)=>{if((S_t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&vd(ol(i,0))==1||t!=r.from||n!=r.to)return!1;let s=T_t(e.state,i);return s?(e.dispatch(s),!0):!1}),E_t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=jAe(e,e.selection.main.head).brackets||dk.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=A_t(e.doc,a.head);for(let c of i)if(c==l&&NI(e.doc,a.head)==NAe(ol(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:it.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},C_t=[{key:"Backspace",run:E_t}];function T_t(e,t){let n=jAe(e,e.selection.main.head),i=n.brackets||dk.brackets;for(let r of i){let s=NAe(ol(r,0));if(t==r)return s==r?j_t(e,r,i.indexOf(r+r+r)>-1,n):__t(e,r,s,n.before||dk.before);if(t==s&&RAe(e,e.selection.main.from))return N_t(e,r,s)}return null}function RAe(e,t){let n=!1;return e.field(_Ae).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function NI(e,t){let n=e.sliceString(t,t+2);return n.slice(0,vd(ol(n,0)))}function A_t(e,t){let n=e.sliceString(t-2,t);return vd(ol(n,0))==n.length?n:n.slice(1)}function __t(e,t,n,i){let r=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:zg.of(a.to+t.length),range:it.range(a.anchor+t.length,a.head+t.length)};let l=NI(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:zg.of(a.head+t.length),range:it.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function N_t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&NI(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:it.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function j_t(e,t,n,i){let r=i.stringPrefixes||dk.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:zg.of(l.to+t.length),range:it.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=NI(e.doc,c),d;if(u==t){if(zJ(e,c))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)};if(RAe(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:it.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=VJ(e,c-2*t.length,r))>-1&&zJ(e,d))return{changes:{insert:t+t+t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=ns.Word&&VJ(e,c,r)>-1&&!R_t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function zJ(e,t){let n=Or(e).resolveInner(t+1);return n.parent&&n.from==t}function R_t(e,t,n,i){let r=Or(e).resolveInner(t,-1),s=i.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function VJ(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=ns.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=ns.Word)return s}return-1}function I_t(e={}){return[u_t,ll,Ma.of(e),l_t,P_t,TAe]}const IAe=[{key:"Ctrl-Space",run:A5},{mac:"Alt-`",run:A5},{mac:"Alt-i",run:A5},{key:"Escape",run:r_t},{key:"ArrowDown",run:c2(!0)},{key:"ArrowUp",run:c2(!1)},{key:"PageDown",run:c2(!0,"page")},{key:"PageUp",run:c2(!1,"page")},{key:"Enter",run:i_t}],P_t=zh.highest(n1.computeN([Ma],e=>e.facet(Ma).defaultKeymap?[IAe]:[])),PAe=[ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ys(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,l=this.lineAfter(a);n+=l,i=a+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&a>=0&&this.chunk[a]==t&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,a=new bAe(n,t?t.state.tabSize:4,t?Pb(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=vAe(s.token,a,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const pQ=Object.create(null),lk=[ea.none],J2t=new t1(lk),CJ=[],TJ=Object.create(null),xAe=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"]])xAe[e]=OAe(pQ,t);class wAe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),xAe)}resolve(t){return t?this.table[t]||(this.table[t]=OAe(this.extra,t)):0}}const eAt=new wAe(pQ);function S5(e,t){CJ.indexOf(e)>-1||(CJ.push(e),console.warn(t))}function OAe(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||ne[u];d?typeof d=="function"?c.length?c=c.map(d):S5(u,`Modifier ${u} used at start of tag`):c.length?S5(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:S5(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=TJ[r];if(s)return s.id;let a=TJ[r]=ea.define({id:lk.length,name:i,props:[Vh({[i]:n})]});return lk.push(a),a.id}function tAt(e,t){let n=ea.define({id:lk.length,name:"Document",props:[zp.add(()=>e),Hh.add(()=>i=>t.getIndent(i))],top:!0});return lk.push(n),n}Cr.RTL,Cr.LTR;var AJ={};class VN{constructor(t,n,i,r,s,a,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new VN(t,[],n,i,i,0,[],0,r?new _J(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(n==i)return;if(this.buffer[a-2]>=n){this.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=t,this.buffer[a+1]=n,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>i||n<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=a.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new VN(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new nAt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,a;sc&1&&l==a)||r.push(n[s],a)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let c=a&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(a,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class _J{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class nAt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class HN{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new HN(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new HN(this.stack,this.pos,this.index)}}function qw(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class DA{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const NJ=new DA;class iAt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=NJ,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-i.to,i=a}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=NJ,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class mv{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;SAe(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}mv.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class qN{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?qw(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(SAe(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,a==null)break;t.reset(a,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}qN.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class zs{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function SAe(e,t,n,i,r,s){let a=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||rAt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[a+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){a=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{a=e[g+2],t.advance();continue e}}break}}function jJ(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function rAt(e,t,n,i){let r=jJ(n,i,t);return r<0||jJ(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 sAt=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?RJ(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?RJ(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=a,null;if(s instanceof hi){if(a==t){if(a=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}};class aAt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new DA)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,a=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new DA,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new DA,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let a=0;a=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new sAt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[a]=t;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let a=r&&cAt(r);if(a)return Dl&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Dl&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(a)return Dl&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((l,c)=>c.score-l.score);i.length>a;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let a=0;a500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,l)=>l.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Ln.contextHash)||0)==d))return t.useNode(f,h),Dl&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof hi)||f.children.length==0||f.positions[0]>0)break;let 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),Dl&&console.log(a+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return IJ(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let a=0;a ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Dl&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(Dl&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)Dl&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))Dl&&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),Dl&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),IJ(l,i)):(!r||r.scoree;class _I{constructor(t){this.start=t.start,this.shift=t.shift||E5,this.reduce=t.reduce||E5,this.reuse=t.reuse||E5,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Rh extends yI{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new t1(n.map((l,c)=>ea.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=wTe;let a=qw(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new mv(a,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new oAt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let a=r[s++],l=a&1,c=r[s++];if(l&&i)return c;for(let u=s+(a>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Lf(this.data,s+2);else break;r=n(Lf(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Lf(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,a)=>a&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(Rh.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let a=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=PJ(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let a=n.indexOf(s);a>=0&&(i[a]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const uAt=316,dAt=317,DJ=1,fAt=2,hAt=3,pAt=4,mAt=318,gAt=320,bAt=321,yAt=5,vAt=6,xAt=0,Y$=[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],kAe=125,wAt=59,Z$=47,OAt=42,SAt=43,kAt=45,EAt=60,CAt=44,TAt=63,AAt=46,_At=91,NAt=new _I({start:!1,shift(e,t){return t==yAt||t==vAt||t==gAt?e:t==bAt},strict:!1}),jAt=new zs((e,t)=>{let{next:n}=e;(n==kAe||n==-1||t.context)&&e.acceptToken(mAt)},{contextual:!0,fallback:!0}),RAt=new zs((e,t)=>{let{next:n}=e,i;Y$.indexOf(n)>-1||n==Z$&&((i=e.peek(1))==Z$||i==OAt)||n!=kAe&&n!=wAt&&n!=-1&&!t.context&&e.acceptToken(uAt)},{contextual:!0}),IAt=new zs((e,t)=>{e.next==_At&&!t.context&&e.acceptToken(dAt)},{contextual:!0}),PAt=new zs((e,t)=>{let{next:n}=e;if(n==SAt||n==kAt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(DJ);e.acceptToken(i?DJ:fAt)}}else n==TAt&&e.peek(1)==AAt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(hAt))},{contextual:!0});function C5(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const DAt=new zs((e,t)=>{if(e.next!=EAt||!t.dialectEnabled(xAt)||(e.advance(),e.next==Z$))return;let n=0;for(;Y$.indexOf(e.next)>-1;)e.advance(),n++;if(C5(e.next,!0)){for(e.advance(),n++;C5(e.next,!1);)e.advance(),n++;for(;Y$.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==CAt)return;for(let i=0;;i++){if(i==7){if(!C5(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(pAt,-n)}),MAt=Vh({"get set async static":ne.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ne.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ne.operatorKeyword,"let var const using function class extends":ne.definitionKeyword,"import export from":ne.moduleKeyword,"with debugger new":ne.keyword,TemplateString:ne.special(ne.string),super:ne.atom,BooleanLiteral:ne.bool,this:ne.self,null:ne.null,Star:ne.modifier,VariableName:ne.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ne.function(ne.variableName),VariableDefinition:ne.definition(ne.variableName),Label:ne.labelName,PropertyName:ne.propertyName,PrivatePropertyName:ne.special(ne.propertyName),"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),"FunctionDeclaration/VariableDefinition":ne.function(ne.definition(ne.variableName)),"ClassDeclaration/VariableDefinition":ne.definition(ne.className),"NewExpression/VariableName":ne.className,PropertyDefinition:ne.definition(ne.propertyName),PrivatePropertyDefinition:ne.definition(ne.special(ne.propertyName)),UpdateOp:ne.updateOperator,"LineComment Hashbang":ne.lineComment,BlockComment:ne.blockComment,Number:ne.number,String:ne.string,Escape:ne.escape,ArithOp:ne.arithmeticOperator,LogicOp:ne.logicOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,RegExp:ne.regexp,Equals:ne.definitionOperator,Arrow:ne.function(ne.punctuation),": Spread":ne.punctuation,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,"InterpolationStart InterpolationEnd":ne.special(ne.brace),".":ne.derefOperator,", ;":ne.separator,"@":ne.meta,TypeName:ne.typeName,TypeDefinition:ne.definition(ne.typeName),"type enum interface implements namespace module declare":ne.definitionKeyword,"abstract global Privacy readonly override":ne.modifier,"is keyof unique infer asserts":ne.operatorKeyword,JSXAttributeValue:ne.attributeValue,JSXText:ne.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ne.angleBracket,"JSXIdentifier JSXNameSpacedName":ne.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ne.attributeName,"JSXBuiltin/JSXIdentifier":ne.standard(ne.tagName)}),LAt={__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},$At={__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},FAt={__proto__:null,"<":193},BAt=Rh.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:NAt,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:[MAt],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:[RAt,IAt,PAt,DAt,2,3,4,5,6,7,8,9,10,11,12,13,14,jAt,new qN("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new qN("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>LAt[e]||-1},{term:343,get:e=>$At[e]||-1},{term:95,get:e=>FAt[e]||-1}],tokenPrec:15201});class mQ{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Or(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(CAe(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 MJ(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 UAt(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+$/]:UAt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function EAe(e,t){return n=>{for(let i=Or(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class LJ{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function lb(e){return e.selection.main.from}function CAe(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 bQ=Jd.define();function QAt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,a=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:c},range:it.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const $J=new WeakMap;function zAt(e){if(!Array.isArray(e))return e;let t=$J.get(e);return t||$J.set(e,t=gQ(e)),t}const WN=Fn.define(),ck=Fn.define();class VAt{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=VU(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!x||E==1&&v||w==0&&E!=0)&&(n[f]==k||i[f]==k&&(h=!0)?a[f++]=x:a.length&&(y=!1)),w=E,x+=vd(k)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),a,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let a of n){let l=a+(this.astral?vd(ol(i,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(t-i.length,r)}}class HAt{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:qAt,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=>FJ(t(i),n(i)),optionClass:(t,n)=>i=>FJ(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function FJ(e,t){return e?t?e+" "+t:e:t}function qAt(e,t,n,i,r,s){let a=e.textDirection==Cr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||x>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}const yQ=Fn.define();function WAt(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&a.appendChild(document.createTextNode(l.slice(c,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function T5(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 GAt{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:a}=r.open,l=t.state.facet(Ma);this.optionContent=WAt(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=T5(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:yQ.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Ma).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:ck.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:a,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=T5(s.length,a,t.state.facet(Ma).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=T5(n.options.length,n.selected,this.view.state.facet(Ma).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>hl(this.view.state,l,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&XAt(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{a.target==r&&a.preventDefault()});let s=null;for(let a=i.from;ai.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew GAt(n,e,t)}function XAt(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 BJ(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function YAt(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(Ma);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new LJ(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=a.filterStrict?new HAt(h):new VAt(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 LJ(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:x}=b.section;r||(r=Object.create(null)),r[x]=Math.max(y,r[x]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(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):BJ(d.completion)>BJ(c)&&(l[l.length-1]=d),c=d.completion}return l}class $y{constructor(t,n,i,r,s,a){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new $y(this.options,UJ(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,a){if(r&&!a&&t.some(u=>u.isPending))return r.setDisabled();let l=YAt(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Ma).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:i_t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new $y(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $y(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class GN{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new GN(t_t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Ma),s=(i.override||n.languageDataAt("autocomplete",lb(n)).map(zAt)).map(c=>(this.active.find(d=>d.source==c)||new Kc(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let a=this.open,l=t.effects.some(c=>c.is(vQ));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!ZAt(s,this.active)||l?a=$y.build(s,n,this.id,a,i,l):a&&a.disabled&&!s.some(c=>c.isPending)&&(a=null),!a&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Kc(c.source,0):c));for(let c of t.effects)c.is(yQ)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new GN(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?JAt:e_t}}function ZAt(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const t_t=[];function TAe(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(bQ);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Kc{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=TAe(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Kc(r.source,0)),i&4&&r.state==0&&(r=new Kc(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(WN))r=new Kc(r.source,1,s.value);else if(s.is(ck))r=new Kc(r.source,0);else if(s.is(vQ))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(lb(t.state))}}class gv extends Kc{constructor(t,n,i,r,s,a){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),l=lb(t.state);if(l>a||!r||n&2&&(lb(t.startState)==this.from||ln.map(t))}}),ll=ro.define({create(){return GN.start()},update(e,t){return e.update(t)},provide:e=>[oQ.from(e,t=>t.tooltip),Ft.contentAttributes.from(e,t=>t.attrs)]});function xQ(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(ll).active.find(r=>r.source==t.source);return i instanceof gv?(typeof n=="string"?e.dispatch({...QAt(e.state,n,i.from,i.to),annotations:bQ.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const i_t=KAt(ll,xQ);function c2(e,t="option"){return n=>{let i=n.state.field(ll,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:a-1;return l<0?l=t=="page"?0:a-1:l>=a&&(l=t=="page"?a-1:0),n.dispatch({effects:yQ.of(l)}),!0}}const r_t=e=>{let t=e.state.field(ll,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(ll,!1)?(e.dispatch({effects:WN.of(!0)}),!0):!1,s_t=e=>{let t=e.state.field(ll,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:ck.of(null)}),!0)};class a_t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const o_t=50,l_t=1e3,c_t=Ts.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ll).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ll),n=e.state.facet(Ma);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ll)==t)return;let i=e.transactions.some(s=>{let a=TAe(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;so_t&&Date.now()-a.time>l_t){for(let l of a.context.abortListeners)try{l()}catch(c){hl(this.view.state,c)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(a=>a.is(WN)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ll);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=lb(t),i=new mQ(t,n,e.explicit,this.view),r=new a_t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ck.of(null)}),hl(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ma),i=this.view.state.field(ll);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Kc(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:vQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ll,!1);if(t&&t.tooltip&&this.view.state.facet(Ma).closeOnBlur){let n=t.open&&H2e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ck.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:WN.of(!1)}),20),this.composing=0}}}),u_t=typeof navigator=="object"&&/Win/.test(navigator.platform),d_t=zh.highest(Ft.domEventHandlers({keydown(e,t){let n=t.state.field(ll,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(u_t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(a=>a.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&xQ(t,i),!1}})),AAe=Ft.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 f_t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class wQ{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,eo.TrackDel),i=t.mapPos(this.to,1,eo.TrackDel);return n==null||i==null?null:new wQ(this.field,n,i)}}class OQ{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=a,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew wQ(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let a of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new f_t(u,i.length,s.index,s.index+d.length)),a=a.slice(0,s.index)+c+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(a)}return new OQ(i,r)}}let h_t=gn.widget({widget:new class extends Yu{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),p_t=gn.mark({class:"cm-snippetField"});class r1{constructor(t,n){this.ranges=t,this.active=n,this.deco=gn.set(t.map(i=>(i.from==i.to?h_t:p_t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new r1(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const BE=Fn.define({map(e,t){return e&&e.map(t)}}),m_t=Fn.define(),uk=ro.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(BE))return n.value;if(n.is(m_t)&&e)return new r1(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Ft.decorations.from(e,t=>t?t.deco:gn.none)});function SQ(e,t){return it.create(e.filter(n=>n.field==t).map(n=>it.range(n.from,n.to)))}function g_t(e){let t=OQ.parse(e);return(n,i,r,s)=>{let{text:a,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Gi.of(a)},scrollIntoView:!0,annotations:i?[bQ.of(i),Js.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=SQ(l,0)),l.some(d=>d.field>0)){let d=new r1(l,0),f=u.effects=[BE.of(d)];n.state.field(uk,!1)===void 0&&f.push(Fn.appendConfig.of([uk,w_t,O_t,AAe]))}n.dispatch(n.state.update(u))}}function _Ae(e){return({state:t,dispatch:n})=>{let i=t.field(uk,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(a=>a.field==r+e);return n(t.update({selection:SQ(i.ranges,r),effects:BE.of(s?null:new r1(i.ranges,r)),scrollIntoView:!0})),!0}}const b_t=({state:e,dispatch:t})=>e.field(uk,!1)?(t(e.update({effects:BE.of(null)})),!0):!1,y_t=_Ae(1),v_t=_Ae(-1),x_t=[{key:"Tab",run:y_t,shift:v_t},{key:"Escape",run:b_t}],QJ=Zt.define({combine(e){return e.length?e[0]:x_t}}),w_t=zh.highest(n1.compute([QJ],e=>e.facet(QJ)));function ys(e,t){return{...t,apply:g_t(e)}}const O_t=Ft.domEventHandlers({mousedown(e,t){let n=t.state.field(uk,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:SQ(n.ranges,r.field),effects:BE.of(n.ranges.some(s=>s.field>r.field)?new r1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),dk={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zg=Fn.define({map(e,t){let n=t.mapPos(e,-1,eo.TrackAfter);return n??void 0}}),kQ=new class extends Em{};kQ.startSide=1;kQ.endSide=-1;const NAe=ro.define({create(){return xi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(zg)&&(e=e.update({add:[kQ.range(n.value,n.value+1)]}));return e}});function S_t(){return[E_t,NAe]}const _5="()[]{}<>«»»«[]{}";function jAe(e){for(let t=0;t<_5.length;t+=2)if(_5.charCodeAt(t)==e)return _5.charAt(t+1);return VU(e<128?e:e+1)}function RAe(e,t){return e.languageDataAt("closeBrackets",t)[0]||dk}const k_t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),E_t=Ft.inputHandler.of((e,t,n,i)=>{if((k_t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&vd(ol(i,0))==1||t!=r.from||n!=r.to)return!1;let s=A_t(e.state,i);return s?(e.dispatch(s),!0):!1}),C_t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=RAe(e,e.selection.main.head).brackets||dk.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=__t(e.doc,a.head);for(let c of i)if(c==l&&NI(e.doc,a.head)==jAe(ol(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:it.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},T_t=[{key:"Backspace",run:C_t}];function A_t(e,t){let n=RAe(e,e.selection.main.head),i=n.brackets||dk.brackets;for(let r of i){let s=jAe(ol(r,0));if(t==r)return s==r?R_t(e,r,i.indexOf(r+r+r)>-1,n):N_t(e,r,s,n.before||dk.before);if(t==s&&IAe(e,e.selection.main.from))return j_t(e,r,s)}return null}function IAe(e,t){let n=!1;return e.field(NAe).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function NI(e,t){let n=e.sliceString(t,t+2);return n.slice(0,vd(ol(n,0)))}function __t(e,t){let n=e.sliceString(t-2,t);return vd(ol(n,0))==n.length?n:n.slice(1)}function N_t(e,t,n,i){let r=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:zg.of(a.to+t.length),range:it.range(a.anchor+t.length,a.head+t.length)};let l=NI(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:zg.of(a.head+t.length),range:it.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function j_t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&NI(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:it.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function R_t(e,t,n,i){let r=i.stringPrefixes||dk.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:zg.of(l.to+t.length),range:it.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=NI(e.doc,c),d;if(u==t){if(zJ(e,c))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)};if(IAe(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:it.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=VJ(e,c-2*t.length,r))>-1&&zJ(e,d))return{changes:{insert:t+t+t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=ns.Word&&VJ(e,c,r)>-1&&!I_t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:it.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function zJ(e,t){let n=Or(e).resolveInner(t+1);return n.parent&&n.from==t}function I_t(e,t,n,i){let r=Or(e).resolveInner(t,-1),s=i.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function VJ(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=ns.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=ns.Word)return s}return-1}function P_t(e={}){return[d_t,ll,Ma.of(e),c_t,D_t,AAe]}const PAe=[{key:"Ctrl-Space",run:A5},{mac:"Alt-`",run:A5},{mac:"Alt-i",run:A5},{key:"Escape",run:s_t},{key:"ArrowDown",run:c2(!0)},{key:"ArrowUp",run:c2(!1)},{key:"PageDown",run:c2(!0,"page")},{key:"PageUp",run:c2(!1,"page")},{key:"Enter",run:r_t}],D_t=zh.highest(n1.computeN([Ma],e=>e.facet(Ma).defaultKeymap?[PAe]:[])),DAe=[ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ys(`try { \${} } catch (\${error}) { \${} @@ -724,27 +724,27 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),ys('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ys('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],D_t=PAe.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"})]),HJ=new zU,DAe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function tw(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const M_t=["FunctionDeclaration"],L_t={FunctionDeclaration:tw("function"),ClassDeclaration:tw("class"),ClassExpression:()=>!0,EnumDeclaration:tw("constant"),TypeAliasDeclaration:tw("type"),NamespaceDeclaration:tw("namespace"),VariableDefinition(e,t){e.matchContext(M_t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function MAe(e,t){let n=HJ.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(r)r=!1;else if(a.name){let l=L_t[a.name];if(l&&l(a,s)||DAe.has(a.name))return!1}else if(a.to-a.from>8192){for(let l of MAe(e,a.node))i.push(l);return!1}}),HJ.set(t,i),i}const qJ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,LAe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function $_t(e){let t=Or(e.state).resolveInner(e.pos,-1);if(LAe.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&qJ.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)DAe.has(r.name)&&(i=i.concat(MAe(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:qJ}}const $d=jh.define({name:"javascript",parser:FAt.configure({props:[Hh.add({IfStatement:pv({except:/^\s*({|else\b)/}),TryStatement:pv({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:x2t,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:i?1:2)*e.unit},Block:hv({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":pv({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),qh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":LE,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,i=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?e.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),$Ae={test:e=>/^JSX/.test(e.name),facet:CI({commentTokens:{block:{open:"{/*",close:"*/}"}}})},FAe=$d.configure({dialect:"ts"},"typescript"),BAe=$d.configure({dialect:"jsx",props:[cQ.add(e=>e.isTop?[$Ae]:void 0)]}),UAe=$d.configure({dialect:"jsx ts",props:[cQ.add(e=>e.isTop?[$Ae]:void 0)]},"typescript");let QAe=e=>({label:e,type:"keyword"});const zAe="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(QAe),F_t=zAe.concat(["declare","implements","private","protected","public"].map(QAe));function J$(e={}){let t=e.jsx?e.typescript?UAe:BAe:e.typescript?FAe:$d,n=e.typescript?D_t.concat(F_t):PAe.concat(zAe);return new Nm(t,[$d.data.of({autocomplete:kAe(LAe,gQ(n))}),$d.data.of({autocomplete:$_t}),e.jsx?Q_t:[]])}function B_t(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function WJ(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 U_t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Q_t=Ft.inputHandler.of((e,t,n,i,r)=>{if((U_t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!$d.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u;let{head:d}=c,f=Or(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=i||f.name=="JSXAttributeValue"&&f.to>d)){if(i==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let m=f.parent,g=m.parent;if(g&&m.from==d-2&&((h=WJ(a.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:it.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=B_t(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=WJ(a.doc,m,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),z_t=Vh({String:ne.string,Number:ne.number,"True False":ne.bool,PropertyName:ne.propertyName,Null:ne.null,", :":ne.separator,"[ ]":ne.squareBracket,"{ }":ne.brace}),V_t=Rh.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[z_t],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),H_t=jh.define({name:"json",parser:V_t.configure({props:[Hh.add({Object:pv({except:/^\s*\}/}),Array:pv({except:/^\s*\]/})}),qh.add({"Object Array":LE})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function q_t(){return new Nm(H_t)}class KN{static create(t,n,i,r,s){let a=r+(r<<8)+t+(n<<4)|0;return new KN(t,n,i,a,s,[],[])}constructor(t,n,i,r,s,a,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=a,this.positions=l,this.hashProp=[[Ln.contextHash,r]]}addChild(t,n){t.prop(Ln.contextHash)!=this.hash&&(t=new hi(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new hi(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,a)=>new hi(ea.none,r,s,a,this.hashProp)})}}var Nt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(Nt||(Nt={}));class W_t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class G_t{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return VO(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,i=0){for(let r=n;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==Nt.OrderedList?TQ:CQ)(n,t,!1);return i>0&&(e.type!=Nt.BulletList||EQ(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const VAe={[Nt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(Fi(Nt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(ou(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[Nt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Nt.OrderedList]:GJ,[Nt.BulletList]:GJ,[Nt.Document](){return!0}};function ou(e){return e==32||e==9||e==10||e==13}function VO(e,t=0){for(;tn&&ou(e.charCodeAt(t-1));)t--;return t}function HAe(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(JAe.SetextHeading)>-1||i<3?-1:1}function WAe(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function CQ(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||ou(e.text.charCodeAt(e.pos+1)))&&(!n||WAe(t,Nt.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){i++;if(i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||r!=46&&r!=41||ie.pos+1||e.next!=49)?-1:i+1-e.pos}function GAe(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function KAe(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,YAe=/\?>/,t8=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,ZAe=/\?>/,t8=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(Fi(Nt.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(Fi(Nt.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(Fi(Nt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),a=hk.test(r),l=hk.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||a),f=!c&&(!a||u||l),h=d&&(t==42||!f||a),m=f&&(t==42||!d||l);return e.append(new ql(t==95?r_e:s_e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Fi(Nt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(Fi(Nt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new ql(_g,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new ql(XN,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof ql&&(r.type==_g||r.type==XN)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),a=e.parts[i]=eNt(e,s,r.type==_g?Nt.Link:Nt.Image,r.from,n+1);if(r.type==_g)for(let l=0;lt?Fi(Nt.URL,t+n,s+n):s==e.length?null:!1}}function o_e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,a=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new ql(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ql&&(n.type==_g||n.type==XN))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof ql&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+a)%3==0&&((b.to-b.from)%3||a%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,a);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof ql&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof ql?n:null}skipSpace(t){return VO(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new i_e(t,n)}}AQ.linkStart=_g;AQ.imageStart=XN;function i8(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Ln.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,a=s,l=t.block.children.length,c=a,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=c_e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new hi(t.parser.nodeSet.types[Nt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(tNt.indexOf(n.type.id)<0?(a=n.to-i,l=t.block.children.length):(a=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return a-s}}function c_e(e,t){let n=e;for(let i=1;iu2[e]),Object.keys(u2).map(e=>JAe[e]),Object.keys(u2),Y_t,VAe,Object.keys(j5).map(e=>j5[e]),Object.keys(j5),[]);function sNt(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let a=r?r.from:n;if(a>s&&i.push({from:s,to:a}),!r)break;s=r.to}return i}function aNt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:kTe((r,s)=>{let a=r.type.id;if(t&&(a==Nt.CodeBlock||a==Nt.FencedCode)){let l="";if(a==Nt.FencedCode){let u=r.node.getChild(Nt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Nt.CodeText,bracketed:a==Nt.FencedCode}}else if(n&&(a==Nt.HTMLBlock||a==Nt.HTMLTag||a==Nt.CommentBlock))return{parser:n,overlay:sNt(r.node,r.from,r.to)};return null})}}const oNt={resolve:"Strikethrough",mark:"StrikethroughMark"},lNt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":ne.strikethrough}},{name:"StrikethroughMark",style:ne.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),a=/\s|^$/.test(r),l=hk.test(i),c=hk.test(r);return e.addDelimiter(oNt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function HO(e,t,n=0,i,r=0){let s=0,a=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,a=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function ZJ(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class JJ{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)&&u_e.test(r=n.text.slice(n.pos))){let s=[];HO(t,i.content,0,s,i.start)==HO(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];HO(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const cNt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":ne.heading}},"TableRow",{name:"TableCell",style:ne.content},{name:"TableDelimiter",style:ne.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return ZJ(t.content,0)?new JJ:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof JJ)||!ZJ(t.text,t.basePos))return!1;let i=e.peekLine();return u_e.test(i)&&HO(e,t.text,t.basePos)==HO(e,i,t.basePos)},before:"SetextHeading"}]};class uNt{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 dNt={defineNodes:[{name:"Task",block:!0,style:ne.list},{name:"TaskMarker",style:ne.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new uNt:null},after:"SetextHeading"}]},eee=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,tee=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,fNt=/[\w-]+\.[\w-]+($|[/:])/,nee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,iee=/\/[a-zA-Z\d@.]+/gy;function ree(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==")"&&ree(e,t,i,")")>ree(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 see(e,t){nee.lastIndex=t;let n=nee.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 pNt={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;eee.lastIndex=i;let r=eee.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=hNt(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+a[0].length}}else r[3]?s=see(e.text,i):(s=see(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(iee.lastIndex=s,r=iee.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)}}]},mNt=[cNt,dNt,lNt,pNt];function d_e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let a=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let cee=null,uee=null,dee=0;function s8(e,t){let n=e.pos+t;if(dee==n&&uee==e)return cee;let i=e.peek(t),r="";for(;QNt(i);)r+=String.fromCharCode(i),i=e.peek(++t);return uee=e,dee=n,cee=r?r.toLowerCase():i==zNt||i==VNt?void 0:null}const v_e=60,YN=62,NQ=47,zNt=63,VNt=33,HNt=45;function fee(e,t){this.name=e,this.parent=t}const qNt=[_Q,m_e,f_e,h_e,p_e],WNt=new _I({start:null,shift(e,t,n,i){return qNt.indexOf(t)>-1?new fee(s8(i,1)||"",e):e},reduce(e,t){return t==g_e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==_Q||r==MNt?new fee(s8(i,1)||"",e):e},strict:!1}),GNt=new zs((e,t)=>{if(e.next!=v_e){e.next<0&&t.context&&e.acceptToken(R5);return}e.advance();let n=e.next==NQ;n&&e.advance();let i=s8(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?NNt:_Nt);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(CNt);if(r&&UNt[r])return e.acceptToken(R5,-2);if(t.dialectEnabled($Nt))return e.acceptToken(TNt);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(ANt)}else{if(i=="script")return e.acceptToken(f_e);if(i=="style")return e.acceptToken(h_e);if(i=="textarea")return e.acceptToken(p_e);if(BNt.hasOwnProperty(i))return e.acceptToken(m_e);r&&lee[r]&&lee[r][i]?e.acceptToken(R5,-1):e.acceptToken(_Q)}},{contextual:!0}),KNt=new zs(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(oee);break}if(e.next==HNt)t++;else if(e.next==YN&&t>=2){n>=3&&e.acceptToken(oee,-2);break}else t=0;e.advance()}});function XNt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const YNt=new zs((e,t)=>{if(e.next==NQ&&e.peek(1)==YN){let n=t.dialectEnabled(FNt)||XNt(t.context);e.acceptToken(n?ENt:aee,2)}else e.next==YN&&e.acceptToken(aee,1)});function jQ(e,t,n){let i=2+e.length;return new zs(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==v_e||s==1&&r.next==NQ||s>=2&&sa?r.acceptToken(t,-a):r.acceptToken(n,-(a-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=a=0;r.advance()}})}const ZNt=jQ("script",vNt,xNt),JNt=jQ("style",wNt,ONt),ejt=jQ("textarea",SNt,kNt),tjt=Vh({"Text RawText IncompleteTag IncompleteCloseTag":ne.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ne.angleBracket,TagName:ne.tagName,"MismatchedCloseTag/TagName":[ne.tagName,ne.invalid],AttributeName:ne.attributeName,"AttributeValue UnquotedAttributeValue":ne.attributeValue,Is:ne.definitionOperator,"EntityReference CharacterReference":ne.character,Comment:ne.blockComment,ProcessingInst:ne.processingInstruction,DoctypeDecl:ne.documentMeta}),njt=Rh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:WNt,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:[tjt],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==INt)return I5(l,c,n);if(u==PNt)return I5(l,c,i);if(u==DNt)return I5(l,c,r);if(u==g_e&&s.length){let d=l.node,f=d.firstChild,h=f&&hee(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=x_e(f,c))))){let b=d.lastChild,v=b.type.id==LNt?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==b_e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=hee(d.parent,c))continue;let g=d.lastChild;if(g.type.id==r8){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==y_e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const ijt=145,pee=1,rjt=146,sjt=147,O_e=2,ajt=148,ojt=3,ljt=4,S_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],cjt=58,ujt=40,k_e=95,djt=91,MA=45,fjt=46,hjt=35,pjt=37,mjt=38,gjt=92,bjt=10,yjt=42;function pk(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function RQ(e){return e>=48&&e<=57}function mee(e){return RQ(e)||e>=97&&e<=102||e>=65&&e<=70}const E_e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(pk(c)||c==MA||c==k_e||s&&RQ(c))!s&&(c!=MA||l>0)&&(s=!0),a===l&&c==MA&&a++,i.advance();else if(c==gjt&&i.peek(1)!=bjt){if(i.advance(),mee(i.next)){do i.advance();while(mee(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(O_e)?t:c==ujt?n:e);break}}},vjt=new zs(E_e(rjt,O_e,sjt),{contextual:!0}),xjt=new zs(E_e(ajt,ojt,ljt),{contextual:!0}),wjt=new zs(e=>{if(S_e.includes(e.peek(-1))){let{next:t}=e;(pk(t)||t==k_e||t==hjt||t==fjt||t==yjt||t==djt||t==cjt&&pk(e.peek(1))||t==MA||t==mjt)&&e.acceptToken(ijt)}}),Ojt=new zs(e=>{if(!S_e.includes(e.peek(-1))){let{next:t}=e;if(t==pjt&&(e.advance(),e.acceptToken(pee)),pk(t)){do e.advance();while(pk(e.next)||RQ(e.next));e.acceptToken(pee)}}}),Sjt=Vh({"AtKeyword import charset namespace keyframes media supports font-feature-values":ne.definitionKeyword,"from to selector scope MatchFlag":ne.keyword,NamespaceName:ne.namespace,KeyframeName:ne.labelName,KeyframeRangeName:ne.operatorKeyword,TagName:ne.tagName,ClassName:ne.className,PseudoClassName:ne.constant(ne.className),IdName:ne.labelName,"FeatureName PropertyName":ne.propertyName,AttributeName:ne.attributeName,NumberLiteral:ne.number,KeywordQuery:ne.keyword,UnaryQueryOp:ne.operatorKeyword,"CallTag ValueName FontName":ne.atom,VariableName:ne.variableName,Callee:ne.operatorKeyword,Unit:ne.unit,"UniversalSelector NestingSelector":ne.definitionOperator,"MatchOp CompareOp":ne.compareOperator,"ChildOp SiblingOp, LogicOp":ne.logicOperator,BinOp:ne.arithmeticOperator,Important:ne.modifier,Comment:ne.blockComment,ColorLiteral:ne.color,"ParenthesizedContent StringLiteral":ne.string,":":ne.punctuation,"PseudoOp #":ne.derefOperator,"; , |":ne.separator,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace}),kjt={__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},Ejt={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Cjt={__proto__:null,selector:118,style:124,layer:202},Tjt={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Ajt={__proto__:null,to:243},_jt=Rh.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[wjt,Ojt,vjt,xjt,1,2,3,4,new qN("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>kjt[e]||-1},{term:148,get:e=>Ejt[e]||-1},{term:4,get:e=>Cjt[e]||-1},{term:28,get:e=>Tjt[e]||-1},{term:146,get:e=>Ajt[e]||-1}],tokenPrec:2405});let P5=null;function D5(){if(!P5&&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)));P5=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return P5||[]}const gee=["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})),bee=["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}))),Njt=["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})),jjt=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),xf=/^(\w[\w-]*|-\w[\w-]*|)$/,Rjt=/^-(-[\w-]*)?$/;function Ijt(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 yee=new zU,Pjt=["Declaration"];function Djt(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function C_e(e,t,n){if(t.to-t.from>4096){let i=yee.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(er.IncludeAnonymous);if(a.firstChild())do for(let l of C_e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return yee.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(Pjt)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const Mjt=e=>t=>{let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:D5(),validFor:xf};if(r.name=="ValueName")return{from:r.from,options:bee,validFor:xf};if(r.name=="PseudoClassName")return{from:r.from,options:gee,validFor:xf};if(e(r)||(t.explicit||s)&&Ijt(r,n.doc))return{from:e(r)||s?r.from:i,options:C_e(n.doc,Djt(r),e),validFor:Rjt};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:D5(),validFor:xf};return{from:r.from,options:Njt,validFor:xf}}if(r.name=="AtKeyword")return{from:r.from,options:jjt,validFor:xf};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:gee,validFor:xf}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:bee,validFor:xf}:a.name=="Block"||a.name=="Styles"?{from:i,options:D5(),validFor:xf}:null},Ljt=Mjt(e=>e.name=="VariableName"),ZN=jh.define({name:"css",parser:_jt.configure({props:[Hh.add({Declaration:pv()}),qh.add({"Block KeyframeList":LE})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function $jt(){return new Nm(ZN,ZN.data.of({autocomplete:Ljt}))}const iw=["_blank","_self","_top","_parent"],M5=["ascii","utf-8","utf-16","latin1","latin1"],L5=["get","post","put","delete"],$5=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ml=["true","false"],mn={},Fjt={a:{attrs:{href:null,ping:null,type:null,media:null,target:iw,hreflang:null}},abbr:mn,address:mn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:mn,aside:mn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:mn,base:{attrs:{href:null,target:iw}},bdi:mn,bdo:mn,blockquote:{attrs:{cite:null}},body:mn,br:mn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:$5,formmethod:L5,formnovalidate:["novalidate"],formtarget:iw,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:mn,center:mn,cite:mn,code:mn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:mn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:mn,div:mn,dl:mn,dt:mn,em:mn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:mn,figure:mn,footer:mn,form:{attrs:{action:null,name:null,"accept-charset":M5,autocomplete:["on","off"],enctype:$5,method:L5,novalidate:["novalidate"],target:iw}},h1:mn,h2:mn,h3:mn,h4:mn,h5:mn,h6:mn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:mn,hgroup:mn,hr:mn,html:{attrs:{manifest:null}},i:mn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:$5,formmethod:L5,formnovalidate:["novalidate"],formtarget:iw,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:mn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:mn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:mn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:M5,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:mn,noscript:mn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:mn,param:{attrs:{name:null,value:null}},pre:mn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:mn,rt:mn,ruby:mn,samp:mn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:M5}},section:mn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:mn,source:{attrs:{src:null,type:null,media:null}},span:mn,strong:mn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:mn,summary:mn,sup:mn,table:mn,tbody:mn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:mn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:mn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:mn,time:{attrs:{datetime:null}},title:mn,tr:mn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:mn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:mn},T_e={accesskey:null,class:null,contenteditable:Ml,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ml,autocorrect:Ml,autocapitalize:Ml,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ml,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ml,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ml,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ml,"aria-hidden":Ml,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ml,"aria-multiselectable":Ml,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ml,"aria-relevant":null,"aria-required":Ml,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},A_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 A_e)T_e[e]=null;class mk{constructor(t,n){this.tags={...Fjt,...t},this.globalAttrs={...T_e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}mk.default=new mk;function ux(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function dx(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function __e(e,t,n){let i=n.tags[ux(e,dx(t))];return(i==null?void 0:i.children)||n.allTags}function IQ(e,t){let n=[];for(let i=dx(t);i&&!i.type.isTop;i=dx(i.parent)){let r=ux(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const N_e=/^[:\-\.\w\u00b7-\uffff]*$/;function vee(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=dx(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:__e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(IQ(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function xee(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:IQ(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:N_e}}function Bjt(e,t,n,i){let r=[],s=0;for(let a of __e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of IQ(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ujt(e,t,n,i,r){let s=dx(n),a=s?t.tags[ux(e.doc,s)]:null,l=a&&a.attrs?Object.keys(a.attrs):[],c=a&&a.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:N_e}}function Qjt(e,t,n,i,r){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(a){let u=e.sliceDoc(a.from,a.to),d=t.globalAttrs[u];if(!d){let f=dx(n),h=f?t.tags[ux(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',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 j_e(e,t){let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.resolve(i);for(let a=i,l;s==r&&(l=r.childBefore(a));){let c=l.lastChild;if(!c||!c.type.isError||c.fromj_e(i,r)}const Hjt=$d.parser.configure({top:"SingleExpression"}),R_e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:FAe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:BAe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:UAe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Hjt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:$d.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:ZN.parser}],I_e=[{name:"style",parser:ZN.parser.configure({top:"Styles"})}].concat(A_e.map(e=>({name:e,parser:$d.parser}))),P_e=jh.define({name:"html",parser:njt.configure({props:[Hh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),LA=P_e.configure({wrap:w_e(R_e,I_e)});function qjt(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=w_e((e.nestedLanguages||[]).concat(R_e),(e.nestedAttributes||[]).concat(I_e)));let i=n?P_e.configure({wrap:n,dialect:t}):t?LA.configure({dialect:t}):LA;return new Nm(i,[LA.data.of({autocomplete:Vjt(e)}),e.autoCloseTags!==!1?Wjt:[],J$().support,$jt().support])}const wee=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Wjt=Ft.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!LA.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u,d,f;let h=a.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Or(a).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=ux(a.doc,v.parent,m))&&!wee.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),x=``;return{range:c,changes:{from:m,to:y,insert:x}}}}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=ux(a.doc,v,m))&&!wee.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),x=`${b}>`;return{range:it.cursor(m+x.length,-1),changes:{from:m,to:y,insert:x}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),D_e=CI({commentTokens:{block:{open:""}}}),M_e=new Ln,L_e=rNt.configure({props:[qh.add(e=>!e.is("Block")||e.is("Document")||a8(e)!=null||Gjt(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),M_e.add(a8),Hh.add({Document:()=>null}),zp.add({Document:D_e})]});function a8(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Gjt(e){return e.name=="OrderedList"||e.name=="BulletList"}function Kjt(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=a8(i.type))!=null&&r<=t)break;n=i}return n.to}const Xjt=nAe.of((e,t,n)=>{for(let i=Or(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function PQ(e){return new ec(D_e,e,[],"markdown")}const Yjt=PQ(L_e),Zjt=L_e.configure([mNt,bNt,gNt,yNt,{props:[qh.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),JN=PQ(Zjt);function Jjt(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=UN.matchLanguageName(e,n,!0),i instanceof UN)return i.support?i.support.language.parser:Ib.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let F5=class{constructor(t,n,i,r,s,a,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=a,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+F_e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function $_e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],a,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new F5(s,c,c+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=a[3],d=a[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new F5(s.parent,c,c+d,a[1],u,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=a[4],d=a[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),i.push(new F5(s.parent,c,c+d,a[1],u,f,s))}}return i}function F_e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function B5(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=F_e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let a=s.nextSibling;if(!a)break;s=a}}function DQ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i1)!=" ")return e;let i=Uu(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const eRt=(e={})=>({state:t,dispatch:n})=>{let i=Or(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!JN.isActiveAt(t,l.from,-1)&&!JN.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=$_e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,x=f.node.getChild("ListItem","ListItem");if(y.to>=c||x&&x.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,w,k="";O&&O.item?(w=u.from+O.from,k=O.marker(r,1)):w=u.from+(O?O.to:0);let S=[{from:w,to:c,insert:k}];return f.node.name=="OrderedList"&&B5(f.item,r,S,-2),O&&O.node.name=="OrderedList"&&B5(O.item,r,S),{range:it.cursor(w+k.length),changes:S}}else{let O=See(d,t,u);return{range:it.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),x=/>\s*$/.exec(y.text);if(x&&x.index==f.from){let O=t.changes([{from:y.from+x.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(O),changes:O}}}let m=[];f.node.name=="OrderedList"&&B5(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,x=d.length-1;y<=x;y++)b+=y==x&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=DQ(b,t),nRt(f.node,t.doc)&&(b=See(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:it.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},tRt=eRt();function Oee(e){return e.name=="QuoteMark"||e.name=="ListMark"}function nRt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),a=/^[\s>]*$/.test(r.text);return r.number+(a?0:1){let n=Or(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&JN.isActiveAt(e,s.from)){let c=l.lineAt(a),u=$_e(iRt(n,a),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(a-c.from>f&&!/\S/.test(c.text.slice(f,a-c.from)))return{range:it.cursor(c.from+f),changes:{from:c.from+f,to:a}};if(a-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!JN.isActiveAt(t.state,i.from,1)))return!1;let s=Or(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||cRt.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const uIt=new zs((e,t)=>{let n;if(e.next<0)e.acceptToken(pRt);else if(t.context.flags&$A)Q5(e.next)&&e.acceptToken(hRt,1);else if(((n=e.peek(-1))<0||Q5(n))&&t.canShift(kee)){let i=0;for(;e.next==MQ||e.next==RI;)e.advance(),i++;(e.next==Mb||e.next==gk||e.next==LQ)&&e.acceptToken(kee,-i)}else Q5(e.next)&&e.acceptToken(fRt,1)},{contextual:!0}),dIt=new zs((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==Mb||i==gk){let r=0,s=0;for(;;){if(e.next==MQ)r++;else if(e.next==RI)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=Mb&&e.next!=gk&&e.next!=LQ&&(r[e,t|W_e])),pIt=new _I({start:fIt,reduce(e,t,n,i){return e.flags&$A&&cIt.has(t)||(t==jRt||t==V_e)&&e.flags&W_e?e.parent:e},shift(e,t,n,i){return t==U_e?new FA(e,hIt(i.read(i.pos,n.pos)),0):t==Q_e?e.parent:t==bRt||t==wRt||t==kRt||t==z_e?new FA(e,0,$A):Aee.has(t)?new FA(e,0,Aee.get(t)|e.flags&$A):e},hash(e){return e.hash}}),mIt=new zs(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==MQ||n==RI)){n!=nIt&&n!=iIt&&n!=Mb&&n!=gk&&n!=LQ&&e.acceptToken(dRt);return}}}),gIt=new zs((e,t)=>{let{flags:n}=t.context,i=n&Tf?q_e:H_e,r=(n&Af)>0,s=!(n&_f),a=(n&Nf)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==o8)if(e.peek(1)==o8)e.advance(2);else{if(e.pos==l){e.acceptToken(z_e,1);return}break}else if(s&&e.next==Tee){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),bIt(e,c)),e.acceptToken(gRt);return}break}else if(e.next==Tee&&!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(Eee,r?3:1);return}break}else if(e.next==Mb){if(r)e.advance();else if(e.pos==l){e.acceptToken(Eee);return}break}else e.advance();e.pos>l&&e.acceptToken(mRt)});function bIt(e,t){if(t==rIt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==sIt)for(let n=0;n<2&&z5(e.next);n++)e.advance();else if(t==oIt)for(let n=0;n<4&&z5(e.next);n++)e.advance();else if(t==lIt)for(let n=0;n<8&&z5(e.next);n++)e.advance();else if(t==aIt&&e.next==o8){for(e.advance();e.next>=0&&e.next!=Cee&&e.next!=H_e&&e.next!=q_e&&e.next!=Mb;)e.advance();e.next==Cee&&e.advance()}}const yIt=Vh({'async "*" "**" FormatConversion FormatSpec':ne.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ne.controlKeyword,"in not and or is del":ne.operatorKeyword,"from def class global nonlocal lambda":ne.definitionKeyword,import:ne.moduleKeyword,"with as print":ne.keyword,Boolean:ne.bool,None:ne.null,VariableName:ne.variableName,"CallExpression/VariableName":ne.function(ne.variableName),"FunctionDefinition/VariableName":ne.function(ne.definition(ne.variableName)),"ClassDefinition/VariableName":ne.definition(ne.className),PropertyName:ne.propertyName,"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),Comment:ne.lineComment,Number:ne.number,String:ne.string,FormatString:ne.special(ne.string),Escape:ne.escape,UpdateOp:ne.updateOperator,"ArithOp!":ne.arithmeticOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,AssignOp:ne.definitionOperator,Ellipsis:ne.punctuation,At:ne.meta,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,".":ne.derefOperator,", ;":ne.separator}),vIt={__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},xIt=Rh.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[mIt,dIt,uIt,gIt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>vIt[e]||-1}],tokenPrec:7668}),_ee=new zU,G_e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function f2(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const wIt={FunctionDefinition:f2("function"),ClassDefinition:f2("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=r.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((i=a.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(a,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:f2("variable"),AsPattern:f2("variable"),__proto__:null};function K_e(e,t){let n=_ee.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(a.name){let l=wIt[a.name];if(l&&l(a,s,r)||!r&&G_e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of K_e(e,a.node))i.push(l);return!1}}),_ee.set(t,i),i}const Nee=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,X_e=["String","FormatString","Comment","PropertyName"];function OIt(e){let t=Or(e.state).resolveInner(e.pos,-1);if(X_e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Nee.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)G_e.has(r.name)&&(i=i.concat(K_e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Nee}}const SIt=["__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"}))),kIt=[ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),ys(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=KN.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new hi(this.parser.nodeSet.types[t],cx,cx,(i??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(i8(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?t_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=i8(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(Nt.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new r_e(t,n)}get buffer(){return new i_e(this.parser.nodeSet)}}function t_e(e,t,n,i,r){let s=e[t].to,a=[],l=[],c=n.from+i;function u(d,f){for(;f?d>=s:d>s;){let h=e[t+1].from-s;i+=h,d+=h,t++,s=e[t].to}}for(let d=n.firstChild;d;d=d.nextSibling){u(d.from+i,!0);let f=d.from+i,h,m=r.get(d.tree);m?h=m:d.to+i>s?(h=t_e(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),a.push(h),l.push(f-c)}return u(n.to+i,!1),new hi(n.type,a,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class jI extends yI{constructor(t,n,i,r,s,a,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=a,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of t.types)this.nodeTypes[d.name]=d.id}createParse(t,n,i){let r=new eNt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=n8(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(nw(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),m;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:x}=typeof g=="string"?{name:g}:g;if(h.some(k=>k.name==b))continue;y&&(r[h.length]=(k,S,E)=>y(S,E,k.value));let O=h.length,w=y?["Block","BlockContext"]:v?O>=Nt.ATXHeading1&&O<=Nt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(ea.define({id:O,name:b,props:w&&[[Ln.group,w]]})),x&&(m||(m={}),Array.isArray(x)||x instanceof gd?m[b]=x:Object.assign(m,x))}i=new t1(h),m&&(i=i.extend(Vh(m)))}if(nw(n.props)&&(i=i.extend(...n.props)),nw(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=a[m]=void 0),g>-1&&(c[g]=void 0)}if(nw(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,a[m]=h.leaf;else{let g=h.before?d2(l,h.before):h.after?d2(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),a.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(nw(n.parseInline))for(let h of n.parseInline){let m=u.indexOf(h.name);if(m>-1)c[m]=h.parse;else{let g=h.before?d2(u,h.before):h.after?d2(u,h.after)+1:u.length-1;c.splice(g,0,h.parse),u.splice(g,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new jI(i,s,a,l,d,r,c,u,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let i=new AQ(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function nw(e){return e!=null&&e.length>0}function n8(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=n8(e[0]);if(e.length==1)return t;let n=n8(e.slice(1));if(!n||!t)return t||n;let i=(a,l)=>(a||cx).concat(l||cx),r=t.wrap,s=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?s?(a,l,c,u)=>r(s(a,l,c,u),l,c,u):r:s}}function d2(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let n_e=[ea.none];for(let e=1,t;t=Nt[e];e++)n_e[e]=ea.define({id:e,name:t,props:e>=Nt.Escape?[]:[[Ln.group,e in HAe?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const cx=[];class i_e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return hi.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let fk=class{constructor(t,n,i,r=cx){this.type=t,this.from=n,this.to=i,this.children=r}writeTo(t,n){let i=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-i)}toTree(t){return new i_e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class r_e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return cx}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function Fi(e,t,n,i){return new fk(e,t,n,i)}const s_e={resolve:"Emphasis",mark:"EmphasisMark"},a_e={resolve:"Emphasis",mark:"EmphasisMark"},_g={},XN={};class ql{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const YJ="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let hk=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{hk=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const j5={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let i=e.char(n+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(Fi(Nt.Autolink,n,n+1+r[0].length,[Fi(Nt.LinkMark,n,n+1),Fi(Nt.URL,n+1,n+r[0].length),Fi(Nt.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(Fi(Nt.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(Fi(Nt.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(Fi(Nt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),a=hk.test(r),l=hk.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||a),f=!c&&(!a||u||l),h=d&&(t==42||!f||a),m=f&&(t==42||!d||l);return e.append(new ql(t==95?s_e:a_e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Fi(Nt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(Fi(Nt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new ql(_g,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new ql(XN,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof ql&&(r.type==_g||r.type==XN)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),a=e.parts[i]=tNt(e,s,r.type==_g?Nt.Link:Nt.Image,r.from,n+1);if(r.type==_g)for(let l=0;lt?Fi(Nt.URL,t+n,s+n):s==e.length?null:!1}}function l_e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,a=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new ql(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ql&&(n.type==_g||n.type==XN))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof ql&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+a)%3==0&&((b.to-b.from)%3||a%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,a);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof ql&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof ql?n:null}skipSpace(t){return VO(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new r_e(t,n)}}AQ.linkStart=_g;AQ.imageStart=XN;function i8(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Ln.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,a=s,l=t.block.children.length,c=a,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=u_e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new hi(t.parser.nodeSet.types[Nt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(nNt.indexOf(n.type.id)<0?(a=n.to-i,l=t.block.children.length):(a=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return a-s}}function u_e(e,t){let n=e;for(let i=1;iu2[e]),Object.keys(u2).map(e=>e_e[e]),Object.keys(u2),Z_t,HAe,Object.keys(j5).map(e=>j5[e]),Object.keys(j5),[]);function aNt(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let a=r?r.from:n;if(a>s&&i.push({from:s,to:a}),!r)break;s=r.to}return i}function oNt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ETe((r,s)=>{let a=r.type.id;if(t&&(a==Nt.CodeBlock||a==Nt.FencedCode)){let l="";if(a==Nt.FencedCode){let u=r.node.getChild(Nt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Nt.CodeText,bracketed:a==Nt.FencedCode}}else if(n&&(a==Nt.HTMLBlock||a==Nt.HTMLTag||a==Nt.CommentBlock))return{parser:n,overlay:aNt(r.node,r.from,r.to)};return null})}}const lNt={resolve:"Strikethrough",mark:"StrikethroughMark"},cNt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":ne.strikethrough}},{name:"StrikethroughMark",style:ne.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),a=/\s|^$/.test(r),l=hk.test(i),c=hk.test(r);return e.addDelimiter(lNt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function HO(e,t,n=0,i,r=0){let s=0,a=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,a=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function ZJ(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class JJ{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)&&d_e.test(r=n.text.slice(n.pos))){let s=[];HO(t,i.content,0,s,i.start)==HO(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];HO(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const uNt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":ne.heading}},"TableRow",{name:"TableCell",style:ne.content},{name:"TableDelimiter",style:ne.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return ZJ(t.content,0)?new JJ:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof JJ)||!ZJ(t.text,t.basePos))return!1;let i=e.peekLine();return d_e.test(i)&&HO(e,t.text,t.basePos)==HO(e,i,t.basePos)},before:"SetextHeading"}]};class dNt{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 fNt={defineNodes:[{name:"Task",block:!0,style:ne.list},{name:"TaskMarker",style:ne.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new dNt:null},after:"SetextHeading"}]},eee=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,tee=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,hNt=/[\w-]+\.[\w-]+($|[/:])/,nee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,iee=/\/[a-zA-Z\d@.]+/gy;function ree(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==")"&&ree(e,t,i,")")>ree(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 see(e,t){nee.lastIndex=t;let n=nee.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 mNt={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;eee.lastIndex=i;let r=eee.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=pNt(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+a[0].length}}else r[3]?s=see(e.text,i):(s=see(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(iee.lastIndex=s,r=iee.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)}}]},gNt=[uNt,fNt,cNt,mNt];function f_e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let a=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let cee=null,uee=null,dee=0;function s8(e,t){let n=e.pos+t;if(dee==n&&uee==e)return cee;let i=e.peek(t),r="";for(;zNt(i);)r+=String.fromCharCode(i),i=e.peek(++t);return uee=e,dee=n,cee=r?r.toLowerCase():i==VNt||i==HNt?void 0:null}const x_e=60,YN=62,NQ=47,VNt=63,HNt=33,qNt=45;function fee(e,t){this.name=e,this.parent=t}const WNt=[_Q,g_e,h_e,p_e,m_e],GNt=new _I({start:null,shift(e,t,n,i){return WNt.indexOf(t)>-1?new fee(s8(i,1)||"",e):e},reduce(e,t){return t==b_e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==_Q||r==LNt?new fee(s8(i,1)||"",e):e},strict:!1}),KNt=new zs((e,t)=>{if(e.next!=x_e){e.next<0&&t.context&&e.acceptToken(R5);return}e.advance();let n=e.next==NQ;n&&e.advance();let i=s8(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?jNt:NNt);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(TNt);if(r&&QNt[r])return e.acceptToken(R5,-2);if(t.dialectEnabled(FNt))return e.acceptToken(ANt);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(_Nt)}else{if(i=="script")return e.acceptToken(h_e);if(i=="style")return e.acceptToken(p_e);if(i=="textarea")return e.acceptToken(m_e);if(UNt.hasOwnProperty(i))return e.acceptToken(g_e);r&&lee[r]&&lee[r][i]?e.acceptToken(R5,-1):e.acceptToken(_Q)}},{contextual:!0}),XNt=new zs(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(oee);break}if(e.next==qNt)t++;else if(e.next==YN&&t>=2){n>=3&&e.acceptToken(oee,-2);break}else t=0;e.advance()}});function YNt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ZNt=new zs((e,t)=>{if(e.next==NQ&&e.peek(1)==YN){let n=t.dialectEnabled(BNt)||YNt(t.context);e.acceptToken(n?CNt:aee,2)}else e.next==YN&&e.acceptToken(aee,1)});function jQ(e,t,n){let i=2+e.length;return new zs(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==x_e||s==1&&r.next==NQ||s>=2&&sa?r.acceptToken(t,-a):r.acceptToken(n,-(a-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=a=0;r.advance()}})}const JNt=jQ("script",xNt,wNt),ejt=jQ("style",ONt,SNt),tjt=jQ("textarea",kNt,ENt),njt=Vh({"Text RawText IncompleteTag IncompleteCloseTag":ne.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ne.angleBracket,TagName:ne.tagName,"MismatchedCloseTag/TagName":[ne.tagName,ne.invalid],AttributeName:ne.attributeName,"AttributeValue UnquotedAttributeValue":ne.attributeValue,Is:ne.definitionOperator,"EntityReference CharacterReference":ne.character,Comment:ne.blockComment,ProcessingInst:ne.processingInstruction,DoctypeDecl:ne.documentMeta}),ijt=Rh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:GNt,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:[njt],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==PNt)return I5(l,c,n);if(u==DNt)return I5(l,c,i);if(u==MNt)return I5(l,c,r);if(u==b_e&&s.length){let d=l.node,f=d.firstChild,h=f&&hee(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=w_e(f,c))))){let b=d.lastChild,v=b.type.id==$Nt?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==y_e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=hee(d.parent,c))continue;let g=d.lastChild;if(g.type.id==r8){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==v_e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const rjt=145,pee=1,sjt=146,ajt=147,S_e=2,ojt=148,ljt=3,cjt=4,k_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],ujt=58,djt=40,E_e=95,fjt=91,MA=45,hjt=46,pjt=35,mjt=37,gjt=38,bjt=92,yjt=10,vjt=42;function pk(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function RQ(e){return e>=48&&e<=57}function mee(e){return RQ(e)||e>=97&&e<=102||e>=65&&e<=70}const C_e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(pk(c)||c==MA||c==E_e||s&&RQ(c))!s&&(c!=MA||l>0)&&(s=!0),a===l&&c==MA&&a++,i.advance();else if(c==bjt&&i.peek(1)!=yjt){if(i.advance(),mee(i.next)){do i.advance();while(mee(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(S_e)?t:c==djt?n:e);break}}},xjt=new zs(C_e(sjt,S_e,ajt),{contextual:!0}),wjt=new zs(C_e(ojt,ljt,cjt),{contextual:!0}),Ojt=new zs(e=>{if(k_e.includes(e.peek(-1))){let{next:t}=e;(pk(t)||t==E_e||t==pjt||t==hjt||t==vjt||t==fjt||t==ujt&&pk(e.peek(1))||t==MA||t==gjt)&&e.acceptToken(rjt)}}),Sjt=new zs(e=>{if(!k_e.includes(e.peek(-1))){let{next:t}=e;if(t==mjt&&(e.advance(),e.acceptToken(pee)),pk(t)){do e.advance();while(pk(e.next)||RQ(e.next));e.acceptToken(pee)}}}),kjt=Vh({"AtKeyword import charset namespace keyframes media supports font-feature-values":ne.definitionKeyword,"from to selector scope MatchFlag":ne.keyword,NamespaceName:ne.namespace,KeyframeName:ne.labelName,KeyframeRangeName:ne.operatorKeyword,TagName:ne.tagName,ClassName:ne.className,PseudoClassName:ne.constant(ne.className),IdName:ne.labelName,"FeatureName PropertyName":ne.propertyName,AttributeName:ne.attributeName,NumberLiteral:ne.number,KeywordQuery:ne.keyword,UnaryQueryOp:ne.operatorKeyword,"CallTag ValueName FontName":ne.atom,VariableName:ne.variableName,Callee:ne.operatorKeyword,Unit:ne.unit,"UniversalSelector NestingSelector":ne.definitionOperator,"MatchOp CompareOp":ne.compareOperator,"ChildOp SiblingOp, LogicOp":ne.logicOperator,BinOp:ne.arithmeticOperator,Important:ne.modifier,Comment:ne.blockComment,ColorLiteral:ne.color,"ParenthesizedContent StringLiteral":ne.string,":":ne.punctuation,"PseudoOp #":ne.derefOperator,"; , |":ne.separator,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace}),Ejt={__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},Cjt={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Tjt={__proto__:null,selector:118,style:124,layer:202},Ajt={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},_jt={__proto__:null,to:243},Njt=Rh.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Ojt,Sjt,xjt,wjt,1,2,3,4,new qN("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>Ejt[e]||-1},{term:148,get:e=>Cjt[e]||-1},{term:4,get:e=>Tjt[e]||-1},{term:28,get:e=>Ajt[e]||-1},{term:146,get:e=>_jt[e]||-1}],tokenPrec:2405});let P5=null;function D5(){if(!P5&&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)));P5=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return P5||[]}const gee=["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})),bee=["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}))),jjt=["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})),Rjt=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),xf=/^(\w[\w-]*|-\w[\w-]*|)$/,Ijt=/^-(-[\w-]*)?$/;function Pjt(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 yee=new zU,Djt=["Declaration"];function Mjt(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function T_e(e,t,n){if(t.to-t.from>4096){let i=yee.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(er.IncludeAnonymous);if(a.firstChild())do for(let l of T_e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return yee.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(Djt)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const Ljt=e=>t=>{let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:D5(),validFor:xf};if(r.name=="ValueName")return{from:r.from,options:bee,validFor:xf};if(r.name=="PseudoClassName")return{from:r.from,options:gee,validFor:xf};if(e(r)||(t.explicit||s)&&Pjt(r,n.doc))return{from:e(r)||s?r.from:i,options:T_e(n.doc,Mjt(r),e),validFor:Ijt};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:D5(),validFor:xf};return{from:r.from,options:jjt,validFor:xf}}if(r.name=="AtKeyword")return{from:r.from,options:Rjt,validFor:xf};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:gee,validFor:xf}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:bee,validFor:xf}:a.name=="Block"||a.name=="Styles"?{from:i,options:D5(),validFor:xf}:null},$jt=Ljt(e=>e.name=="VariableName"),ZN=jh.define({name:"css",parser:Njt.configure({props:[Hh.add({Declaration:pv()}),qh.add({"Block KeyframeList":LE})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Fjt(){return new Nm(ZN,ZN.data.of({autocomplete:$jt}))}const iw=["_blank","_self","_top","_parent"],M5=["ascii","utf-8","utf-16","latin1","latin1"],L5=["get","post","put","delete"],$5=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ml=["true","false"],mn={},Bjt={a:{attrs:{href:null,ping:null,type:null,media:null,target:iw,hreflang:null}},abbr:mn,address:mn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:mn,aside:mn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:mn,base:{attrs:{href:null,target:iw}},bdi:mn,bdo:mn,blockquote:{attrs:{cite:null}},body:mn,br:mn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:$5,formmethod:L5,formnovalidate:["novalidate"],formtarget:iw,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:mn,center:mn,cite:mn,code:mn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:mn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:mn,div:mn,dl:mn,dt:mn,em:mn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:mn,figure:mn,footer:mn,form:{attrs:{action:null,name:null,"accept-charset":M5,autocomplete:["on","off"],enctype:$5,method:L5,novalidate:["novalidate"],target:iw}},h1:mn,h2:mn,h3:mn,h4:mn,h5:mn,h6:mn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:mn,hgroup:mn,hr:mn,html:{attrs:{manifest:null}},i:mn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:$5,formmethod:L5,formnovalidate:["novalidate"],formtarget:iw,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:mn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:mn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:mn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:M5,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:mn,noscript:mn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:mn,param:{attrs:{name:null,value:null}},pre:mn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:mn,rt:mn,ruby:mn,samp:mn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:M5}},section:mn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:mn,source:{attrs:{src:null,type:null,media:null}},span:mn,strong:mn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:mn,summary:mn,sup:mn,table:mn,tbody:mn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:mn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:mn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:mn,time:{attrs:{datetime:null}},title:mn,tr:mn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:mn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:mn},A_e={accesskey:null,class:null,contenteditable:Ml,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ml,autocorrect:Ml,autocapitalize:Ml,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ml,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ml,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ml,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ml,"aria-hidden":Ml,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ml,"aria-multiselectable":Ml,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ml,"aria-relevant":null,"aria-required":Ml,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},__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 __e)A_e[e]=null;class mk{constructor(t,n){this.tags={...Bjt,...t},this.globalAttrs={...A_e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}mk.default=new mk;function ux(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function dx(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function N_e(e,t,n){let i=n.tags[ux(e,dx(t))];return(i==null?void 0:i.children)||n.allTags}function IQ(e,t){let n=[];for(let i=dx(t);i&&!i.type.isTop;i=dx(i.parent)){let r=ux(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const j_e=/^[:\-\.\w\u00b7-\uffff]*$/;function vee(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=dx(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:N_e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(IQ(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function xee(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:IQ(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:j_e}}function Ujt(e,t,n,i){let r=[],s=0;for(let a of N_e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of IQ(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Qjt(e,t,n,i,r){let s=dx(n),a=s?t.tags[ux(e.doc,s)]:null,l=a&&a.attrs?Object.keys(a.attrs):[],c=a&&a.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:j_e}}function zjt(e,t,n,i,r){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(a){let u=e.sliceDoc(a.from,a.to),d=t.globalAttrs[u];if(!d){let f=dx(n),h=f?t.tags[ux(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',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 R_e(e,t){let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.resolve(i);for(let a=i,l;s==r&&(l=r.childBefore(a));){let c=l.lastChild;if(!c||!c.type.isError||c.fromR_e(i,r)}const qjt=$d.parser.configure({top:"SingleExpression"}),I_e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:BAe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:UAe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:QAe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:qjt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:$d.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:ZN.parser}],P_e=[{name:"style",parser:ZN.parser.configure({top:"Styles"})}].concat(__e.map(e=>({name:e,parser:$d.parser}))),D_e=jh.define({name:"html",parser:ijt.configure({props:[Hh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),LA=D_e.configure({wrap:O_e(I_e,P_e)});function Wjt(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=O_e((e.nestedLanguages||[]).concat(I_e),(e.nestedAttributes||[]).concat(P_e)));let i=n?D_e.configure({wrap:n,dialect:t}):t?LA.configure({dialect:t}):LA;return new Nm(i,[LA.data.of({autocomplete:Hjt(e)}),e.autoCloseTags!==!1?Gjt:[],J$().support,Fjt().support])}const wee=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Gjt=Ft.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!LA.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u,d,f;let h=a.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Or(a).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=ux(a.doc,v.parent,m))&&!wee.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),x=``;return{range:c,changes:{from:m,to:y,insert:x}}}}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=ux(a.doc,v,m))&&!wee.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),x=`${b}>`;return{range:it.cursor(m+x.length,-1),changes:{from:m,to:y,insert:x}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),M_e=CI({commentTokens:{block:{open:""}}}),L_e=new Ln,$_e=sNt.configure({props:[qh.add(e=>!e.is("Block")||e.is("Document")||a8(e)!=null||Kjt(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),L_e.add(a8),Hh.add({Document:()=>null}),zp.add({Document:M_e})]});function a8(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Kjt(e){return e.name=="OrderedList"||e.name=="BulletList"}function Xjt(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=a8(i.type))!=null&&r<=t)break;n=i}return n.to}const Yjt=iAe.of((e,t,n)=>{for(let i=Or(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function PQ(e){return new ec(M_e,e,[],"markdown")}const Zjt=PQ($_e),Jjt=$_e.configure([gNt,yNt,bNt,vNt,{props:[qh.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),JN=PQ(Jjt);function eRt(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=UN.matchLanguageName(e,n,!0),i instanceof UN)return i.support?i.support.language.parser:Ib.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let F5=class{constructor(t,n,i,r,s,a,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=a,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+B_e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function F_e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],a,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new F5(s,c,c+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=a[3],d=a[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new F5(s.parent,c,c+d,a[1],u,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=a[4],d=a[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),i.push(new F5(s.parent,c,c+d,a[1],u,f,s))}}return i}function B_e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function B5(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=B_e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let a=s.nextSibling;if(!a)break;s=a}}function DQ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i1)!=" ")return e;let i=Uu(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const tRt=(e={})=>({state:t,dispatch:n})=>{let i=Or(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!JN.isActiveAt(t,l.from,-1)&&!JN.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=F_e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,x=f.node.getChild("ListItem","ListItem");if(y.to>=c||x&&x.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,w,k="";O&&O.item?(w=u.from+O.from,k=O.marker(r,1)):w=u.from+(O?O.to:0);let S=[{from:w,to:c,insert:k}];return f.node.name=="OrderedList"&&B5(f.item,r,S,-2),O&&O.node.name=="OrderedList"&&B5(O.item,r,S),{range:it.cursor(w+k.length),changes:S}}else{let O=See(d,t,u);return{range:it.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),x=/>\s*$/.exec(y.text);if(x&&x.index==f.from){let O=t.changes([{from:y.from+x.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(O),changes:O}}}let m=[];f.node.name=="OrderedList"&&B5(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,x=d.length-1;y<=x;y++)b+=y==x&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=DQ(b,t),iRt(f.node,t.doc)&&(b=See(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:it.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},nRt=tRt();function Oee(e){return e.name=="QuoteMark"||e.name=="ListMark"}function iRt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),a=/^[\s>]*$/.test(r.text);return r.number+(a?0:1){let n=Or(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&JN.isActiveAt(e,s.from)){let c=l.lineAt(a),u=F_e(rRt(n,a),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(a-c.from>f&&!/\S/.test(c.text.slice(f,a-c.from)))return{range:it.cursor(c.from+f),changes:{from:c.from+f,to:a}};if(a-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!JN.isActiveAt(t.state,i.from,1)))return!1;let s=Or(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||uRt.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const dIt=new zs((e,t)=>{let n;if(e.next<0)e.acceptToken(mRt);else if(t.context.flags&$A)Q5(e.next)&&e.acceptToken(pRt,1);else if(((n=e.peek(-1))<0||Q5(n))&&t.canShift(kee)){let i=0;for(;e.next==MQ||e.next==RI;)e.advance(),i++;(e.next==Mb||e.next==gk||e.next==LQ)&&e.acceptToken(kee,-i)}else Q5(e.next)&&e.acceptToken(hRt,1)},{contextual:!0}),fIt=new zs((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==Mb||i==gk){let r=0,s=0;for(;;){if(e.next==MQ)r++;else if(e.next==RI)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=Mb&&e.next!=gk&&e.next!=LQ&&(r[e,t|G_e])),mIt=new _I({start:hIt,reduce(e,t,n,i){return e.flags&$A&&uIt.has(t)||(t==RRt||t==H_e)&&e.flags&G_e?e.parent:e},shift(e,t,n,i){return t==Q_e?new FA(e,pIt(i.read(i.pos,n.pos)),0):t==z_e?e.parent:t==yRt||t==ORt||t==ERt||t==V_e?new FA(e,0,$A):Aee.has(t)?new FA(e,0,Aee.get(t)|e.flags&$A):e},hash(e){return e.hash}}),gIt=new zs(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==MQ||n==RI)){n!=iIt&&n!=rIt&&n!=Mb&&n!=gk&&n!=LQ&&e.acceptToken(fRt);return}}}),bIt=new zs((e,t)=>{let{flags:n}=t.context,i=n&Tf?W_e:q_e,r=(n&Af)>0,s=!(n&_f),a=(n&Nf)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==o8)if(e.peek(1)==o8)e.advance(2);else{if(e.pos==l){e.acceptToken(V_e,1);return}break}else if(s&&e.next==Tee){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),yIt(e,c)),e.acceptToken(bRt);return}break}else if(e.next==Tee&&!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(Eee,r?3:1);return}break}else if(e.next==Mb){if(r)e.advance();else if(e.pos==l){e.acceptToken(Eee);return}break}else e.advance();e.pos>l&&e.acceptToken(gRt)});function yIt(e,t){if(t==sIt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==aIt)for(let n=0;n<2&&z5(e.next);n++)e.advance();else if(t==lIt)for(let n=0;n<4&&z5(e.next);n++)e.advance();else if(t==cIt)for(let n=0;n<8&&z5(e.next);n++)e.advance();else if(t==oIt&&e.next==o8){for(e.advance();e.next>=0&&e.next!=Cee&&e.next!=q_e&&e.next!=W_e&&e.next!=Mb;)e.advance();e.next==Cee&&e.advance()}}const vIt=Vh({'async "*" "**" FormatConversion FormatSpec':ne.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ne.controlKeyword,"in not and or is del":ne.operatorKeyword,"from def class global nonlocal lambda":ne.definitionKeyword,import:ne.moduleKeyword,"with as print":ne.keyword,Boolean:ne.bool,None:ne.null,VariableName:ne.variableName,"CallExpression/VariableName":ne.function(ne.variableName),"FunctionDefinition/VariableName":ne.function(ne.definition(ne.variableName)),"ClassDefinition/VariableName":ne.definition(ne.className),PropertyName:ne.propertyName,"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),Comment:ne.lineComment,Number:ne.number,String:ne.string,FormatString:ne.special(ne.string),Escape:ne.escape,UpdateOp:ne.updateOperator,"ArithOp!":ne.arithmeticOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,AssignOp:ne.definitionOperator,Ellipsis:ne.punctuation,At:ne.meta,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,".":ne.derefOperator,", ;":ne.separator}),xIt={__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},wIt=Rh.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[gIt,fIt,dIt,bIt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>xIt[e]||-1}],tokenPrec:7668}),_ee=new zU,K_e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function f2(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const OIt={FunctionDefinition:f2("function"),ClassDefinition:f2("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=r.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((i=a.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(a,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:f2("variable"),AsPattern:f2("variable"),__proto__:null};function X_e(e,t){let n=_ee.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(a.name){let l=OIt[a.name];if(l&&l(a,s,r)||!r&&K_e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of X_e(e,a.node))i.push(l);return!1}}),_ee.set(t,i),i}const Nee=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Y_e=["String","FormatString","Comment","PropertyName"];function SIt(e){let t=Or(e.state).resolveInner(e.pos,-1);if(Y_e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Nee.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)K_e.has(r.name)&&(i=i.concat(X_e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Nee}}const kIt=["__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"}))),EIt=[ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),ys(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],EIt=kAe(X_e,gQ(SIt.concat(kIt)));function V5(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 H5(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 q5=jh.define({name:"python",parser:xIt.configure({props:[Hh.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&V5(e)||e.node;return(t=H5(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=V5(e);return(t=H5(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":hv({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":hv({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":hv({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=V5(e);return(t=n&&H5(e,n))!==null&&t!==void 0?t:e.continue()}}),qh.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":LE,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function CIt(){return new Nm(q5,[q5.data.of({autocomplete:OIt}),q5.data.of({autocomplete:EIt})])}const ay=63,jee=64,TIt=1,AIt=2,Y_e=3,_It=4,Z_e=5,NIt=6,jIt=7,J_e=65,RIt=66,IIt=8,PIt=9,DIt=10,MIt=11,LIt=12,eNe=13,$It=19,FIt=20,BIt=29,UIt=33,QIt=34,zIt=47,VIt=0,$Q=1,l8=2,bk=3,c8=4;class Ng{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}Ng.top=new Ng(null,-1,VIt);function qO(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(Ih(r)||r==-1)return n}}function u8(e){return e==32||e==9}function Ih(e){return e==10||e==13}function tNe(e){return u8(e)||Ih(e)}function Vg(e){return e<0||tNe(e)}const HIt=new _I({start:Ng.top,reduce(e,t){return e.type==bk&&(t==FIt||t==QIt)?e.parent:e},shift(e,t,n,i){if(t==Y_e)return new Ng(e,qO(i,i.pos),$Q);if(t==J_e||t==Z_e)return new Ng(e,qO(i,i.pos),l8);if(t==ay)return e.parent;if(t==$It||t==UIt)return new Ng(e,0,bk);if(t==eNe&&e.type==c8)return e.parent;if(t==zIt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Ng(e,e.depth+ +r[0],c8)}return e},hash(e){return e.hash}});function fx(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Vg(e.peek(n+3))}const qIt=new zs((e,t)=>{if(e.next==-1&&t.canShift(jee))return e.acceptToken(jee);let n=e.peek(-1);if((Ih(n)||n<0)&&t.context.type!=bk){if(fx(e,45))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(TIt,3);if(fx(e,46))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(AIt,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==bk){e.next==63&&(e.advance(),Vg(e.next)&&e.acceptToken(jIt));return}if(e.next==45)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==$Q&&t.context.depth==qO(e,e.pos-1)?_It:Y_e);else if(e.next==63)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==l8&&t.context.depth==qO(e,e.pos-1)?NIt:Z_e);else{let n=e.pos;for(;;)if(u8(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)nNe(e);else if(e.next==38)d8(e);else if(e.next==42){d8(e);break}else if(e.next==39||e.next==34){if(FQ(e,!0))break;return}else if(e.next==91||e.next==123){if(!KIt(e))return;break}else{iNe(e,!0,!1,0);break}for(;u8(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(BIt))return;let i=e.peek(1);Vg(i)&&e.acceptTokenTo(t.context.type==l8&&t.context.depth==qO(e,n)?RIt:J_e,n)}}},{contextual:!0});function GIt(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 Ree(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Iee(e,t){return e.next==37?(e.advance(),Ree(e.next)&&e.advance(),Ree(e.next)&&e.advance(),!0):GIt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function nNe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Iee(e,!0)){e.next==62&&e.advance();break}}else for(;Iee(e,!1););}function d8(e){for(e.advance();!Vg(e.next)&&ej(e.next)!="f";)e.advance()}function FQ(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(Ih(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function KIt(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(!FQ(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Ih(e.next))return!1;e.advance()}}const XIt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function ej(e){return e<33?"u":e>125?"s":XIt[e-33]}function W5(e,t){let n=ej(e);return n!="u"&&!(t&&n=="f")}function iNe(e,t,n,i){if(ej(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&W5(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;tNe(s);){if(Ih(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?W5(e.peek(a+1),n):s==35?e.peek(a-1)!=32:W5(s,n)))||!n&&l<=i||l==0&&!n&&(fx(e,45,a)||fx(e,46,a)))break;if(t&&ej(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const YIt=new zs((e,t)=>{if(e.next==33)nNe(e),e.acceptToken(LIt);else if(e.next==38||e.next==42){let n=e.next==38?DIt:MIt;d8(e),e.acceptToken(n)}else e.next==39||e.next==34?(FQ(e,!1),e.acceptToken(PIt)):iNe(e,!1,t.context.type==bk,t.context.depth)&&e.acceptToken(IIt)}),ZIt=new zs((e,t)=>{let n=t.context.type==c8?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(fx(e,45,r)||fx(e,46,r))||!Ih(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:HIt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[JIt],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:[qIt,WIt,YIt,ZIt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),tPt=jh.define({name:"yaml",parser:ePt.configure({props:[Hh.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:hv({closing:"}"}),FlowSequence:hv({closing:"]"})}),qh.add({"FlowMapping FlowSequence":LE,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function nPt(){return new Nm(tPt)}function iPt(e){rNe(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],a=e[r],l=0;l2&&a.token&&typeof a.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var a=0;a{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=UQ(e.state,n.from);return i.line?vPt(e):i.block?wPt(e):!1};function BQ(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 vPt=BQ(kPt,0),xPt=BQ(cNe,0),wPt=BQ((e,t)=>cNe(e,t,SPt(t)),0);function UQ(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const rw=50;function OPt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-rw,i),a=e.sliceDoc(r,r+rw),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(a)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*rw?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+rw),f=e.sliceDoc(r-rw,r));let h=/^\s*/.exec(d)[0].length,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 SPt(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 cNe(e,t,n=t.selection.ranges){let i=n.map(s=>UQ(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>OPt(t,i[a],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,a)=>r[a]?[]:[{from:s.from,insert:i[a].open+" "},{from:s.to,insert:" "+i[a].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let a=0,l;ar&&(s==a||a>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let a=t.changes(s);return{changes:a,selection:t.selection.map(a,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:c}of i)if(l>=0){let u=a.from+l,d=u+c.length;a.text[d-a.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const h8=Jd.define(),EPt=Jd.define(),CPt=Zt.define(),uNe=Zt.define({combine(e){return ef(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),dNe=ro.define({create(){return Nd.empty},update(e,t){let n=t.state.facet(uNe),i=t.annotation(h8);if(i){let c=pl.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=tj(d,d.length,n.minDepth,c):d=pNe(d,t.startState.selection),new Nd(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(EPt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Js.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=pl.fromTransaction(t),a=t.annotation(Js.time),l=t.annotation(Js.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nd(e.done.map(pl.fromJSON),e.undone.map(pl.fromJSON))}});function TPt(e={}){return[dNe,uNe.of(e),Ft.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?fNe:t.inputType=="historyRedo"?p8:null;return i?(t.preventDefault(),i(n)):!1}})]}function II(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(dNe,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const fNe=II(0,!1),p8=II(1,!1),APt=II(0,!0),_Pt=II(1,!0);class pl{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new pl(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new pl(t.changes&&ma.fromJSON(t.changes),[],t.mapped&&Ld.fromJSON(t.mapped),t.startSelection&&it.fromJSON(t.startSelection),t.selectionsAfter.map(it.fromJSON))}static fromTransaction(t,n){let i=Xc;for(let r of t.startState.facet(CPt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new pl(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Xc)}static selection(t){return new pl(void 0,Xc,void 0,void 0,t)}}function tj(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function NPt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,a,l)=>{for(let c=0;c=u&&a<=d&&(i=!0)}}),i}function jPt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function hNe(e,t){return e.length?t.length?e.concat(t):e:t}const Xc=[],RPt=200;function pNe(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-RPt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),tj(e,e.length-1,1e9,n.setSelAfter(i)))}else return[pl.selection([t])]}function IPt(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 G5(e,t){if(!e.length)return e;let n=e.length,i=Xc;for(;n;){let r=PPt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[pl.selection(i)]:Xc}function PPt(e,t,n){let i=hNe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Xc,n);if(!e.changes)return pl.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new pl(r,Fn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const DPt=/^(input\.type|delete)($|\.)/;class Nd{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Nd(this.done,this.undone):this}addChanges(t,n,i,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||DPt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):PI(n,t))}function ko(e){return e.textDirectionAt(e.state.selection.main.head)==Cr.LTR}const gNe=e=>mNe(e,!ko(e)),bNe=e=>mNe(e,ko(e));function yNe(e,t){return Ju(e,n=>n.empty?e.moveByGroup(n,t):PI(n,t))}const LPt=e=>yNe(e,!ko(e)),$Pt=e=>yNe(e,ko(e));function FPt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function DI(e,t,n){let i=Or(e).resolveInner(t.head),r=n?Ln.closedBy:Ln.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;FPt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?_d(e,i.from,1):_d(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,it.cursor(l,n?-1:1)}const BPt=e=>Ju(e,t=>DI(e.state,t,!ko(e))),UPt=e=>Ju(e,t=>DI(e.state,t,ko(e)));function vNe(e,t){return Ju(e,n=>{if(!n.empty)return PI(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const xNe=e=>vNe(e,!1),wNe=e=>vNe(e,!0);function ONe(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):PI(a,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let a=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomSNe(e,!1),m8=e=>SNe(e,!0);function Hm(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=it.cursor(i.from+s))}return r}const QPt=e=>Ju(e,t=>Hm(e,t,!0)),zPt=e=>Ju(e,t=>Hm(e,t,!1)),VPt=e=>Ju(e,t=>Hm(e,t,!ko(e))),HPt=e=>Ju(e,t=>Hm(e,t,ko(e))),qPt=e=>Ju(e,t=>it.cursor(e.lineBlockAt(t.head).from,1)),WPt=e=>Ju(e,t=>it.cursor(e.lineBlockAt(t.head).to,-1));function GPt(e,t,n){let i=!1,r=s1(e.selection,s=>{let a=_d(e,s.head,-1)||_d(e,s.head,1)||s.head>0&&_d(e,s.head-1,1)||s.headGPt(e,t);function lu(e,t,n){let i=s1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=it.range(r.head,r.anchor));let s=n(r);return it.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Zu(e.state,i)),!0)}function kNe(e,t){return lu(e,t,n=>e.moveByChar(n,t))}const ENe=e=>kNe(e,!ko(e)),CNe=e=>kNe(e,ko(e));function TNe(e,t){return lu(e,t,n=>e.moveByGroup(n,t))}const XPt=e=>TNe(e,!ko(e)),YPt=e=>TNe(e,ko(e)),ZPt=e=>{let t=!ko(e);return lu(e,t,n=>DI(e.state,n,t))},JPt=e=>{let t=ko(e);return lu(e,t,n=>DI(e.state,n,t))};function ANe(e,t){return lu(e,t,n=>e.moveVertically(n,t))}const _Ne=e=>ANe(e,!1),NNe=e=>ANe(e,!0);function jNe(e,t){return lu(e,t,n=>e.moveVertically(n,t,ONe(e).height))}const Dee=e=>jNe(e,!1),Mee=e=>jNe(e,!0),eDt=e=>lu(e,!0,t=>Hm(e,t,!0)),tDt=e=>lu(e,!1,t=>Hm(e,t,!1)),nDt=e=>{let t=!ko(e);return lu(e,t,n=>Hm(e,n,t))},iDt=e=>{let t=ko(e);return lu(e,t,n=>Hm(e,n,t))},rDt=e=>lu(e,!1,t=>it.cursor(e.lineBlockAt(t.head).from)),sDt=e=>lu(e,!0,t=>it.cursor(e.lineBlockAt(t.head).to)),Lee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:0})),!0),$ee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.doc.length})),!0),Fee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:0})),!0),Bee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),aDt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),oDt=({state:e,dispatch:t})=>{let n=MI(e).map(({from:i,to:r})=>it.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:it.create(n),userEvent:"select"})),!0},lDt=({state:e,dispatch:t})=>{let n=s1(e.selection,i=>{let r=Or(e),s=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&a.next)return it.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Zu(e,n)),!0)};function RNe(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(t?a.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heada.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Zu(n,it.create(r,r.length-1))),!0)}const cDt=e=>RNe(e,!1),uDt=e=>RNe(e,!0),dDt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=it.create([n.main]):n.main.empty||(i=it.create([it.cursor(n.main.head)])),i?(t(Zu(e,i)),!0):!1};function UE(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let c=t(s);ca&&(n="delete.forward",c=h2(e,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=h2(e,a,!1),l=h2(e,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:it.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const INe=(e,t,n)=>UE(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rINe(e,!1,!0),PNe=e=>INe(e,!0,!1),DNe=(e,t)=>UE(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=$a(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=a(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),MNe=e=>DNe(e,!1),fDt=e=>DNe(e,!0),hDt=e=>UE(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headUE(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),mDt=e=>UE(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Gi.of(["",""])},range:it.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},bDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),a=r==s.from?r-1:$a(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:$a(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(a,r))},range:it.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function MI(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let a=t[t.length-1];a.to=s.to,a.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function LNe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of MI(e)){if(n?s.to==e.doc.length:s.from==0)continue;let a=e.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){i.push({from:s.to,to:a.to},{from:s.from,insert:a.text+e.lineBreak});for(let c of s.ranges)r.push(it.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:a.from,to:s.from},{from:s.to,insert:e.lineBreak+a.text});for(let c of s.ranges)r.push(it.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:it.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const yDt=({state:e,dispatch:t})=>LNe(e,t,!1),vDt=({state:e,dispatch:t})=>LNe(e,t,!0);function $Ne(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of MI(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const xDt=({state:e,dispatch:t})=>$Ne(e,t,!1),wDt=({state:e,dispatch:t})=>$Ne(e,t,!0),ODt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(MI(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let a=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function SDt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Or(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(Ln.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Uee=FNe(!1),kDt=FNe(!0);function FNe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:a}=r,l=t.doc.lineAt(s),c=!e&&s==a&&SDt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new TI(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=uQ(u,s);for(d==null&&(d=Uu(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));al.from&&s{let r=[];for(let a=i.from;a<=i.to;){let l=e.doc.lineAt(a);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),a=l.to+1}let s=e.changes(r);return{changes:r,range:it.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const EDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new TI(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=QQ(e,(s,a,l)=>{let c=uQ(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=ok(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(QQ(e,(n,i)=>{i.push({from:n.from,insert:e.facet(i1)})}),{userEvent:"input.indent"})),!0),UNe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(QQ(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Uu(r,e.tabSize),a=0,l=ok(e,Math.max(0,s-Pb(e)));for(;a(e.setTabFocusMode(),!0),TDt=[{key:"Ctrl-b",run:gNe,shift:ENe,preventDefault:!0},{key:"Ctrl-f",run:bNe,shift:CNe},{key:"Ctrl-p",run:xNe,shift:_Ne},{key:"Ctrl-n",run:wNe,shift:NNe},{key:"Ctrl-a",run:qPt,shift:rDt},{key:"Ctrl-e",run:WPt,shift:sDt},{key:"Ctrl-d",run:PNe},{key:"Ctrl-h",run:g8},{key:"Ctrl-k",run:hDt},{key:"Ctrl-Alt-h",run:MNe},{key:"Ctrl-o",run:gDt},{key:"Ctrl-t",run:bDt},{key:"Ctrl-v",run:m8}],ADt=[{key:"ArrowLeft",run:gNe,shift:ENe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:LPt,shift:XPt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:VPt,shift:nDt,preventDefault:!0},{key:"ArrowRight",run:bNe,shift:CNe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:$Pt,shift:YPt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:HPt,shift:iDt,preventDefault:!0},{key:"ArrowUp",run:xNe,shift:_Ne,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Lee,shift:Fee},{mac:"Ctrl-ArrowUp",run:Pee,shift:Dee},{key:"ArrowDown",run:wNe,shift:NNe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$ee,shift:Bee},{mac:"Ctrl-ArrowDown",run:m8,shift:Mee},{key:"PageUp",run:Pee,shift:Dee},{key:"PageDown",run:m8,shift:Mee},{key:"Home",run:zPt,shift:tDt,preventDefault:!0},{key:"Mod-Home",run:Lee,shift:Fee},{key:"End",run:QPt,shift:eDt,preventDefault:!0},{key:"Mod-End",run:$ee,shift:Bee},{key:"Enter",run:Uee,shift:Uee},{key:"Mod-a",run:aDt},{key:"Backspace",run:g8,shift:g8,preventDefault:!0},{key:"Delete",run:PNe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:MNe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:fDt,preventDefault:!0},{mac:"Mod-Backspace",run:pDt,preventDefault:!0},{mac:"Mod-Delete",run:mDt,preventDefault:!0}].concat(TDt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),_Dt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:BPt,shift:ZPt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:UPt,shift:JPt},{key:"Alt-ArrowUp",run:yDt},{key:"Shift-Alt-ArrowUp",run:xDt},{key:"Alt-ArrowDown",run:vDt},{key:"Shift-Alt-ArrowDown",run:wDt},{key:"Mod-Alt-ArrowUp",run:cDt},{key:"Mod-Alt-ArrowDown",run:uDt},{key:"Escape",run:dDt},{key:"Mod-Enter",run:kDt},{key:"Alt-l",mac:"Ctrl-l",run:oDt},{key:"Mod-i",run:lDt,preventDefault:!0},{key:"Mod-[",run:UNe},{key:"Mod-]",run:BNe},{key:"Mod-Alt-\\",run:EDt},{key:"Shift-Mod-k",run:ODt},{key:"Shift-Mod-\\",run:KPt},{key:"Mod-/",run:yPt},{key:"Alt-A",run:xPt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:CDt}].concat(ADt),NDt={key:"Tab",run:BNe,shift:UNe},Qee=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class hx{constructor(t,n,i=0,r=t.length,s,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Qee(l)):Qee,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ol(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=VU(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=vd(t);let r=this.normalize(n);if(r.length)for(let s=0,a=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,a,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=nj(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new bv(n,t.sliceString(n,i));return K5.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:a}=r;return a>n&&(s=t.sliceString(n,a)+s,a=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=nj(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bv.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(zNe.prototype[Symbol.iterator]=VNe.prototype[Symbol.iterator]=function(){return this});function jDt(e){try{return new RegExp(e,zQ),!0}catch{return!1}}function nj(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const RDt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=zTt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=a,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=it.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Ft.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},IDt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},PDt=Zt.define({combine(e){return ef(e,IDt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function DDt(e){return[BDt,FDt]}const MDt=gn.mark({class:"cm-selectionMatch"}),LDt=gn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function zee(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=ns.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=ns.Word)}function $Dt(e,t,n,i){return e(t.sliceDoc(n,n+1))==ns.Word&&e(t.sliceDoc(i-1,i))==ns.Word}const FDt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(PDt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return gn.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return gn.none;let c=n.wordAt(r.head);if(!c)return gn.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return gn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(zee(a,n,r.from,r.to)&&$Dt(a,n,r.from,r.to)))return gn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return gn.none}let l=[];for(let c of e.visibleRanges){let u=new hx(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||zee(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(LDt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(MDt.range(d,f)),l.length>t.maxMatches))return gn.none}}return gn.set(l)}},{decorations:e=>e.decorations}),BDt=Ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),UDt=({state:e,dispatch:t})=>{let{selection:n}=e,i=it.create(n.ranges.map(r=>e.wordAt(r.head)||it.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function QDt(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let a=!1,l=new hx(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new hx(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),a=!0}else{if(a&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const zDt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return UDt({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=QDt(e,i);return r?(t(e.update({selection:e.selection.addRange(it.range(r.from,r.to),!1),effects:Ft.scrollIntoView(r.to)})),!0):!1},a1=Zt.define({combine(e){return ef(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new iMt(t),scrollToMatch:t=>Ft.scrollIntoView(t)})}});class HNe{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||jDt(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 KDt(this):new qDt(this)}getCursor(t,n=0,i){let r=t.doc?t:Ti.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?ly(this,r,n,i):oy(this,r,n,i)}}class qNe{constructor(t){this.spec=t}}function VDt(e,t,n){return(i,r,s,a)=>{if(n&&!n(i,r,s,a))return!1;let l=i>=a&&r<=a+s.length?s.slice(i-a,r-a):t.doc.sliceString(i,r);return e(l,t,i,r)}}function oy(e,t,n,i){let r;return e.wholeWord&&(r=HDt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=VDt(e.test,t,r)),new hx(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function HDt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=oy(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function WDt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function ly(e,t,n,i){let r;return e.wholeWord&&(r=GDt(t.charCategorizer(t.selection.main.head))),e.test&&(r=WDt(e.test,t,r)),new zNe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function ij(e,t){return e.slice($a(e,t,!1),t)}function rj(e,t){return e.slice(t,$a(e,t))}function GDt(e){return(t,n,i)=>!i[0].length||(e(ij(i.input,i.index))!=ns.Word||e(rj(i.input,i.index))!=ns.Word)&&(e(rj(i.input,i.index+i[0].length))!=ns.Word||e(ij(i.input,i.index+i[0].length))!=ns.Word)}class KDt extends qNe{nextMatch(t,n,i){let r=ly(this.spec,t,i,t.doc.length).next();return r.done&&(r=ly(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),a=ly(this.spec,t,s,i),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=ly(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const yk=Fn.define(),VQ=Fn.define(),sm=ro.define({create(e){return new X5(b8(e).create(),null)},update(e,t){for(let n of t.effects)n.is(yk)?e=new X5(n.value.create(),e.panel):n.is(VQ)&&(e=new X5(e.query,n.value?HQ:null));return e},provide:e=>sk.from(e,t=>t.panel)});class X5{constructor(t,n){this.query=t,this.panel=n}}const XDt=gn.mark({class:"cm-searchMatch"}),YDt=gn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ZDt=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sm))}update(e){let t=e.state.field(sm);(t!=e.startState.field(sm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return gn.none;let{view:n}=this,i=new Ah;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?YDt:XDt)})}return i.finish()}},{decorations:e=>e.decorations});function QE(e){return t=>{let n=t.state.field(sm,!1);return n&&n.query.spec.valid?e(t,n):KNe(t)}}const sj=QE((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=it.single(i.from,i.to),s=e.state.facet(a1);return e.dispatch({selection:r,effects:[qQ(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),GNe(e),!0}),aj=QE((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=it.single(r.from,r.to),a=e.state.facet(a1);return e.dispatch({selection:s,effects:[qQ(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),GNe(e),!0}),JDt=QE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:it.create(n.map(i=>it.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),eMt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let l=new hx(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(it.range(l.value.from,l.value.to))}return t(e.update({selection:it.create(s,a),userEvent:"select.search.matches"})),!0},Vee=QE((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let a=s,l=[],c,u,d=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),l.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),d.push(Ft.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let f=e.state.changes(l);return a&&(c=it.single(a.from,a.to).map(f),d.push(qQ(e,a)),d.push(n.facet(a1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),tMt=QE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:a,precise:l}=r;l&&n.push({from:s,to:a,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Ft.announce.of(i),userEvent:"input.replace.all"}),!0});function HQ(e){return e.state.facet(a1).createPanel(e)}function b8(e,t){var n,i,r,s,a;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(a1);return new HNe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(a=t==null?void 0:t.wholeWord)!==null&&a!==void 0?a:u.wholeWord})}function WNe(e){let t=lQ(e,HQ);return t&&t.dom.querySelector("[main-field]")}function GNe(e){let t=WNe(e);t&&t==e.root.activeElement&&t.select()}const KNe=e=>{let t=e.state.field(sm,!1);if(t&&t.panel){let n=WNe(e);if(n&&n!=e.root.activeElement){let i=b8(e.state,t.query.spec);i.valid&&e.dispatch({effects:yk.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[VQ.of(!0),t?yk.of(b8(e.state,t.query.spec)):Fn.appendConfig.of(sMt)]});return!0},XNe=e=>{let t=e.state.field(sm,!1);if(!t||!t.panel)return!1;let n=lQ(e,HQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:VQ.of(!1)}),!0},nMt=[{key:"Mod-f",run:KNe,scope:"editor search-panel"},{key:"F3",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:XNe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:eMt},{key:"Mod-Alt-g",run:RDt},{key:"Mod-d",run:zDt,preventDefault:!0}];class iMt{constructor(t){this.view=t;let n=this.query=t.state.field(sm).query.spec;this.commit=this.commit.bind(this),this.searchField=yr("input",{value:n.search,placeholder:Ll(t,"Find"),"aria-label":Ll(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yr("input",{value:n.replace,placeholder:Ll(t,"Replace"),"aria-label":Ll(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>sj(t),[Ll(t,"next")]),i("prev",()=>aj(t),[Ll(t,"previous")]),i("select",()=>JDt(t),[Ll(t,"all")]),yr("label",null,[this.caseField,Ll(t,"match case")]),yr("label",null,[this.reField,Ll(t,"regexp")]),yr("label",null,[this.wordField,Ll(t,"by word")]),...t.state.readOnly?[]:[yr("br"),this.replaceField,i("replace",()=>Vee(t),[Ll(t,"replace")]),i("replaceAll",()=>tMt(t),[Ll(t,"replace all")])],yr("button",{name:"close",onclick:()=>XNe(t),"aria-label":Ll(t,"close"),type:"button"},["×"])])}commit(){let t=new HNe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:yk.of(t)}))}keydown(t){ZCt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?aj:sj)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Vee(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(yk)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(a1).top}}function Ll(e,t){return e.state.phrase(t)}const p2=30,m2=/[\s\.,:;?!]/;function qQ(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-p2),a=Math.min(r,n+p2),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-p2;c--)if(!m2.test(l[c-1])&&m2.test(l[c])){l=l.slice(0,c);break}}return Ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const rMt=Ft.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"}}),sMt=[sm,zh.low(ZDt),rMt];class Hee{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class jg{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(vk).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),a=new Ah,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((O,w)=>Math.min(O,w.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mO.from||O.to==b))l.push(O),m++,v=Math.min(O.to,v);else{v=Math.min(O.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(O=>O.from==b&&(O.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let O=b-(d+u.value.length);O>0&&(u.next(O),d=b);for(let w=b;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let x=yMt(l);if(y)a.add(b,b,gn.widget({widget:new pMt(x),diagnostics:l.slice()}));else{let O=l.reduce((w,k)=>k.markClass?w+" "+k.markClass:w,"");a.add(b,v,gn.mark({class:"cm-lintRange cm-lintRange-"+x+O,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>v)}))}if(c=v,c==f)break;for(let O=0;O{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new Hee(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Hee(i.from,s,i.diagnostic)}}),i}function aMt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(vk).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(YNe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function oMt(e,t){return e.field(tc,!1)?t:t.concat(Fn.appendConfig.of(vMt))}const YNe=Fn.define(),WQ=Fn.define(),ZNe=Fn.define(),tc=ro.define({create(){return new jg(gn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=jm(n,e.selected.diagnostic,s)||jm(n,null,s)}!n.size&&r&&t.state.facet(vk).autoPanel&&(r=null),e=new jg(n,r,i)}for(let n of t.effects)if(n.is(YNe)){let i=t.state.facet(vk).autoPanel?n.value.length?xk.open:null:e.panel;e=jg.init(n.value,i,t.state)}else n.is(WQ)?e=new jg(e.diagnostics,n.value?xk.open:null,e.selected):n.is(ZNe)&&(e=new jg(e.diagnostics,e.panel,n.value));return e},provide:e=>[sk.from(e,t=>t.panel),Ft.decorations.from(e,t=>t.diagnostics)]}),lMt=gn.mark({class:"cm-lintRange cm-lintRange-active"});function cMt(e,t,n){let{diagnostics:i}=e.state.field(tc),r,s=-1,a=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(teje(e,n,!1)))}const dMt=e=>{let t=e.state.field(tc,!1);(!t||!t.panel)&&e.dispatch({effects:oMt(e.state,[WQ.of(!0)])});let n=lQ(e,xk.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qee=e=>{let t=e.state.field(tc,!1);return!t||!t.panel?!1:(e.dispatch({effects:WQ.of(!1)}),!0)},fMt=e=>{let t=e.state.field(tc,!1);if(!t)return!1;let n=e.state.selection.main,i=jm(t.diagnostics,null,n.to+1);return!i&&(i=jm(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),UTt(e,i.from,1,{tooltip:tje,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},hMt=[{key:"Mod-Shift-m",run:dMt,preventDefault:!0},{key:"F8",run:fMt}],vk=Zt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ef(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Wee,tooltipFilter:Wee,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 Wee(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function JNe(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 eje(e,t,n){var i;let r=n?JNe(t.actions):[];return yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,a)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=jm(e.state.field(tc).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[a]?u.indexOf(r[a]):-1,f=d<0?u:[u.slice(0,d),yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&yr("div",{class:"cm-diagnosticSource"},t.source))}class pMt extends Yu{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Gee{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=eje(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class xk{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)qee(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=JNe(s.actions);for(let l=0;l{for(let s=0;sqee(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(tc).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(a.has(d))continue;a.add(d);let f=-1,h;for(let 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(tc),i=jm(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:ZNe.of(i)})}static open(t){return new xk(t)}}function mMt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function g2(e){return mMt(``,'width="6" height="3"')}const gMt=Ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:g2("#f11")},".cm-lintRange-warning":{backgroundImage:g2("orange")},".cm-lintRange-info":{backgroundImage:g2("#999")},".cm-lintRange-hint":{backgroundImage:g2("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function bMt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function yMt(e){let t="hint",n=1;for(let i of e){let r=bMt(i.severity);r>n&&(n=r,t=i.severity)}return t}const tje=BTt(cMt,{hideOn:aMt}),vMt=[tc,Ft.decorations.compute([tc],e=>{let{selected:t,panel:n}=e.field(tc);return!t||!n||t.from==t.to?gn.none:gn.set([lMt.range(t.from,t.to)])}),tje,gMt];var Kee=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(C_t)),t.defaultKeymap!==!1&&(s=s.concat(_Dt)),t.searchKeymap!==!1&&(s=s.concat(nMt)),t.historyKeymap!==!1&&(s=s.concat(MPt)),t.foldKeymap!==!1&&(s=s.concat(N2t)),t.completionKeymap!==!1&&(s=s.concat(IAe)),t.lintKeymap!==!1&&(s=s.concat(hMt));var a=[];return t.lineNumbers!==!1&&a.push(X2e()),t.highlightActiveLineGutter!==!1&&a.push(n2t()),t.highlightSpecialChars!==!1&&a.push(mTt()),t.history!==!1&&a.push(TPt()),t.foldGutter!==!1&&a.push(P2t()),t.drawSelection!==!1&&a.push(rTt()),t.dropCursor!==!1&&a.push(cTt()),t.allowMultipleSelections!==!1&&a.push(Ti.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(O2t()),t.syntaxHighlighting!==!1&&a.push(dAe($2t,{fallback:!0})),t.bracketMatching!==!1&&a.push(H2t()),t.closeBrackets!==!1&&a.push(O_t()),t.autocompletion!==!1&&a.push(I_t()),t.rectangularSelection!==!1&&a.push(_Tt()),r!==!1&&a.push(RTt()),t.highlightActiveLine!==!1&&a.push(wTt()),t.highlightSelectionMatches!==!1&&a.push(DDt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(i1.of(" ".repeat(t.tabSize))),a.concat([n1.of(s.flat())]).filter(Boolean)};const xMt="#e5c07b",Xee="#e06c75",wMt="#56b6c2",OMt="#ffffff",BA="#abb2bf",y8="#7d8799",SMt="#61afef",kMt="#98c379",Yee="#d19a66",EMt="#c678dd",CMt="#21252b",Zee="#2c313a",Jee="#282c34",Y5="#353a42",TMt="#3E4451",ete="#528bff",AMt=Ft.theme({"&":{color:BA,backgroundColor:Jee},".cm-content":{caretColor:ete},".cm-cursor, .cm-dropCursor":{borderLeftColor:ete},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:TMt},".cm-panels":{backgroundColor:CMt,color:BA},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Jee,color:y8,border:"none"},".cm-activeLineGutter":{backgroundColor:Zee},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Y5},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y5,borderBottomColor:Y5},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Zee,color:BA}}},{dark:!0}),_Mt=FE.define([{tag:ne.keyword,color:EMt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:Xee},{tag:[ne.function(ne.variableName),ne.labelName],color:SMt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:Yee},{tag:[ne.definition(ne.name),ne.separator],color:BA},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:xMt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:wMt},{tag:[ne.meta,ne.comment],color:y8},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:y8,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:Xee},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:Yee},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:kMt},{tag:ne.invalid,color:OMt}]),NMt=[AMt,dAe(_Mt)];var jMt=Ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),RMt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,a=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(n1.of([NDt])),g&&(typeof g=="boolean"?b.unshift(Kee()):b.unshift(Kee(g))),h&&b.unshift(ETt(h)),d){case"light":b.push(jMt);break;case"dark":b.push(NMt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push(Ft.editable.of(!1)),c&&b.push(Ti.readOnly.of(!0)),[...b]},IMt=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 PMt{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 tte{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 Z5=null,DMt=()=>typeof window>"u"?new tte:(Z5||(Z5=new tte),Z5),MMt=Ft.theme({"& .cm-scroller":{height:"100% !important"}}),nte=null,J5=null;function LMt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var a=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return a===nte||(nte=a,J5=Ft.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),J5}var ite=Jd.define(),$Mt=200,FMt=[];function BMt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,a=e.onUpdate,l=e.extensions,c=l===void 0?FMt: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,x=e.width,O=x===void 0?null:x,w=e.minWidth,k=w===void 0?null:w,S=e.maxWidth,E=S===void 0?null:S,C=e.placeholder,N=C===void 0?"":C,_=e.editable,j=_===void 0?!0:_,A=e.readOnly,F=A===void 0?!1:A,T=e.indentWithTab,P=T===void 0?!0:T,R=e.basicSetup,L=R===void 0?!0:R,M=e.root,U=e.initialState,I=p.useState(),H=I[0],K=I[1],Q=p.useState(),q=Q[0],B=Q[1],ee=p.useState(),le=ee[0],se=ee[1],re=p.useState(()=>({current:null}))[0],ge=p.useState(()=>({current:null}))[0],W=LMt(m,b,y,O,k,E),X=Ft.updateListener.of(Oe=>{if(Oe.docChanged&&typeof i=="function"&&!Oe.transactions.some(Le=>Le.annotation(ite))){re.current?re.current.reset():(re.current=new PMt(()=>{if(ge.current){var Le=ge.current;ge.current=null,Le()}re.current=null},$Mt),DMt().add(re.current));var ke=Oe.state.doc,st=ke.toString();i(st,Oe)}r&&r(IMt(Oe))}),ae=RMt({theme:f,editable:j,readOnly:F,placeholder:N,indentWithTab:P,basicSetup:L}),ue=[X,...W?[W]:[],MMt,...ae];return a&&typeof a=="function"&&ue.push(Ft.updateListener.of(a)),ue=ue.concat(c),p.useLayoutEffect(()=>{if(H&&!le){var Oe={doc:t,selection:n,extensions:ue},ke=U?Ti.fromJSON(U.json,Oe,U.fields):Ti.create(Oe);if(se(ke),!q){var st=new Ft({state:ke,parent:H,root:M});B(st),s&&s(st,ke)}}return()=>{q&&(se(void 0),B(void 0))}},[H,le]),p.useEffect(()=>{e.container&&K(e.container)},[e.container]),p.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),re.current&&(re.current.cancel(),re.current=null)},[q]),p.useEffect(()=>{u&&q&&q.focus()},[u,q]),p.useEffect(()=>{q&&q.dispatch({effects:Fn.reconfigure.of(ue)})},[f,c,m,b,y,O,k,E,N,j,F,P,L,i,a]),p.useEffect(()=>{if(t!==void 0){var Oe=q?q.state.doc.toString():"";if(q&&t!==Oe){var ke=re.current&&!re.current.isDone,st=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[ite.of(!0)]})};ke?ge.current=st:st()}}},[t,q]),{state:le,setState:se,view:q,setView:B,container:H,setContainer:K}}var UMt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nje=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,a=e.extensions,l=a===void 0?[]:a,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,x=e.width,O=e.minWidth,w=e.maxWidth,k=e.basicSetup,S=e.placeholder,E=e.indentWithTab,C=e.editable,N=e.readOnly,_=e.root,j=e.initialState,A=bPt(e,UMt),F=p.useRef(null),T=BMt({root:_,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:x,minWidth:O,maxWidth:w,basicSetup:k,placeholder:S,indentWithTab:E,editable:C,readOnly:N,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:j}),P=T.state,R=T.view,L=T.container,M=T.setContainer;p.useImperativeHandle(t,()=>({editor:F.current,state:P,view:R}),[F,L,P,R]);var U=p.useCallback(H=>{F.current=H,M(H)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var I=typeof g=="string"?"cm-theme-"+g:"cm-theme";return o.jsx("div",f8({ref:U,className:""+I+(n?" "+n:"")},A))});nje.displayName="CodeMirror";function ije(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")?[fQ.define(gPt)]:i==="py"||i==="pyi"?[CIt()]:["ts","tsx","mts","cts"].includes(i??"")?[J$({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[J$({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[q_t()]:i==="yaml"||i==="yml"?[nPt()]:["md","markdown"].includes(i??"")?[aRt()]:[]}function zE({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c}){const u=p.useMemo(()=>[...ije(t),...s===1?[]:[X2e({formatNumber:d=>String(d+s-1)})]],[s,t]);return o.jsx(nje,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:u,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const rje=Object.freeze(Object.defineProperty({__proto__:null,default:zE,languageFor:ije},Symbol.toStringTag,{value:"Module"}));function QMt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((a,l)=>l>0&&a.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=vTe(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],CIt=EAe(Y_e,gQ(kIt.concat(EIt)));function V5(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 H5(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 q5=jh.define({name:"python",parser:wIt.configure({props:[Hh.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&V5(e)||e.node;return(t=H5(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=V5(e);return(t=H5(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":hv({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":hv({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":hv({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=V5(e);return(t=n&&H5(e,n))!==null&&t!==void 0?t:e.continue()}}),qh.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":LE,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function TIt(){return new Nm(q5,[q5.data.of({autocomplete:SIt}),q5.data.of({autocomplete:CIt})])}const ay=63,jee=64,AIt=1,_It=2,Z_e=3,NIt=4,J_e=5,jIt=6,RIt=7,eNe=65,IIt=66,PIt=8,DIt=9,MIt=10,LIt=11,$It=12,tNe=13,FIt=19,BIt=20,UIt=29,QIt=33,zIt=34,VIt=47,HIt=0,$Q=1,l8=2,bk=3,c8=4;class Ng{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}Ng.top=new Ng(null,-1,HIt);function qO(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(Ih(r)||r==-1)return n}}function u8(e){return e==32||e==9}function Ih(e){return e==10||e==13}function nNe(e){return u8(e)||Ih(e)}function Vg(e){return e<0||nNe(e)}const qIt=new _I({start:Ng.top,reduce(e,t){return e.type==bk&&(t==BIt||t==zIt)?e.parent:e},shift(e,t,n,i){if(t==Z_e)return new Ng(e,qO(i,i.pos),$Q);if(t==eNe||t==J_e)return new Ng(e,qO(i,i.pos),l8);if(t==ay)return e.parent;if(t==FIt||t==QIt)return new Ng(e,0,bk);if(t==tNe&&e.type==c8)return e.parent;if(t==VIt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Ng(e,e.depth+ +r[0],c8)}return e},hash(e){return e.hash}});function fx(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Vg(e.peek(n+3))}const WIt=new zs((e,t)=>{if(e.next==-1&&t.canShift(jee))return e.acceptToken(jee);let n=e.peek(-1);if((Ih(n)||n<0)&&t.context.type!=bk){if(fx(e,45))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(AIt,3);if(fx(e,46))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(_It,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==bk){e.next==63&&(e.advance(),Vg(e.next)&&e.acceptToken(RIt));return}if(e.next==45)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==$Q&&t.context.depth==qO(e,e.pos-1)?NIt:Z_e);else if(e.next==63)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==l8&&t.context.depth==qO(e,e.pos-1)?jIt:J_e);else{let n=e.pos;for(;;)if(u8(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)iNe(e);else if(e.next==38)d8(e);else if(e.next==42){d8(e);break}else if(e.next==39||e.next==34){if(FQ(e,!0))break;return}else if(e.next==91||e.next==123){if(!XIt(e))return;break}else{rNe(e,!0,!1,0);break}for(;u8(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(UIt))return;let i=e.peek(1);Vg(i)&&e.acceptTokenTo(t.context.type==l8&&t.context.depth==qO(e,n)?IIt:eNe,n)}}},{contextual:!0});function KIt(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 Ree(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Iee(e,t){return e.next==37?(e.advance(),Ree(e.next)&&e.advance(),Ree(e.next)&&e.advance(),!0):KIt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function iNe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Iee(e,!0)){e.next==62&&e.advance();break}}else for(;Iee(e,!1););}function d8(e){for(e.advance();!Vg(e.next)&&ej(e.next)!="f";)e.advance()}function FQ(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(Ih(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function XIt(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(!FQ(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Ih(e.next))return!1;e.advance()}}const YIt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function ej(e){return e<33?"u":e>125?"s":YIt[e-33]}function W5(e,t){let n=ej(e);return n!="u"&&!(t&&n=="f")}function rNe(e,t,n,i){if(ej(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&W5(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;nNe(s);){if(Ih(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?W5(e.peek(a+1),n):s==35?e.peek(a-1)!=32:W5(s,n)))||!n&&l<=i||l==0&&!n&&(fx(e,45,a)||fx(e,46,a)))break;if(t&&ej(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const ZIt=new zs((e,t)=>{if(e.next==33)iNe(e),e.acceptToken($It);else if(e.next==38||e.next==42){let n=e.next==38?MIt:LIt;d8(e),e.acceptToken(n)}else e.next==39||e.next==34?(FQ(e,!1),e.acceptToken(DIt)):rNe(e,!1,t.context.type==bk,t.context.depth)&&e.acceptToken(PIt)}),JIt=new zs((e,t)=>{let n=t.context.type==c8?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(fx(e,45,r)||fx(e,46,r))||!Ih(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:qIt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[ePt],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:[WIt,GIt,ZIt,JIt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),nPt=jh.define({name:"yaml",parser:tPt.configure({props:[Hh.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:hv({closing:"}"}),FlowSequence:hv({closing:"]"})}),qh.add({"FlowMapping FlowSequence":LE,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function iPt(){return new Nm(nPt)}function rPt(e){sNe(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],a=e[r],l=0;l2&&a.token&&typeof a.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var a=0;a{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=UQ(e.state,n.from);return i.line?xPt(e):i.block?OPt(e):!1};function BQ(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 xPt=BQ(EPt,0),wPt=BQ(uNe,0),OPt=BQ((e,t)=>uNe(e,t,kPt(t)),0);function UQ(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const rw=50;function SPt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-rw,i),a=e.sliceDoc(r,r+rw),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(a)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*rw?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+rw),f=e.sliceDoc(r-rw,r));let h=/^\s*/.exec(d)[0].length,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 kPt(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 uNe(e,t,n=t.selection.ranges){let i=n.map(s=>UQ(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>SPt(t,i[a],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,a)=>r[a]?[]:[{from:s.from,insert:i[a].open+" "},{from:s.to,insert:" "+i[a].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let a=0,l;ar&&(s==a||a>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let a=t.changes(s);return{changes:a,selection:t.selection.map(a,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:c}of i)if(l>=0){let u=a.from+l,d=u+c.length;a.text[d-a.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const h8=Jd.define(),CPt=Jd.define(),TPt=Zt.define(),dNe=Zt.define({combine(e){return ef(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),fNe=ro.define({create(){return Nd.empty},update(e,t){let n=t.state.facet(dNe),i=t.annotation(h8);if(i){let c=pl.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=tj(d,d.length,n.minDepth,c):d=mNe(d,t.startState.selection),new Nd(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(CPt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Js.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=pl.fromTransaction(t),a=t.annotation(Js.time),l=t.annotation(Js.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nd(e.done.map(pl.fromJSON),e.undone.map(pl.fromJSON))}});function APt(e={}){return[fNe,dNe.of(e),Ft.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?hNe:t.inputType=="historyRedo"?p8:null;return i?(t.preventDefault(),i(n)):!1}})]}function II(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(fNe,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const hNe=II(0,!1),p8=II(1,!1),_Pt=II(0,!0),NPt=II(1,!0);class pl{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new pl(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new pl(t.changes&&ma.fromJSON(t.changes),[],t.mapped&&Ld.fromJSON(t.mapped),t.startSelection&&it.fromJSON(t.startSelection),t.selectionsAfter.map(it.fromJSON))}static fromTransaction(t,n){let i=Xc;for(let r of t.startState.facet(TPt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new pl(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Xc)}static selection(t){return new pl(void 0,Xc,void 0,void 0,t)}}function tj(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function jPt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,a,l)=>{for(let c=0;c=u&&a<=d&&(i=!0)}}),i}function RPt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function pNe(e,t){return e.length?t.length?e.concat(t):e:t}const Xc=[],IPt=200;function mNe(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-IPt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),tj(e,e.length-1,1e9,n.setSelAfter(i)))}else return[pl.selection([t])]}function PPt(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 G5(e,t){if(!e.length)return e;let n=e.length,i=Xc;for(;n;){let r=DPt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[pl.selection(i)]:Xc}function DPt(e,t,n){let i=pNe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Xc,n);if(!e.changes)return pl.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new pl(r,Fn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const MPt=/^(input\.type|delete)($|\.)/;class Nd{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Nd(this.done,this.undone):this}addChanges(t,n,i,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||MPt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):PI(n,t))}function ko(e){return e.textDirectionAt(e.state.selection.main.head)==Cr.LTR}const bNe=e=>gNe(e,!ko(e)),yNe=e=>gNe(e,ko(e));function vNe(e,t){return Ju(e,n=>n.empty?e.moveByGroup(n,t):PI(n,t))}const $Pt=e=>vNe(e,!ko(e)),FPt=e=>vNe(e,ko(e));function BPt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function DI(e,t,n){let i=Or(e).resolveInner(t.head),r=n?Ln.closedBy:Ln.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;BPt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?_d(e,i.from,1):_d(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,it.cursor(l,n?-1:1)}const UPt=e=>Ju(e,t=>DI(e.state,t,!ko(e))),QPt=e=>Ju(e,t=>DI(e.state,t,ko(e)));function xNe(e,t){return Ju(e,n=>{if(!n.empty)return PI(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const wNe=e=>xNe(e,!1),ONe=e=>xNe(e,!0);function SNe(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):PI(a,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let a=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomkNe(e,!1),m8=e=>kNe(e,!0);function Hm(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=it.cursor(i.from+s))}return r}const zPt=e=>Ju(e,t=>Hm(e,t,!0)),VPt=e=>Ju(e,t=>Hm(e,t,!1)),HPt=e=>Ju(e,t=>Hm(e,t,!ko(e))),qPt=e=>Ju(e,t=>Hm(e,t,ko(e))),WPt=e=>Ju(e,t=>it.cursor(e.lineBlockAt(t.head).from,1)),GPt=e=>Ju(e,t=>it.cursor(e.lineBlockAt(t.head).to,-1));function KPt(e,t,n){let i=!1,r=s1(e.selection,s=>{let a=_d(e,s.head,-1)||_d(e,s.head,1)||s.head>0&&_d(e,s.head-1,1)||s.headKPt(e,t);function lu(e,t,n){let i=s1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=it.range(r.head,r.anchor));let s=n(r);return it.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Zu(e.state,i)),!0)}function ENe(e,t){return lu(e,t,n=>e.moveByChar(n,t))}const CNe=e=>ENe(e,!ko(e)),TNe=e=>ENe(e,ko(e));function ANe(e,t){return lu(e,t,n=>e.moveByGroup(n,t))}const YPt=e=>ANe(e,!ko(e)),ZPt=e=>ANe(e,ko(e)),JPt=e=>{let t=!ko(e);return lu(e,t,n=>DI(e.state,n,t))},eDt=e=>{let t=ko(e);return lu(e,t,n=>DI(e.state,n,t))};function _Ne(e,t){return lu(e,t,n=>e.moveVertically(n,t))}const NNe=e=>_Ne(e,!1),jNe=e=>_Ne(e,!0);function RNe(e,t){return lu(e,t,n=>e.moveVertically(n,t,SNe(e).height))}const Dee=e=>RNe(e,!1),Mee=e=>RNe(e,!0),tDt=e=>lu(e,!0,t=>Hm(e,t,!0)),nDt=e=>lu(e,!1,t=>Hm(e,t,!1)),iDt=e=>{let t=!ko(e);return lu(e,t,n=>Hm(e,n,t))},rDt=e=>{let t=ko(e);return lu(e,t,n=>Hm(e,n,t))},sDt=e=>lu(e,!1,t=>it.cursor(e.lineBlockAt(t.head).from)),aDt=e=>lu(e,!0,t=>it.cursor(e.lineBlockAt(t.head).to)),Lee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:0})),!0),$ee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.doc.length})),!0),Fee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:0})),!0),Bee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),oDt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),lDt=({state:e,dispatch:t})=>{let n=MI(e).map(({from:i,to:r})=>it.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:it.create(n),userEvent:"select"})),!0},cDt=({state:e,dispatch:t})=>{let n=s1(e.selection,i=>{let r=Or(e),s=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&a.next)return it.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Zu(e,n)),!0)};function INe(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(t?a.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heada.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Zu(n,it.create(r,r.length-1))),!0)}const uDt=e=>INe(e,!1),dDt=e=>INe(e,!0),fDt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=it.create([n.main]):n.main.empty||(i=it.create([it.cursor(n.main.head)])),i?(t(Zu(e,i)),!0):!1};function UE(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let c=t(s);ca&&(n="delete.forward",c=h2(e,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=h2(e,a,!1),l=h2(e,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:it.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const PNe=(e,t,n)=>UE(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rPNe(e,!1,!0),DNe=e=>PNe(e,!0,!1),MNe=(e,t)=>UE(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=$a(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=a(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),LNe=e=>MNe(e,!1),hDt=e=>MNe(e,!0),pDt=e=>UE(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headUE(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),gDt=e=>UE(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Gi.of(["",""])},range:it.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},yDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),a=r==s.from?r-1:$a(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:$a(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(a,r))},range:it.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function MI(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let a=t[t.length-1];a.to=s.to,a.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function $Ne(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of MI(e)){if(n?s.to==e.doc.length:s.from==0)continue;let a=e.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){i.push({from:s.to,to:a.to},{from:s.from,insert:a.text+e.lineBreak});for(let c of s.ranges)r.push(it.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:a.from,to:s.from},{from:s.to,insert:e.lineBreak+a.text});for(let c of s.ranges)r.push(it.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:it.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const vDt=({state:e,dispatch:t})=>$Ne(e,t,!1),xDt=({state:e,dispatch:t})=>$Ne(e,t,!0);function FNe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of MI(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const wDt=({state:e,dispatch:t})=>FNe(e,t,!1),ODt=({state:e,dispatch:t})=>FNe(e,t,!0),SDt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(MI(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let a=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function kDt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Or(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(Ln.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Uee=BNe(!1),EDt=BNe(!0);function BNe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:a}=r,l=t.doc.lineAt(s),c=!e&&s==a&&kDt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new TI(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=uQ(u,s);for(d==null&&(d=Uu(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));al.from&&s{let r=[];for(let a=i.from;a<=i.to;){let l=e.doc.lineAt(a);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),a=l.to+1}let s=e.changes(r);return{changes:r,range:it.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const CDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new TI(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=QQ(e,(s,a,l)=>{let c=uQ(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=ok(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(QQ(e,(n,i)=>{i.push({from:n.from,insert:e.facet(i1)})}),{userEvent:"input.indent"})),!0),QNe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(QQ(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Uu(r,e.tabSize),a=0,l=ok(e,Math.max(0,s-Pb(e)));for(;a(e.setTabFocusMode(),!0),ADt=[{key:"Ctrl-b",run:bNe,shift:CNe,preventDefault:!0},{key:"Ctrl-f",run:yNe,shift:TNe},{key:"Ctrl-p",run:wNe,shift:NNe},{key:"Ctrl-n",run:ONe,shift:jNe},{key:"Ctrl-a",run:WPt,shift:sDt},{key:"Ctrl-e",run:GPt,shift:aDt},{key:"Ctrl-d",run:DNe},{key:"Ctrl-h",run:g8},{key:"Ctrl-k",run:pDt},{key:"Ctrl-Alt-h",run:LNe},{key:"Ctrl-o",run:bDt},{key:"Ctrl-t",run:yDt},{key:"Ctrl-v",run:m8}],_Dt=[{key:"ArrowLeft",run:bNe,shift:CNe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:$Pt,shift:YPt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:HPt,shift:iDt,preventDefault:!0},{key:"ArrowRight",run:yNe,shift:TNe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:FPt,shift:ZPt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:qPt,shift:rDt,preventDefault:!0},{key:"ArrowUp",run:wNe,shift:NNe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Lee,shift:Fee},{mac:"Ctrl-ArrowUp",run:Pee,shift:Dee},{key:"ArrowDown",run:ONe,shift:jNe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$ee,shift:Bee},{mac:"Ctrl-ArrowDown",run:m8,shift:Mee},{key:"PageUp",run:Pee,shift:Dee},{key:"PageDown",run:m8,shift:Mee},{key:"Home",run:VPt,shift:nDt,preventDefault:!0},{key:"Mod-Home",run:Lee,shift:Fee},{key:"End",run:zPt,shift:tDt,preventDefault:!0},{key:"Mod-End",run:$ee,shift:Bee},{key:"Enter",run:Uee,shift:Uee},{key:"Mod-a",run:oDt},{key:"Backspace",run:g8,shift:g8,preventDefault:!0},{key:"Delete",run:DNe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:LNe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:hDt,preventDefault:!0},{mac:"Mod-Backspace",run:mDt,preventDefault:!0},{mac:"Mod-Delete",run:gDt,preventDefault:!0}].concat(ADt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),NDt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:UPt,shift:JPt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:QPt,shift:eDt},{key:"Alt-ArrowUp",run:vDt},{key:"Shift-Alt-ArrowUp",run:wDt},{key:"Alt-ArrowDown",run:xDt},{key:"Shift-Alt-ArrowDown",run:ODt},{key:"Mod-Alt-ArrowUp",run:uDt},{key:"Mod-Alt-ArrowDown",run:dDt},{key:"Escape",run:fDt},{key:"Mod-Enter",run:EDt},{key:"Alt-l",mac:"Ctrl-l",run:lDt},{key:"Mod-i",run:cDt,preventDefault:!0},{key:"Mod-[",run:QNe},{key:"Mod-]",run:UNe},{key:"Mod-Alt-\\",run:CDt},{key:"Shift-Mod-k",run:SDt},{key:"Shift-Mod-\\",run:XPt},{key:"Mod-/",run:vPt},{key:"Alt-A",run:wPt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:TDt}].concat(_Dt),jDt={key:"Tab",run:UNe,shift:QNe},Qee=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class hx{constructor(t,n,i=0,r=t.length,s,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Qee(l)):Qee,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ol(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=VU(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=vd(t);let r=this.normalize(n);if(r.length)for(let s=0,a=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,a,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=nj(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new bv(n,t.sliceString(n,i));return K5.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:a}=r;return a>n&&(s=t.sliceString(n,a)+s,a=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=nj(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bv.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(VNe.prototype[Symbol.iterator]=HNe.prototype[Symbol.iterator]=function(){return this});function RDt(e){try{return new RegExp(e,zQ),!0}catch{return!1}}function nj(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const IDt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=VTt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=a,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=it.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Ft.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},PDt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},DDt=Zt.define({combine(e){return ef(e,PDt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function MDt(e){return[UDt,BDt]}const LDt=gn.mark({class:"cm-selectionMatch"}),$Dt=gn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function zee(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=ns.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=ns.Word)}function FDt(e,t,n,i){return e(t.sliceDoc(n,n+1))==ns.Word&&e(t.sliceDoc(i-1,i))==ns.Word}const BDt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(DDt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return gn.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return gn.none;let c=n.wordAt(r.head);if(!c)return gn.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return gn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(zee(a,n,r.from,r.to)&&FDt(a,n,r.from,r.to)))return gn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return gn.none}let l=[];for(let c of e.visibleRanges){let u=new hx(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||zee(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push($Dt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(LDt.range(d,f)),l.length>t.maxMatches))return gn.none}}return gn.set(l)}},{decorations:e=>e.decorations}),UDt=Ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),QDt=({state:e,dispatch:t})=>{let{selection:n}=e,i=it.create(n.ranges.map(r=>e.wordAt(r.head)||it.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function zDt(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let a=!1,l=new hx(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new hx(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),a=!0}else{if(a&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const VDt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return QDt({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=zDt(e,i);return r?(t(e.update({selection:e.selection.addRange(it.range(r.from,r.to),!1),effects:Ft.scrollIntoView(r.to)})),!0):!1},a1=Zt.define({combine(e){return ef(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new rMt(t),scrollToMatch:t=>Ft.scrollIntoView(t)})}});class qNe{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||RDt(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 XDt(this):new WDt(this)}getCursor(t,n=0,i){let r=t.doc?t:Ti.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?ly(this,r,n,i):oy(this,r,n,i)}}class WNe{constructor(t){this.spec=t}}function HDt(e,t,n){return(i,r,s,a)=>{if(n&&!n(i,r,s,a))return!1;let l=i>=a&&r<=a+s.length?s.slice(i-a,r-a):t.doc.sliceString(i,r);return e(l,t,i,r)}}function oy(e,t,n,i){let r;return e.wholeWord&&(r=qDt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=HDt(e.test,t,r)),new hx(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function qDt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=oy(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function GDt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function ly(e,t,n,i){let r;return e.wholeWord&&(r=KDt(t.charCategorizer(t.selection.main.head))),e.test&&(r=GDt(e.test,t,r)),new VNe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function ij(e,t){return e.slice($a(e,t,!1),t)}function rj(e,t){return e.slice(t,$a(e,t))}function KDt(e){return(t,n,i)=>!i[0].length||(e(ij(i.input,i.index))!=ns.Word||e(rj(i.input,i.index))!=ns.Word)&&(e(rj(i.input,i.index+i[0].length))!=ns.Word||e(ij(i.input,i.index+i[0].length))!=ns.Word)}class XDt extends WNe{nextMatch(t,n,i){let r=ly(this.spec,t,i,t.doc.length).next();return r.done&&(r=ly(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),a=ly(this.spec,t,s,i),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=ly(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const yk=Fn.define(),VQ=Fn.define(),sm=ro.define({create(e){return new X5(b8(e).create(),null)},update(e,t){for(let n of t.effects)n.is(yk)?e=new X5(n.value.create(),e.panel):n.is(VQ)&&(e=new X5(e.query,n.value?HQ:null));return e},provide:e=>sk.from(e,t=>t.panel)});class X5{constructor(t,n){this.query=t,this.panel=n}}const YDt=gn.mark({class:"cm-searchMatch"}),ZDt=gn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),JDt=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sm))}update(e){let t=e.state.field(sm);(t!=e.startState.field(sm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return gn.none;let{view:n}=this,i=new Ah;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?ZDt:YDt)})}return i.finish()}},{decorations:e=>e.decorations});function QE(e){return t=>{let n=t.state.field(sm,!1);return n&&n.query.spec.valid?e(t,n):XNe(t)}}const sj=QE((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=it.single(i.from,i.to),s=e.state.facet(a1);return e.dispatch({selection:r,effects:[qQ(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),KNe(e),!0}),aj=QE((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=it.single(r.from,r.to),a=e.state.facet(a1);return e.dispatch({selection:s,effects:[qQ(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),KNe(e),!0}),eMt=QE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:it.create(n.map(i=>it.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),tMt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let l=new hx(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(it.range(l.value.from,l.value.to))}return t(e.update({selection:it.create(s,a),userEvent:"select.search.matches"})),!0},Vee=QE((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let a=s,l=[],c,u,d=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),l.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),d.push(Ft.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let f=e.state.changes(l);return a&&(c=it.single(a.from,a.to).map(f),d.push(qQ(e,a)),d.push(n.facet(a1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),nMt=QE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:a,precise:l}=r;l&&n.push({from:s,to:a,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Ft.announce.of(i),userEvent:"input.replace.all"}),!0});function HQ(e){return e.state.facet(a1).createPanel(e)}function b8(e,t){var n,i,r,s,a;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(a1);return new qNe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(a=t==null?void 0:t.wholeWord)!==null&&a!==void 0?a:u.wholeWord})}function GNe(e){let t=lQ(e,HQ);return t&&t.dom.querySelector("[main-field]")}function KNe(e){let t=GNe(e);t&&t==e.root.activeElement&&t.select()}const XNe=e=>{let t=e.state.field(sm,!1);if(t&&t.panel){let n=GNe(e);if(n&&n!=e.root.activeElement){let i=b8(e.state,t.query.spec);i.valid&&e.dispatch({effects:yk.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[VQ.of(!0),t?yk.of(b8(e.state,t.query.spec)):Fn.appendConfig.of(aMt)]});return!0},YNe=e=>{let t=e.state.field(sm,!1);if(!t||!t.panel)return!1;let n=lQ(e,HQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:VQ.of(!1)}),!0},iMt=[{key:"Mod-f",run:XNe,scope:"editor search-panel"},{key:"F3",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:YNe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tMt},{key:"Mod-Alt-g",run:IDt},{key:"Mod-d",run:VDt,preventDefault:!0}];class rMt{constructor(t){this.view=t;let n=this.query=t.state.field(sm).query.spec;this.commit=this.commit.bind(this),this.searchField=yr("input",{value:n.search,placeholder:Ll(t,"Find"),"aria-label":Ll(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yr("input",{value:n.replace,placeholder:Ll(t,"Replace"),"aria-label":Ll(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>sj(t),[Ll(t,"next")]),i("prev",()=>aj(t),[Ll(t,"previous")]),i("select",()=>eMt(t),[Ll(t,"all")]),yr("label",null,[this.caseField,Ll(t,"match case")]),yr("label",null,[this.reField,Ll(t,"regexp")]),yr("label",null,[this.wordField,Ll(t,"by word")]),...t.state.readOnly?[]:[yr("br"),this.replaceField,i("replace",()=>Vee(t),[Ll(t,"replace")]),i("replaceAll",()=>nMt(t),[Ll(t,"replace all")])],yr("button",{name:"close",onclick:()=>YNe(t),"aria-label":Ll(t,"close"),type:"button"},["×"])])}commit(){let t=new qNe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:yk.of(t)}))}keydown(t){JCt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?aj:sj)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Vee(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(yk)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(a1).top}}function Ll(e,t){return e.state.phrase(t)}const p2=30,m2=/[\s\.,:;?!]/;function qQ(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-p2),a=Math.min(r,n+p2),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-p2;c--)if(!m2.test(l[c-1])&&m2.test(l[c])){l=l.slice(0,c);break}}return Ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const sMt=Ft.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"}}),aMt=[sm,zh.low(JDt),sMt];class Hee{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class jg{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(vk).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),a=new Ah,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((O,w)=>Math.min(O,w.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mO.from||O.to==b))l.push(O),m++,v=Math.min(O.to,v);else{v=Math.min(O.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(O=>O.from==b&&(O.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let O=b-(d+u.value.length);O>0&&(u.next(O),d=b);for(let w=b;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let x=vMt(l);if(y)a.add(b,b,gn.widget({widget:new mMt(x),diagnostics:l.slice()}));else{let O=l.reduce((w,k)=>k.markClass?w+" "+k.markClass:w,"");a.add(b,v,gn.mark({class:"cm-lintRange cm-lintRange-"+x+O,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>v)}))}if(c=v,c==f)break;for(let O=0;O{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new Hee(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Hee(i.from,s,i.diagnostic)}}),i}function oMt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(vk).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(ZNe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function lMt(e,t){return e.field(tc,!1)?t:t.concat(Fn.appendConfig.of(xMt))}const ZNe=Fn.define(),WQ=Fn.define(),JNe=Fn.define(),tc=ro.define({create(){return new jg(gn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=jm(n,e.selected.diagnostic,s)||jm(n,null,s)}!n.size&&r&&t.state.facet(vk).autoPanel&&(r=null),e=new jg(n,r,i)}for(let n of t.effects)if(n.is(ZNe)){let i=t.state.facet(vk).autoPanel?n.value.length?xk.open:null:e.panel;e=jg.init(n.value,i,t.state)}else n.is(WQ)?e=new jg(e.diagnostics,n.value?xk.open:null,e.selected):n.is(JNe)&&(e=new jg(e.diagnostics,e.panel,n.value));return e},provide:e=>[sk.from(e,t=>t.panel),Ft.decorations.from(e,t=>t.diagnostics)]}),cMt=gn.mark({class:"cm-lintRange cm-lintRange-active"});function uMt(e,t,n){let{diagnostics:i}=e.state.field(tc),r,s=-1,a=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(ttje(e,n,!1)))}const fMt=e=>{let t=e.state.field(tc,!1);(!t||!t.panel)&&e.dispatch({effects:lMt(e.state,[WQ.of(!0)])});let n=lQ(e,xk.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qee=e=>{let t=e.state.field(tc,!1);return!t||!t.panel?!1:(e.dispatch({effects:WQ.of(!1)}),!0)},hMt=e=>{let t=e.state.field(tc,!1);if(!t)return!1;let n=e.state.selection.main,i=jm(t.diagnostics,null,n.to+1);return!i&&(i=jm(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),QTt(e,i.from,1,{tooltip:nje,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},pMt=[{key:"Mod-Shift-m",run:fMt,preventDefault:!0},{key:"F8",run:hMt}],vk=Zt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ef(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Wee,tooltipFilter:Wee,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 Wee(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function eje(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 tje(e,t,n){var i;let r=n?eje(t.actions):[];return yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,a)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=jm(e.state.field(tc).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[a]?u.indexOf(r[a]):-1,f=d<0?u:[u.slice(0,d),yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&yr("div",{class:"cm-diagnosticSource"},t.source))}class mMt extends Yu{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Gee{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tje(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class xk{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)qee(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=eje(s.actions);for(let l=0;l{for(let s=0;sqee(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(tc).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(a.has(d))continue;a.add(d);let f=-1,h;for(let 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(tc),i=jm(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:JNe.of(i)})}static open(t){return new xk(t)}}function gMt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function g2(e){return gMt(``,'width="6" height="3"')}const bMt=Ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:g2("#f11")},".cm-lintRange-warning":{backgroundImage:g2("orange")},".cm-lintRange-info":{backgroundImage:g2("#999")},".cm-lintRange-hint":{backgroundImage:g2("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function yMt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function vMt(e){let t="hint",n=1;for(let i of e){let r=yMt(i.severity);r>n&&(n=r,t=i.severity)}return t}const nje=UTt(uMt,{hideOn:oMt}),xMt=[tc,Ft.decorations.compute([tc],e=>{let{selected:t,panel:n}=e.field(tc);return!t||!n||t.from==t.to?gn.none:gn.set([cMt.range(t.from,t.to)])}),nje,bMt];var Kee=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(T_t)),t.defaultKeymap!==!1&&(s=s.concat(NDt)),t.searchKeymap!==!1&&(s=s.concat(iMt)),t.historyKeymap!==!1&&(s=s.concat(LPt)),t.foldKeymap!==!1&&(s=s.concat(j2t)),t.completionKeymap!==!1&&(s=s.concat(PAe)),t.lintKeymap!==!1&&(s=s.concat(pMt));var a=[];return t.lineNumbers!==!1&&a.push(Y2e()),t.highlightActiveLineGutter!==!1&&a.push(i2t()),t.highlightSpecialChars!==!1&&a.push(gTt()),t.history!==!1&&a.push(APt()),t.foldGutter!==!1&&a.push(D2t()),t.drawSelection!==!1&&a.push(sTt()),t.dropCursor!==!1&&a.push(uTt()),t.allowMultipleSelections!==!1&&a.push(Ti.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(S2t()),t.syntaxHighlighting!==!1&&a.push(fAe(F2t,{fallback:!0})),t.bracketMatching!==!1&&a.push(q2t()),t.closeBrackets!==!1&&a.push(S_t()),t.autocompletion!==!1&&a.push(P_t()),t.rectangularSelection!==!1&&a.push(NTt()),r!==!1&&a.push(ITt()),t.highlightActiveLine!==!1&&a.push(OTt()),t.highlightSelectionMatches!==!1&&a.push(MDt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(i1.of(" ".repeat(t.tabSize))),a.concat([n1.of(s.flat())]).filter(Boolean)};const wMt="#e5c07b",Xee="#e06c75",OMt="#56b6c2",SMt="#ffffff",BA="#abb2bf",y8="#7d8799",kMt="#61afef",EMt="#98c379",Yee="#d19a66",CMt="#c678dd",TMt="#21252b",Zee="#2c313a",Jee="#282c34",Y5="#353a42",AMt="#3E4451",ete="#528bff",_Mt=Ft.theme({"&":{color:BA,backgroundColor:Jee},".cm-content":{caretColor:ete},".cm-cursor, .cm-dropCursor":{borderLeftColor:ete},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:AMt},".cm-panels":{backgroundColor:TMt,color:BA},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Jee,color:y8,border:"none"},".cm-activeLineGutter":{backgroundColor:Zee},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Y5},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y5,borderBottomColor:Y5},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Zee,color:BA}}},{dark:!0}),NMt=FE.define([{tag:ne.keyword,color:CMt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:Xee},{tag:[ne.function(ne.variableName),ne.labelName],color:kMt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:Yee},{tag:[ne.definition(ne.name),ne.separator],color:BA},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:wMt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:OMt},{tag:[ne.meta,ne.comment],color:y8},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:y8,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:Xee},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:Yee},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:EMt},{tag:ne.invalid,color:SMt}]),jMt=[_Mt,fAe(NMt)];var RMt=Ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),IMt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,a=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(n1.of([jDt])),g&&(typeof g=="boolean"?b.unshift(Kee()):b.unshift(Kee(g))),h&&b.unshift(CTt(h)),d){case"light":b.push(RMt);break;case"dark":b.push(jMt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push(Ft.editable.of(!1)),c&&b.push(Ti.readOnly.of(!0)),[...b]},PMt=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 DMt{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 tte{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 Z5=null,MMt=()=>typeof window>"u"?new tte:(Z5||(Z5=new tte),Z5),LMt=Ft.theme({"& .cm-scroller":{height:"100% !important"}}),nte=null,J5=null;function $Mt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var a=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return a===nte||(nte=a,J5=Ft.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),J5}var ite=Jd.define(),FMt=200,BMt=[];function UMt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,a=e.onUpdate,l=e.extensions,c=l===void 0?BMt: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,x=e.width,O=x===void 0?null:x,w=e.minWidth,k=w===void 0?null:w,S=e.maxWidth,E=S===void 0?null:S,C=e.placeholder,N=C===void 0?"":C,_=e.editable,j=_===void 0?!0:_,A=e.readOnly,F=A===void 0?!1:A,T=e.indentWithTab,P=T===void 0?!0:T,R=e.basicSetup,L=R===void 0?!0:R,M=e.root,U=e.initialState,I=p.useState(),H=I[0],K=I[1],Q=p.useState(),q=Q[0],B=Q[1],ee=p.useState(),le=ee[0],se=ee[1],re=p.useState(()=>({current:null}))[0],ge=p.useState(()=>({current:null}))[0],W=$Mt(m,b,y,O,k,E),X=Ft.updateListener.of(Oe=>{if(Oe.docChanged&&typeof i=="function"&&!Oe.transactions.some(Le=>Le.annotation(ite))){re.current?re.current.reset():(re.current=new DMt(()=>{if(ge.current){var Le=ge.current;ge.current=null,Le()}re.current=null},FMt),MMt().add(re.current));var ke=Oe.state.doc,st=ke.toString();i(st,Oe)}r&&r(PMt(Oe))}),ae=IMt({theme:f,editable:j,readOnly:F,placeholder:N,indentWithTab:P,basicSetup:L}),ue=[X,...W?[W]:[],LMt,...ae];return a&&typeof a=="function"&&ue.push(Ft.updateListener.of(a)),ue=ue.concat(c),p.useLayoutEffect(()=>{if(H&&!le){var Oe={doc:t,selection:n,extensions:ue},ke=U?Ti.fromJSON(U.json,Oe,U.fields):Ti.create(Oe);if(se(ke),!q){var st=new Ft({state:ke,parent:H,root:M});B(st),s&&s(st,ke)}}return()=>{q&&(se(void 0),B(void 0))}},[H,le]),p.useEffect(()=>{e.container&&K(e.container)},[e.container]),p.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),re.current&&(re.current.cancel(),re.current=null)},[q]),p.useEffect(()=>{u&&q&&q.focus()},[u,q]),p.useEffect(()=>{q&&q.dispatch({effects:Fn.reconfigure.of(ue)})},[f,c,m,b,y,O,k,E,N,j,F,P,L,i,a]),p.useEffect(()=>{if(t!==void 0){var Oe=q?q.state.doc.toString():"";if(q&&t!==Oe){var ke=re.current&&!re.current.isDone,st=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[ite.of(!0)]})};ke?ge.current=st:st()}}},[t,q]),{state:le,setState:se,view:q,setView:B,container:H,setContainer:K}}var QMt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ije=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,a=e.extensions,l=a===void 0?[]:a,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,x=e.width,O=e.minWidth,w=e.maxWidth,k=e.basicSetup,S=e.placeholder,E=e.indentWithTab,C=e.editable,N=e.readOnly,_=e.root,j=e.initialState,A=yPt(e,QMt),F=p.useRef(null),T=UMt({root:_,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:x,minWidth:O,maxWidth:w,basicSetup:k,placeholder:S,indentWithTab:E,editable:C,readOnly:N,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:j}),P=T.state,R=T.view,L=T.container,M=T.setContainer;p.useImperativeHandle(t,()=>({editor:F.current,state:P,view:R}),[F,L,P,R]);var U=p.useCallback(H=>{F.current=H,M(H)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var I=typeof g=="string"?"cm-theme-"+g:"cm-theme";return o.jsx("div",f8({ref:U,className:""+I+(n?" "+n:"")},A))});ije.displayName="CodeMirror";function rje(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")?[fQ.define(bPt)]:i==="py"||i==="pyi"?[TIt()]:["ts","tsx","mts","cts"].includes(i??"")?[J$({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[J$({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[W_t()]:i==="yaml"||i==="yml"?[iPt()]:["md","markdown"].includes(i??"")?[oRt()]:[]}function zE({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c}){const u=p.useMemo(()=>[...rje(t),...s===1?[]:[Y2e({formatNumber:d=>String(d+s-1)})]],[s,t]);return o.jsx(ije,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:u,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const sje=Object.freeze(Object.defineProperty({__proto__:null,default:zE,languageFor:rje},Symbol.toStringTag,{value:"Module"}));function zMt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((a,l)=>l>0&&a.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=xTe(t.slice(1,n).join(` `));if(i.errors.length>0)return{body:e,frontmatter:[]};const r=i.toJS();return!r||typeof r!="object"||Array.isArray(r)?{body:e,frontmatter:[]}:{body:t.slice(n+1).join(` -`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([a,l])=>({key:a,value:typeof l=="string"?l:FU(l).trim()}))}}function zMt(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function VMt(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),o.jsx("path",{d:"M11 2.75v4h4"})]})}function HMt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((a,l)=>{let c=r.children.find(u=>u.name===a);if(!c){const u=s.slice(0,l+1).join("/");c={name:a,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function sje({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>o.jsxs("div",{children:[r.file?o.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[o.jsx(VMt,{}),o.jsx("span",{children:r.name}),o.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):o.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[o.jsx(zMt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(sje,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function qMt(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 aje({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>HMt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[a,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>QMt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return o.jsxs("div",{className:"skill-file-browser",children:[o.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:o.jsx(sje,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),o.jsx("section",{className:"skill-file-preview",children:c?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("span",{title:c.path,children:c.path}),o.jsxs("div",{children:[d?o.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(a==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,o.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>qMt(c),children:t("fileTree.download")})]})]}),o.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?o.jsxs("div",{className:"skill-file-preview__binary",children:[o.jsx("strong",{children:t("fileTree.binaryFile")}),o.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),o.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?o.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&a==="preview"?o.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?o.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>o.jsxs("div",{children:[o.jsx("dt",{children:g.key}),o.jsx("dd",{children:g.value})]},g.key))}):null,o.jsx(Bu,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(zE,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const WMt=1200,GMt=3,oje=2,KMt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,rte={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function ste(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 XMt(e){return e?e.state==="ready"?Ut("generation.stages.ready"):e.state==="failed"?Ut("generation.stages.failed"):e.state==="cancelled"?Ut("generation.stages.cancelled"):e.stage==="validating"?Ut("generation.stages.validating"):e.stage==="packaging"?Ut("generation.stages.packaging"):Ut("generation.stages.generating"):Ut("generation.stages.preparing")}function eL(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>KMt.test(n))}function ate(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([a,l])=>({key:a,value:typeof l=="string"?l:FU(l).trim()}))}}function VMt(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function HMt(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),o.jsx("path",{d:"M11 2.75v4h4"})]})}function qMt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((a,l)=>{let c=r.children.find(u=>u.name===a);if(!c){const u=s.slice(0,l+1).join("/");c={name:a,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function aje({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>o.jsxs("div",{children:[r.file?o.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[o.jsx(HMt,{}),o.jsx("span",{children:r.name}),o.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):o.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[o.jsx(VMt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(aje,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function WMt(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 oje({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>qMt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[a,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>zMt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return o.jsxs("div",{className:"skill-file-browser",children:[o.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:o.jsx(aje,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),o.jsx("section",{className:"skill-file-preview",children:c?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("span",{title:c.path,children:c.path}),o.jsxs("div",{children:[d?o.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(a==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,o.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>WMt(c),children:t("fileTree.download")})]})]}),o.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?o.jsxs("div",{className:"skill-file-preview__binary",children:[o.jsx("strong",{children:t("fileTree.binaryFile")}),o.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),o.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?o.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&a==="preview"?o.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?o.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>o.jsxs("div",{children:[o.jsx("dt",{children:g.key}),o.jsx("dd",{children:g.value})]},g.key))}):null,o.jsx(Bu,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(zE,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const GMt=1200,KMt=3,lje=2,XMt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,rte={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function ste(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 YMt(e){return e?e.state==="ready"?Ut("generation.stages.ready"):e.state==="failed"?Ut("generation.stages.failed"):e.state==="cancelled"?Ut("generation.stages.cancelled"):e.stage==="validating"?Ut("generation.stages.validating"):e.stage==="packaging"?Ut("generation.stages.packaging"):Ut("generation.stages.generating"):Ut("generation.stages.preparing")}function eL(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>XMt.test(n))}function ate(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` `))||e.error||Ut("generation.validation.fallback");return[Ut("generation.validation.repairInstruction"),Ut("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function YMt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return Ut("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return Ut("generation.stages.autoRepairing",{attempt:n,max:oje})}return XMt(e.task)}function ote(){return o.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function ZMt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return Ut("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 Ut("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function JMt(e){return e?e.length>64?Ut("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":Ut("generation.validation.invalidName"):""}function lte(e){return e?e.length>128?Ut("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":Ut("generation.validation.invalidModel"):""}function tL(e){return`${e.region||""}:${e.id}`}function e5t(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function t5t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var _e,Ze,at,wt;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[x,O]=p.useState([]),[w,k]=p.useState([]),[S,E]=p.useState(""),[C,N]=p.useState(!1),[_,j]=p.useState(""),[A,F]=p.useState(""),[T,P]=p.useState(null),[R,L]=p.useState(""),[M,U]=p.useState(""),[I,H]=p.useState(n?tL(n):""),[K,Q]=p.useState(Date.now()),q=p.useRef([]);p.useEffect(()=>{const Se=new AbortController;return sI(Se.signal).then(ve=>{f(ve),O([ste(0,ve)])}).catch(ve=>{Se.signal.aborted||m(ja(ve,Ut("generation.errors.loadCapability")))}),()=>Se.abort()},[]),p.useEffect(()=>{q.current=w},[w]),p.useEffect(()=>{const Se=window.setInterval(()=>Q(Date.now()),1e3);return()=>window.clearInterval(Se)},[]),p.useEffect(()=>{const Se=ve=>{q.current.some(He=>{var Je;return((Je=He.task)==null?void 0:Je.state)==="running"||He.repairing})&&ve.preventDefault()};return window.addEventListener("beforeunload",Se),()=>{var ve;window.removeEventListener("beforeunload",Se);for(const He of q.current)(ve=He.task)!=null&&ve.jobId&&L1t(He.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!w.some(Je=>{var Ce;return((Ce=Je.task)==null?void 0:Ce.state)==="running"||Je.repairing}))return;let Se=!1,ve;const He=async()=>{const Je=q.current,Ce=await Promise.all(Je.map(async Wt=>{var ln;if(((ln=Wt.task)==null?void 0:ln.state)!=="running")return Wt;try{const cn=await P1t(Wt.task.jobId);if(eL(cn)&&(Wt.repairAttempts||0)ot.map(gt=>gt.id===Wt.id?{...gt,task:cn,repairing:!0,repairMode:"auto",repairAttempts:jt,repairError:void 0}:gt));try{const ot=await HM({jobId:cn.jobId,intent:ate(cn),expectedRevision:cn.revision});return{...Wt,task:ot,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:jt,repairError:void 0,error:void 0,pollError:void 0}}catch(ot){return{...Wt,task:cn,repairing:!1,repairMode:void 0,repairAttempts:jt,repairError:ja(ot,Ut("generation.errors.autoRepair")),pollError:void 0}}}let Ot=Wt.artifact;return cn.state==="ready"&&(Ot=await VM(cn.jobId,cn.revision)),{...Wt,task:cn,artifact:Ot,repairing:!1,repairMode:cn.state==="running"?Wt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(cn){return{...Wt,pollError:ja(cn,Ut("generation.errors.pollCandidate"))}}}));Se||(k(Ce),ve=window.setTimeout(()=>void He(),WMt))};return He(),()=>{Se=!0,ve!==void 0&&window.clearTimeout(ve)}},[w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"||Se.repairing})]);const B=w.find(Se=>Se.id===S)||w[0],ee=e==="create"&&!n,le=i.find(Se=>tL(Se)===I)??null,se=n??le,re=i.map(Se=>({value:tL(Se),label:`${Se.name.trim()||u("generation.unnamedSpace")} · ${xh(Se.region||"cn-beijing",t)}`})),ge=JMt(v),W=!!(d!=null&&d.enabled&&g.trim()&&!ge&&x.length>0&&x.every(Se=>Se.model.trim()&&!lte(Se.model.trim()))),X=(Se,ve)=>{O(He=>He.map(Je=>Je.id===Se?{...Je,...ve}:Je))},ae=async Se=>{const ve={...Se,model:Se.model.trim()},He=Se.style==="custom"?Se.customStyle.trim():Se.style;try{const Je=await I1t({operation:e,intent:g.trim(),model:ve.model,style:He,name:v.trim()||void 0,source:a});return{id:Se.id,config:ve,task:Je}}catch(Je){return{id:Se.id,config:ve,error:ja(Je,Ut("generation.errors.createCandidate"))}}},ue=async()=>{if(!W)return;N(!0),P(null);const Se=x.map(He=>({id:He.id,config:He}));k(Se),E(x[0].id);const ve=await Promise.all(x.map(ae));k(ve)},Oe=async Se=>{k(He=>He.map(Je=>Je.id===Se.id?{...Je,error:void 0}:Je));const ve=await ae(Se.config);k(He=>He.map(Je=>Je.id===Se.id?ve:Je))},ke=async()=>{if(!(!(B!=null&&B.task)||!_.trim()||B.task.state!=="ready")){F("refine"),P(null);try{const Se=await HM({jobId:B.task.jobId,intent:_.trim(),expectedRevision:B.task.revision});k(ve=>ve.map(He=>He.id===B.id?{...He,task:Se,artifact:void 0}:He)),j("")}catch(Se){P(ja(Se,Ut("generation.errors.refine")))}finally{F("")}}},st=async()=>{if(!(!(B!=null&&B.task)||!eL(B.task))){F("refine"),P(null),k(Se=>Se.map(ve=>ve.id===B.id?{...ve,repairing:!0,repairMode:"manual",repairError:void 0}:ve));try{const Se=await HM({jobId:B.task.jobId,intent:ate(B.task),expectedRevision:B.task.revision});k(ve=>ve.map(He=>He.id===B.id?{...He,task:Se,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:He))}catch(Se){k(ve=>ve.map(He=>He.id===B.id?{...He,repairing:!1,repairMode:void 0,repairError:ja(Se,Ut("generation.errors.repairAgain"))}:He))}finally{F("")}}},Le=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready"||M)){F("publish"),P(null);try{if(!se)throw new Error(Ut("generation.errors.selectSpace"));const Se=B.artifact||await VM(B.task.jobId,B.task.revision),ve=(a==null?void 0:a.region)||se.region||"";if(!tR(ve))throw new Error(Ut("generation.errors.unsupportedRegion"));await M1t({jobId:B.task.jobId,expectedRevision:B.task.revision,expectedArtifactSha256:Se.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[se.id],projectName:(a==null?void 0:a.projectName)||se.projectName,region:ve,onProgress:He=>L(He.message)}),U(B.id),c()}catch(Se){P(ja(Se,Ut("generation.errors.upload")))}finally{F(""),L("")}}},Me=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready")){F("download");try{const Se=B.artifact||await VM(B.task.jobId,B.task.revision);await $1t(B.task.jobId,B.task.revision,Se.sha256)}catch(Se){P(ja(Se,Ut("generation.errors.download")))}finally{F("")}}},Ie=async()=>{w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"})&&!window.confirm(Ut("generation.leaveConfirmation"))||(await Promise.allSettled(w.flatMap(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"?[D1t({jobId:Se.task.jobId,expectedRevision:Se.task.revision})]:[]})),l())},qe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),Ae=Se=>{var ve;return((ve=d==null?void 0:d.models.find(He=>He.id===Se))==null?void 0:ve.label)||Se},ze=Se=>Se.config.style==="custom"?Se.config.customStyle.trim()||u("generation.styles.customFallback"):u(rte[Se.config.style]),Ee=[...Object.entries(rte).map(([Se,ve])=>({value:Se,label:u(ve)})),{value:"custom",label:u("generation.styles.custom")}],De=Se=>Se.error||Se.repairError?u("generation.stages.failed"):YMt(Se),J=Se=>!Se.error&&!Se.repairError&&(Se.repairing||!Se.task||Se.task.state==="running"),he=w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="ready"});return o.jsxs("section",{className:"skill-generation",children:[o.jsxs("header",{className:"skill-generation__header",children:[o.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void Ie(),"aria-label":u("generation.back"),children:o.jsx(e5t,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:qe}),o.jsx("p",{children:(n==null?void 0:n.name)||u("generation.home")})]}),w.length>0?o.jsx("span",{className:"skill-generation__ttl",children:ZMt(B==null?void 0:B.task,K)}):null]}),C?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:w.map(Se=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(B==null?void 0:B.id)===Se.id,className:(B==null?void 0:B.id)===Se.id?"is-active":"",onClick:()=>E(Se.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(Se)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Ae(Se.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(Se)?o.jsx(ote,{}):null,De(Se)]})]})]},Se.id))}),B?o.jsxs("div",{className:"skill-generation__candidate",children:[o.jsxs("section",{className:"skill-generation__activity",children:[o.jsx("header",{children:o.jsxs("div",{className:"skill-generation__candidate-summary",children:[o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(B)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Ae(B.config.model)})]}),o.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(B)?o.jsx(ote,{}):null,J(B)?o.jsx(xn,{children:De(B)}):De(B)]})]})]})}),B.task?o.jsx(OSt,{activities:B.task.activities}):null,B.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.pollError})}):null,B.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.repairError})}):null,B.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(cl,{error:B.error}),o.jsx("button",{type:"button",onClick:()=>void Oe(B),children:u("generation.retryCandidate")})]}):null,(_e=B.task)!=null&&_e.validation&&!B.task.validation.valid&&!B.repairing&&B.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),B.task.validation.errors.map(Se=>o.jsx("p",{children:Se},Se)),eL(B.task)?o.jsx("button",{type:"button",disabled:!!A,onClick:()=>void st(),children:u("generation.repairAgain")}):null]}):null]}),o.jsxs("section",{className:"skill-generation__files",children:[o.jsxs("header",{children:[o.jsx("h2",{children:u("generation.files")}),((Ze=B.task)==null?void 0:Ze.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void Me(),disabled:!!A,children:u("generation.downloadZip")}):null]}),B.artifact?o.jsx(aje,{files:B.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((at=B.task)==null?void 0:at.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((wt=B.task)==null?void 0:wt.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[ee?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(SA,{label:u("generation.uploadToSpace"),value:I,options:re,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:_,onChange:Se=>j(Se.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!_.trim()||!!A,onClick:()=>void ke(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!M||!se,onClick:()=>void Le(),children:A==="publish"?R||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":ee?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,T?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(cl,{error:T})}):null]}):null,!he&&w.every(Se=>Se.error)?o.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):o.jsxs("div",{className:"skill-generation__setup",children:[o.jsx("div",{className:"skill-generation__section-head is-basic",children:o.jsx("div",{children:o.jsx("strong",{children:u("generation.basicInfo")})})}),o.jsxs("label",{children:[o.jsxs("span",{children:[u("generation.goal"),o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),o.jsx("textarea",{required:!0,value:g,onChange:Se=>b(Se.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:u("generation.skillName")}),o.jsx("input",{value:v,onChange:Se=>y(Se.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ge,"aria-describedby":"skill-name-help"}),ge?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ge}):o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),o.jsx("div",{className:"skill-generation__section-head",children:o.jsxs("div",{children:[o.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),o.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),o.jsxs("div",{className:"skill-generation__groups",children:[x.map((Se,ve)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ve+1})}),x.length>1?o.jsx("button",{type:"button",onClick:()=>O(He=>He.filter(Je=>Je.id!==Se.id)),children:u("generation.remove")}):null]}),o.jsx(SA,{label:u("generation.model"),required:!0,value:Se.model,options:(d==null?void 0:d.models.map(He=>({value:He.id,label:He.label})))||[],onChange:He=>X(Se.id,{model:He}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:lte(Se.model.trim())}),o.jsx(SA,{label:u("generation.style"),required:!0,value:Se.style,options:Ee,onChange:He=>X(Se.id,{style:He})}),Se.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:Se.customStyle,onChange:He=>X(Se.id,{customStyle:He.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},Se.id)),d&&x.lengthO(Se=>[...Se,ste(Se.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:h})}):null,d&&!d.enabled?o.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,o.jsx("div",{className:"skill-generation__setup-actions",children:o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!W,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}function GQ({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 a=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),o.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:o.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("h2",{children:e}),o.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function n5t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await b1t({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(ja(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(GQ,{title:r("management.createSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>a(v.target.value)})]}),o.jsx(SA,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:m})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function i5t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,a]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await y1t({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(ja(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(GQ,{title:r("management.editSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>a(g.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:f})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function r5t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[a,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),x=p.useRef(0),O=p.useRef(null),w=async S=>{const E=x.current+1;if(x.current=E,l(S),u(null),b(null),f(!!S),!!S)try{const C=await w1t(S);x.current===E&&u({name:C.name,fileCount:C.files.length})}catch(C){x.current===E&&b(ja(C,r("management.archiveValidationFailed")))}finally{x.current===E&&f(!1)}},k=async()=>{if(!(!a||!c)){m(!0),b(null);try{await x1t({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(S){b(ja(S,r("management.uploadFailed")))}finally{m(!1)}}};return o.jsxs(GQ,{title:r("management.uploadTitle",{name:e.name}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:O,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var E;return void w(((E=S.target.files)==null?void 0:E[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=O.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var E;S.preventDefault(),y(!1),w(((E=S.dataTransfer.files)==null?void 0:E[0])||null)},children:[o.jsx("strong",{children:a?a.name:r("management.dropzone")}),o.jsx("span",{children:a?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(a.size)}):r("management.chooseLocalFile")})]}),o.jsx("p",{children:r("management.archiveHelp")}),d?o.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?o.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:g})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!a||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function s5t(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 KQ(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=s5t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),a=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return a(r,"second","秒");const l=Math.floor(r/60);if(l<60)return a(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return a(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return a(u,"day","天");const d=Math.floor(u/30);return d<12?a(d,"month","个月"):a(Math.floor(d/12),"year","年")}const a5t=12,cte=12;function oj({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return o.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?o.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const o5t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function lje(e,t){const n=(e||"").trim().toLowerCase();return o5t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function l5t(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 c5t(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 ute(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function zl(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function u5t(e,t){const n=new Map(e.map(i=>[zl(i),i]));for(const i of t)n.set(zl(i),i);return[...n.values()].sort((i,r)=>ute(r.updatedAt)-ute(i.updatedAt))}function d5t(e){const t=e.replace(/\r\n/g,` +`)}function ZMt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return Ut("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return Ut("generation.stages.autoRepairing",{attempt:n,max:lje})}return YMt(e.task)}function ote(){return o.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function JMt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return Ut("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 Ut("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function e5t(e){return e?e.length>64?Ut("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":Ut("generation.validation.invalidName"):""}function lte(e){return e?e.length>128?Ut("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":Ut("generation.validation.invalidModel"):""}function tL(e){return`${e.region||""}:${e.id}`}function t5t(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function n5t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var _e,Ze,at,wt;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[x,O]=p.useState([]),[w,k]=p.useState([]),[S,E]=p.useState(""),[C,N]=p.useState(!1),[_,j]=p.useState(""),[A,F]=p.useState(""),[T,P]=p.useState(null),[R,L]=p.useState(""),[M,U]=p.useState(""),[I,H]=p.useState(n?tL(n):""),[K,Q]=p.useState(Date.now()),q=p.useRef([]);p.useEffect(()=>{const Se=new AbortController;return sI(Se.signal).then(ve=>{f(ve),O([ste(0,ve)])}).catch(ve=>{Se.signal.aborted||m(ja(ve,Ut("generation.errors.loadCapability")))}),()=>Se.abort()},[]),p.useEffect(()=>{q.current=w},[w]),p.useEffect(()=>{const Se=window.setInterval(()=>Q(Date.now()),1e3);return()=>window.clearInterval(Se)},[]),p.useEffect(()=>{const Se=ve=>{q.current.some(He=>{var Je;return((Je=He.task)==null?void 0:Je.state)==="running"||He.repairing})&&ve.preventDefault()};return window.addEventListener("beforeunload",Se),()=>{var ve;window.removeEventListener("beforeunload",Se);for(const He of q.current)(ve=He.task)!=null&&ve.jobId&&$1t(He.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!w.some(Je=>{var Ce;return((Ce=Je.task)==null?void 0:Ce.state)==="running"||Je.repairing}))return;let Se=!1,ve;const He=async()=>{const Je=q.current,Ce=await Promise.all(Je.map(async Wt=>{var ln;if(((ln=Wt.task)==null?void 0:ln.state)!=="running")return Wt;try{const cn=await D1t(Wt.task.jobId);if(eL(cn)&&(Wt.repairAttempts||0)ot.map(gt=>gt.id===Wt.id?{...gt,task:cn,repairing:!0,repairMode:"auto",repairAttempts:jt,repairError:void 0}:gt));try{const ot=await HM({jobId:cn.jobId,intent:ate(cn),expectedRevision:cn.revision});return{...Wt,task:ot,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:jt,repairError:void 0,error:void 0,pollError:void 0}}catch(ot){return{...Wt,task:cn,repairing:!1,repairMode:void 0,repairAttempts:jt,repairError:ja(ot,Ut("generation.errors.autoRepair")),pollError:void 0}}}let Ot=Wt.artifact;return cn.state==="ready"&&(Ot=await VM(cn.jobId,cn.revision)),{...Wt,task:cn,artifact:Ot,repairing:!1,repairMode:cn.state==="running"?Wt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(cn){return{...Wt,pollError:ja(cn,Ut("generation.errors.pollCandidate"))}}}));Se||(k(Ce),ve=window.setTimeout(()=>void He(),GMt))};return He(),()=>{Se=!0,ve!==void 0&&window.clearTimeout(ve)}},[w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"||Se.repairing})]);const B=w.find(Se=>Se.id===S)||w[0],ee=e==="create"&&!n,le=i.find(Se=>tL(Se)===I)??null,se=n??le,re=i.map(Se=>({value:tL(Se),label:`${Se.name.trim()||u("generation.unnamedSpace")} · ${xh(Se.region||"cn-beijing",t)}`})),ge=e5t(v),W=!!(d!=null&&d.enabled&&g.trim()&&!ge&&x.length>0&&x.every(Se=>Se.model.trim()&&!lte(Se.model.trim()))),X=(Se,ve)=>{O(He=>He.map(Je=>Je.id===Se?{...Je,...ve}:Je))},ae=async Se=>{const ve={...Se,model:Se.model.trim()},He=Se.style==="custom"?Se.customStyle.trim():Se.style;try{const Je=await P1t({operation:e,intent:g.trim(),model:ve.model,style:He,name:v.trim()||void 0,source:a});return{id:Se.id,config:ve,task:Je}}catch(Je){return{id:Se.id,config:ve,error:ja(Je,Ut("generation.errors.createCandidate"))}}},ue=async()=>{if(!W)return;N(!0),P(null);const Se=x.map(He=>({id:He.id,config:He}));k(Se),E(x[0].id);const ve=await Promise.all(x.map(ae));k(ve)},Oe=async Se=>{k(He=>He.map(Je=>Je.id===Se.id?{...Je,error:void 0}:Je));const ve=await ae(Se.config);k(He=>He.map(Je=>Je.id===Se.id?ve:Je))},ke=async()=>{if(!(!(B!=null&&B.task)||!_.trim()||B.task.state!=="ready")){F("refine"),P(null);try{const Se=await HM({jobId:B.task.jobId,intent:_.trim(),expectedRevision:B.task.revision});k(ve=>ve.map(He=>He.id===B.id?{...He,task:Se,artifact:void 0}:He)),j("")}catch(Se){P(ja(Se,Ut("generation.errors.refine")))}finally{F("")}}},st=async()=>{if(!(!(B!=null&&B.task)||!eL(B.task))){F("refine"),P(null),k(Se=>Se.map(ve=>ve.id===B.id?{...ve,repairing:!0,repairMode:"manual",repairError:void 0}:ve));try{const Se=await HM({jobId:B.task.jobId,intent:ate(B.task),expectedRevision:B.task.revision});k(ve=>ve.map(He=>He.id===B.id?{...He,task:Se,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:He))}catch(Se){k(ve=>ve.map(He=>He.id===B.id?{...He,repairing:!1,repairMode:void 0,repairError:ja(Se,Ut("generation.errors.repairAgain"))}:He))}finally{F("")}}},Le=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready"||M)){F("publish"),P(null);try{if(!se)throw new Error(Ut("generation.errors.selectSpace"));const Se=B.artifact||await VM(B.task.jobId,B.task.revision),ve=(a==null?void 0:a.region)||se.region||"";if(!tR(ve))throw new Error(Ut("generation.errors.unsupportedRegion"));await L1t({jobId:B.task.jobId,expectedRevision:B.task.revision,expectedArtifactSha256:Se.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[se.id],projectName:(a==null?void 0:a.projectName)||se.projectName,region:ve,onProgress:He=>L(He.message)}),U(B.id),c()}catch(Se){P(ja(Se,Ut("generation.errors.upload")))}finally{F(""),L("")}}},Me=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready")){F("download");try{const Se=B.artifact||await VM(B.task.jobId,B.task.revision);await F1t(B.task.jobId,B.task.revision,Se.sha256)}catch(Se){P(ja(Se,Ut("generation.errors.download")))}finally{F("")}}},Ie=async()=>{w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"})&&!window.confirm(Ut("generation.leaveConfirmation"))||(await Promise.allSettled(w.flatMap(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"?[M1t({jobId:Se.task.jobId,expectedRevision:Se.task.revision})]:[]})),l())},qe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),Ae=Se=>{var ve;return((ve=d==null?void 0:d.models.find(He=>He.id===Se))==null?void 0:ve.label)||Se},ze=Se=>Se.config.style==="custom"?Se.config.customStyle.trim()||u("generation.styles.customFallback"):u(rte[Se.config.style]),Ee=[...Object.entries(rte).map(([Se,ve])=>({value:Se,label:u(ve)})),{value:"custom",label:u("generation.styles.custom")}],De=Se=>Se.error||Se.repairError?u("generation.stages.failed"):ZMt(Se),J=Se=>!Se.error&&!Se.repairError&&(Se.repairing||!Se.task||Se.task.state==="running"),he=w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="ready"});return o.jsxs("section",{className:"skill-generation",children:[o.jsxs("header",{className:"skill-generation__header",children:[o.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void Ie(),"aria-label":u("generation.back"),children:o.jsx(t5t,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:qe}),o.jsx("p",{children:(n==null?void 0:n.name)||u("generation.home")})]}),w.length>0?o.jsx("span",{className:"skill-generation__ttl",children:JMt(B==null?void 0:B.task,K)}):null]}),C?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:w.map(Se=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(B==null?void 0:B.id)===Se.id,className:(B==null?void 0:B.id)===Se.id?"is-active":"",onClick:()=>E(Se.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(Se)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Ae(Se.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(Se)?o.jsx(ote,{}):null,De(Se)]})]})]},Se.id))}),B?o.jsxs("div",{className:"skill-generation__candidate",children:[o.jsxs("section",{className:"skill-generation__activity",children:[o.jsx("header",{children:o.jsxs("div",{className:"skill-generation__candidate-summary",children:[o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(B)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Ae(B.config.model)})]}),o.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(B)?o.jsx(ote,{}):null,J(B)?o.jsx(xn,{children:De(B)}):De(B)]})]})]})}),B.task?o.jsx(SSt,{activities:B.task.activities}):null,B.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.pollError})}):null,B.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.repairError})}):null,B.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(cl,{error:B.error}),o.jsx("button",{type:"button",onClick:()=>void Oe(B),children:u("generation.retryCandidate")})]}):null,(_e=B.task)!=null&&_e.validation&&!B.task.validation.valid&&!B.repairing&&B.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),B.task.validation.errors.map(Se=>o.jsx("p",{children:Se},Se)),eL(B.task)?o.jsx("button",{type:"button",disabled:!!A,onClick:()=>void st(),children:u("generation.repairAgain")}):null]}):null]}),o.jsxs("section",{className:"skill-generation__files",children:[o.jsxs("header",{children:[o.jsx("h2",{children:u("generation.files")}),((Ze=B.task)==null?void 0:Ze.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void Me(),disabled:!!A,children:u("generation.downloadZip")}):null]}),B.artifact?o.jsx(oje,{files:B.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((at=B.task)==null?void 0:at.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((wt=B.task)==null?void 0:wt.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[ee?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(SA,{label:u("generation.uploadToSpace"),value:I,options:re,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:_,onChange:Se=>j(Se.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!_.trim()||!!A,onClick:()=>void ke(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!M||!se,onClick:()=>void Le(),children:A==="publish"?R||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":ee?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,T?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(cl,{error:T})}):null]}):null,!he&&w.every(Se=>Se.error)?o.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):o.jsxs("div",{className:"skill-generation__setup",children:[o.jsx("div",{className:"skill-generation__section-head is-basic",children:o.jsx("div",{children:o.jsx("strong",{children:u("generation.basicInfo")})})}),o.jsxs("label",{children:[o.jsxs("span",{children:[u("generation.goal"),o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),o.jsx("textarea",{required:!0,value:g,onChange:Se=>b(Se.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:u("generation.skillName")}),o.jsx("input",{value:v,onChange:Se=>y(Se.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ge,"aria-describedby":"skill-name-help"}),ge?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ge}):o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),o.jsx("div",{className:"skill-generation__section-head",children:o.jsxs("div",{children:[o.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),o.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),o.jsxs("div",{className:"skill-generation__groups",children:[x.map((Se,ve)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ve+1})}),x.length>1?o.jsx("button",{type:"button",onClick:()=>O(He=>He.filter(Je=>Je.id!==Se.id)),children:u("generation.remove")}):null]}),o.jsx(SA,{label:u("generation.model"),required:!0,value:Se.model,options:(d==null?void 0:d.models.map(He=>({value:He.id,label:He.label})))||[],onChange:He=>X(Se.id,{model:He}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:lte(Se.model.trim())}),o.jsx(SA,{label:u("generation.style"),required:!0,value:Se.style,options:Ee,onChange:He=>X(Se.id,{style:He})}),Se.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:Se.customStyle,onChange:He=>X(Se.id,{customStyle:He.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},Se.id)),d&&x.lengthO(Se=>[...Se,ste(Se.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:h})}):null,d&&!d.enabled?o.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,o.jsx("div",{className:"skill-generation__setup-actions",children:o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!W,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}function GQ({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 a=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),o.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:o.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("h2",{children:e}),o.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function i5t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await y1t({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(ja(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(GQ,{title:r("management.createSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>a(v.target.value)})]}),o.jsx(SA,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:m})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function r5t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,a]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await v1t({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(ja(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(GQ,{title:r("management.editSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>a(g.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:f})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function s5t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[a,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),x=p.useRef(0),O=p.useRef(null),w=async S=>{const E=x.current+1;if(x.current=E,l(S),u(null),b(null),f(!!S),!!S)try{const C=await O1t(S);x.current===E&&u({name:C.name,fileCount:C.files.length})}catch(C){x.current===E&&b(ja(C,r("management.archiveValidationFailed")))}finally{x.current===E&&f(!1)}},k=async()=>{if(!(!a||!c)){m(!0),b(null);try{await w1t({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(S){b(ja(S,r("management.uploadFailed")))}finally{m(!1)}}};return o.jsxs(GQ,{title:r("management.uploadTitle",{name:e.name}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:O,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var E;return void w(((E=S.target.files)==null?void 0:E[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=O.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var E;S.preventDefault(),y(!1),w(((E=S.dataTransfer.files)==null?void 0:E[0])||null)},children:[o.jsx("strong",{children:a?a.name:r("management.dropzone")}),o.jsx("span",{children:a?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(a.size)}):r("management.chooseLocalFile")})]}),o.jsx("p",{children:r("management.archiveHelp")}),d?o.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?o.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:g})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!a||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function a5t(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 KQ(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=a5t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),a=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return a(r,"second","秒");const l=Math.floor(r/60);if(l<60)return a(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return a(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return a(u,"day","天");const d=Math.floor(u/30);return d<12?a(d,"month","个月"):a(Math.floor(d/12),"year","年")}const o5t=12,cte=12;function oj({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return o.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?o.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const l5t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function cje(e,t){const n=(e||"").trim().toLowerCase();return l5t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function c5t(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 u5t(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 ute(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function zl(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function d5t(e,t){const n=new Map(e.map(i=>[zl(i),i]));for(const i of t)n.set(zl(i),i);return[...n.values()].sort((i,r)=>ute(r.updatedAt)-ute(i.updatedAt))}function f5t(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 cje(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function f5t(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function h5t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function dte({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function p5t(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function m5t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:o.jsx(dte,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:o.jsx(dte,{direction:"right"})})]})]})}function g5t({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function nL({kind:e,title:t,description:n,error:i,action:r}){return o.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Title,{children:t}),n?o.jsx(Cn.Description,{children:n}):null,i?o.jsx(cl,{error:i}):null,r?o.jsx(Cn.ActionRow,{children:o.jsx(Ht,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function fte({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return o.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[o.jsxs("div",{className:"skillcenter-space-errors__content",children:[o.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:a})=>o.jsxs("section",{children:[o.jsx("span",{children:xh(s,t)}),o.jsx(cl,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function b5t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,onOptimize:u,onDownload:d,onClose:f}){const{t:h}=Te("ui");return p.useEffect(()=>{const m=g=>{g.key==="Escape"&&f()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[f]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:f,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:m=>m.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsx("div",{className:"skill-detail-heading",children:o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:cje((r==null?void 0:r.description)||e.skillDescription,h)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:d,disabled:s.length===0,children:h("skillCenter.downloadZip")}),o.jsx(oj,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:u,disabled:!c,children:h("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:f,"aria-label":h("skillCenter.closeSkillDetails"),children:o.jsx(f5t,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.version")}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.status")}),o.jsx("dd",{children:lje(e.skillStatus,h)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillSpace")}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("myAgents.region")}),o.jsx("dd",{children:xh(n,i)})]})]}),o.jsxs("div",{className:"skill-detail-content skill-detail-content--files",children:[o.jsx("div",{className:"skill-detail-content-title",children:h("skillCenter.allFiles")}),a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(p5t,{}),h("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(cl,{error:l})}):s.length>0?o.jsx(aje,{files:s.map(m=>m.path.endsWith("SKILL.md")&&m.content?{...m,content:d5t(m.content)}:m)}):o.jsx(g5t,{children:h("skillCenter.noSkillContent")})]})]})})}function y5t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const a=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),o.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:o.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),o.jsx("p",{title:e.name,children:e.name})]}),o.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),o.jsxs("div",{className:"skill-add-dialog__options",children:[o.jsxs("button",{type:"button",onClick:n,children:[o.jsx("strong",{children:s("skillCenter.localUpload")}),o.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),o.jsx(oj,{disabled:!t,placement:"inside",children:o.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[o.jsx("strong",{children:s("skillCenter.autoCreate")}),o.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function v5t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var ht;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState({}),[v,y]=p.useState(!1),[x,O]=p.useState(""),[w,k]=p.useState((r==null?void 0:r.space)??null),[S,E]=p.useState([]),[C,N]=p.useState(1),[_,j]=p.useState(0),[A,F]=p.useState(!1),[T,P]=p.useState(null),[R,L]=p.useState(!1),[M,U]=p.useState(""),[I,H]=p.useState("overview"),[K,Q]=p.useState(null),[q,B]=p.useState(null),[ee,le]=p.useState([]),[se,re]=p.useState(!1),[ge,W]=p.useState(null),[X,ae]=p.useState(null),[ue,Oe]=p.useState(!1),[ke,st]=p.useState(null),[Le,Me]=p.useState(null),[Ie,qe]=p.useState(null),[Ae,ze]=p.useState(0),[Ee,De]=p.useState(0),[J,he]=p.useState(""),[_e,Ze]=p.useState(""),[at,wt]=p.useState(null),[Se,ve]=p.useState(r),He=p.useRef(0),Je=p.useRef(0),Ce=p.useRef(!1),Wt=p.useRef(null),ln=p.useRef(null),cn=p.useRef(null),Ot=p.useDeferredValue(x),jt=p.useDeferredValue(M),gt=(Se&&(w||Se.selectPublishSpace)?Se.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((ht=Se.source)==null?void 0:ht.name)||u("skillCenter.skill")}):"")||(w==null?void 0:w.name)||u("skillCenter.library");p.useEffect(()=>{n&&(a==null||a(gt))},[n,a,gt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const Pe=p.useMemo(()=>{const pe=Ot.trim().toLocaleLowerCase();return pe?h.filter(We=>`${We.name} ${We.description||""} ${We.projectName||""}`.toLocaleLowerCase().includes(pe)):h},[Ot,h]),Et=p.useMemo(()=>{const pe=jt.trim().toLocaleLowerCase();return pe?S.filter(We=>`${We.skillName} ${We.skillDescription||""}`.toLocaleLowerCase().includes(pe)):S},[jt,S]),bt=(w==null?void 0:w.region)||Ji(e),Mt=p.useMemo(()=>f.flatMap(pe=>{var vt;const We=(vt=g[pe])==null?void 0:vt.error;return We?[{region:pe,error:We}]:[]}),[g,f]),$e=f.some(pe=>{const We=g[pe];return!!(We&&!We.done&&!We.error)}),ye=Mt.length===f.length;p.useEffect(()=>{const pe=new AbortController;return sI(pe.signal).then(ae).catch(()=>ae({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>pe.abort()},[u]);const Ue=p.useCallback(async(pe,We)=>{var pn;if(Ce.current||pe.length===0)return;Ce.current=!0,y(!0),We&&((pn=Wt.current)==null||pn.abort(),m([]),b(Object.fromEntries(pe.map(({region:Jt})=>[Jt,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const vt=new AbortController;Wt.current=vt;const vn=++Je.current,Ki=await Promise.allSettled(pe.map(async({region:Jt,page:en})=>({region:Jt,page:en,result:await g1t({region:Jt,page:en,pageSize:a5t,signal:vt.signal})})));if(Je.current!==vn)return;const Fe=Ki.map((Jt,en)=>{const Un=pe[en];return Jt.status==="rejected"?{request:Un,error:ja(Jt.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0}:{request:Un,error:null,items:(Jt.value.result.items||[]).map(wn=>({...wn,region:wn.region||Jt.value.region})),totalCount:Jt.value.result.totalCount||0}}),Pt=Fe.flatMap(Jt=>Jt.items);b(Jt=>{const en={...Jt};return Fe.forEach(({request:Un,error:wn,items:oi,totalCount:Oi})=>{const mi=en[Un.region]||{nextPage:Un.page,loadedCount:0,done:!1,error:null};if(wn){en[Un.region]={...mi,error:wn};return}const bn=mi.loadedCount+oi.length;en[Un.region]={nextPage:Un.page+1,loadedCount:bn,done:oi.length===0||bn>=Oi,error:null}}),en}),m(Jt=>u5t(We?[]:Jt,Pt)),k(Jt=>Jt&&(Pt.find(en=>zl(en)===zl(Jt))||Jt)),Ce.current=!1,y(!1)},[]),Ke=p.useCallback(()=>{if(Ce.current)return;const pe=f.flatMap(We=>{const vt=g[We];return vt&&!vt.done&&!vt.error?[{region:We,page:vt.nextPage}]:[]});Ue(pe,!1)},[Ue,g,f]);p.useEffect(()=>{Rt(),k(null),E([]),N(1)},[e]),p.useEffect(()=>{if(n)return Ue(f.map(pe=>({region:pe,page:1})),!0),()=>{var pe;Je.current+=1,(pe=Wt.current)==null||pe.abort(),Ce.current=!1}},[n,i,Ue,f,Ae]),p.useEffect(()=>{const pe=cn.current,We=ln.current;if(!pe||!We||!$e||v)return;const vt=new IntersectionObserver(([vn])=>{vn.isIntersecting&&Ke()},{root:We,rootMargin:"240px 0px",threshold:.01});return vt.observe(pe),()=>vt.disconnect()},[$e,Ke,v]);const ft=()=>{const pe=ln.current;!pe||!$e||v||pe.scrollHeight-pe.scrollTop-pe.clientHeight<=240&&Ke()};p.useEffect(()=>{if(!w){E([]),j(0),L(!1);return}let pe=!0;return F(!0),P(null),E1t(w.id,{region:bt,page:C,pageSize:cte,project:w.projectName}).then(We=>{pe&&(E(We.items||[]),j(We.totalCount||0),L(We.degraded===!0))}).catch(We=>{pe&&(E([]),j(0),L(!1),P(ja(We,u("skillCenter.errors.loadSkills"))))}).finally(()=>{pe&&F(!1)}),()=>{pe=!1}},[bt,w,C,Ee,u]);const ut=pe=>{Rt(),k(pe),H("overview"),N(1),U("")},Gt=()=>{Rt(),k(null),E([]),j(0),L(!1),H("overview"),N(1),U(""),wt(null)},Rt=()=>{He.current+=1,Q(null),B(null),le([]),W(null),re(!1)},zt=async pe=>{if(!w)return;const We=Fg(pe),vt=He.current+1;He.current=vt,Q(pe),B(null),W(null),re(!0);try{const[vn,Ki]=await Promise.all([C1t(w.id,We,pe.version,bt,w.projectName,pe.skillName,w.name),S1t({spaceId:w.id,skillId:We,version:pe.version,region:bt,skillSpaceName:w.name,skillName:pe.skillName})]);He.current===vt&&(B(vn),le(Ki))}catch(vn){He.current===vt&&W(ja(vn,u("skillCenter.errors.loadSkillDetails")))}finally{He.current===vt&&re(!1)}},Z=pe=>{if(w)return{kind:"skill-center",skillId:Fg(pe),version:pe.version,region:bt,projectName:w.projectName,skillSpaceId:w.id,skillSpaceName:w.name,name:pe.skillName,description:pe.skillDescription}},Bt=pe=>{const We=Z(pe);!We||!(X!=null&&X.enabled)||(Rt(),ve({operation:"optimize",source:We}))},Qe=async pe=>{if(!(!w||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:pe.skillName})))){he(pe.skillId),wt(null);try{await O1t({spaceId:w.id,skillId:pe.skillId,region:bt}),De(We=>We+1),ze(We=>We+1)}catch(We){wt(ja(We,u("skillCenter.errors.deleteSkill")))}finally{he("")}}},tt=async pe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:pe.name})))return;const We=zl(pe);Ze(We),wt(null);try{await v1t({spaceId:pe.id,region:pe.region||Ji(e)}),w&&zl(w)===We&&Gt(),ze(vt=>vt+1)}catch(vt){wt(ja(vt,u("skillCenter.errors.deleteSpace")))}finally{Ze("")}};return Se&&(w||Se.selectPublishSpace)?o.jsx(t5t,{operation:Se.operation,cloudProvider:e,space:w??void 0,availableSpaces:h,spacesLoading:v,initialIntent:Se.initialIntent,source:Se.source,onBack:()=>ve(null),onPublished:()=>{De(pe=>pe+1),ze(pe=>pe+1)}}):o.jsxs("section",{className:`skillcenter${w?" is-space":" resource-collection"}`,children:[w?o.jsx(uE,{className:"skillcenter-detail",title:w.name,description:w.description||u("skillCenter.manageSpaceDescription"),identitySeed:w.name,backLabel:u("skillCenter.backToSpaces"),onBack:Gt,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(jB,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:_})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:w.updatedAt?c5t(w.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:w.name}),children:[o.jsx(BOe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:_}),actions:o.jsx(wm,{"aria-label":u("skillCenter.searchSkills"),value:M,onChange:pe=>U(pe.target.value),placeholder:u("skillCenter.searchSkills")})}),R?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,A&&S.length===0?o.jsx(Ud,{}):T&&S.length===0?o.jsx(nL,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:T,action:{label:u("common.reload"),onClick:()=>De(pe=>pe+1)}}):Et.length===0?o.jsx(nL,{kind:"empty",title:M.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:M.trim()?u("skillCenter.tryAnotherName"):u("skillCenter.emptySkillsDescription"),action:M.trim()?void 0:{label:u("skillCenter.localUpload"),onClick:()=>qe(w)}}):o.jsx("div",{className:"skillcenter-table-wrap",children:o.jsxs("table",{className:"skillcenter-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:u("skillCenter.skills")}),o.jsx("th",{scope:"col",children:u("agentSelector.status")}),o.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),o.jsx("tbody",{children:Et.map(pe=>o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void zt(pe),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:pe.skillName,children:pe.skillName}),pe.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:pe.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:cje(pe.skillDescription,u)})]})}),o.jsx("td",{children:o.jsx("span",{className:`skillcenter-status ${l5t(pe.skillStatus)}`,children:lje(pe.skillStatus,u)})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void zt(pe),children:u("common.view")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsx("button",{type:"button",disabled:!(X!=null&&X.enabled),onClick:()=>Bt(pe),children:u("skillCenter.optimize")})}),pe.lookupByName?null:o.jsx("button",{type:"button",className:"is-danger",disabled:J===pe.skillId,onClick:()=>void Qe(pe),children:J===pe.skillId?u("common.deleting"):u("common.delete")})]})})]},`${Fg(pe)}:${pe.version}`))})]})}),!M.trim()&&!A&&!T&&_>0?o.jsx(m5t,{page:C,total:_,pageSize:cte,onPage:N}):null]})]})}],activeSectionKey:I,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:pe=>H(pe),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>st(w),children:u("skillCenter.editSpace")}),o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:_e===zl(w),onClick:()=>void tt(w),children:_e===zl(w)?u("common.deleting"):u("skillCenter.deleteSpace")}),o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>qe(w),children:u("skillCenter.localUpload")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsxs(Ht,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(X!=null&&X.enabled),onClick:()=>ve({operation:"create"}),children:[o.jsx(xbe,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(wm,{"aria-label":u("skillCenter.searchSpaces"),value:x,onChange:pe=>O(pe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs(Jb,{className:"skillcenter-list-results",ref:ln,"aria-label":u("skillCenter.spaceList"),onScroll:ft,children:[Mt.length>0&&!ye?o.jsx(fte,{errors:Mt,cloudProvider:e,onRetry:()=>ze(pe=>pe+1)}):null,v&&h.length===0?o.jsx(Ud,{}):ye&&h.length===0?o.jsx(fte,{errors:Mt,cloudProvider:e,fullPage:!0,onRetry:()=>ze(pe=>pe+1)}):Pe.length===0&&x.trim()?o.jsx(nL,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):o.jsxs(Vx,{children:[x.trim()?null:o.jsx(Cb,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(h5t,{}),onClick:()=>Oe(!0),children:u("skillCenter.newSpace")}),Pe.map(pe=>{const We=zl(pe);return o.jsx(pE,{className:"skillcenter-space-card",title:pe.name,description:pe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:pe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:KQ(pe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Me(pe)},detailAction:{label:u("common.viewDetails"),onClick:()=>ut(pe)}},We)})]}),!ye&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:cn,"aria-live":"polite",children:v?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):$e?o.jsx("span",{children:u("skillCenter.scrollForMore")}):Mt.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),K&&w&&o.jsx(b5t,{skill:K,space:w,region:bt,cloudProvider:e,detail:q,files:ee,loading:se,error:ge,canOptimize:(X==null?void 0:X.enabled)===!0,onOptimize:()=>Bt(K),onDownload:()=>void k1t({spaceId:w.id,skillId:Fg(K),version:K.version,region:bt,fallbackName:K.skillName,skillSpaceName:w.name,skillName:K.skillName}).catch(pe=>W(ja(pe,u("skillCenter.errors.downloadSkill")))),onClose:Rt}),ue?o.jsx(n5t,{region:t,regionOptions:Iu(e),onClose:()=>Oe(!1),onCreated:pe=>{Oe(!1),ze(We=>We+1),k({...pe,region:pe.region||t})}}):null,ke?o.jsx(i5t,{space:ke,region:ke.region||Ji(e),onClose:()=>st(null),onUpdated:pe=>{const We={...pe,region:pe.region||ke.region||Ji(e)};st(null),k(vt=>vt&&zl(vt)===zl(We)?We:vt),m(vt=>vt.map(vn=>zl(vn)===zl(We)?We:vn)),ze(vt=>vt+1)}}):null,Le?o.jsx(y5t,{space:Le,canUseSandbox:(X==null?void 0:X.enabled)===!0,onClose:()=>Me(null),onUpload:()=>{qe(Le),Me(null)},onSandbox:()=>{const pe=Le;Me(null),ut(pe),ve({operation:"create"})}}):null,Ie?o.jsx(r5t,{space:Ie,region:Ie.region||Ji(e),onClose:()=>qe(null),onUploaded:()=>{qe(null),De(pe=>pe+1),ze(pe=>pe+1)}}):null]})}function x5t(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 w5t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:a,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>x5t(f),[f]),g=f("library.tabs.skills"),b=tR(t)?t:Ji(e),[v,y]=p.useState(b),[x,O]=p.useState(g),w=p.useRef(g),[k,S]=p.useState(!1),[E,C]=p.useState(()=>new Set(["skills",n])),[N,_]=p.useState({skills:0,knowledge:0,artifacts:0}),j=p.useRef(u),[A,F]=p.useState([]),[T,P]=p.useState(!1),[R,L]=p.useState(""),M=p.useMemo(()=>{const le=Qot(l,f("library.untitledSession"));return{key:JSON.stringify(le),candidates:le}},[l,f]),U=p.useRef(M);U.current.key!==M.key&&(U.current=M);const I=U.current.candidates,H=p.useMemo(()=>Iu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const le=w.current;O(se=>se===le?g:se),w.current=g},[g]),p.useEffect(()=>{j.current=u},[u]),p.useEffect(()=>{C(le=>{if(le.has(n))return le;const se=new Set(le);return se.add(n),se})},[n]),p.useEffect(()=>{var se;const le=n==="skills"?x:((se=m.find(re=>re.id===n))==null?void 0:se.label)||f("library.title");r==null||r(le)},[n,r,x,f,m]),p.useEffect(()=>{var le;n==="artifacts"&&((le=j.current)==null||le.call(j))},[n,N.artifacts]);const K=p.useCallback(async()=>{P(!0),L("");try{F(await Yot(I))}catch(le){L(le instanceof Error?le.message:String(le))}finally{P(!1)}},[I]);p.useEffect(()=>{n==="artifacts"&&K()},[n,N.artifacts,K]);const Q=le=>{C(se=>{if(se.has(le))return se;const re=new Set(se);return re.add(le),re}),_(se=>({...se,[le]:se[le]+1})),i(le)},q=o.jsx(dE,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:Q}),B=le=>o.jsx(lN,{id:le,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),ee=n==="skills"?x!==g:n==="knowledge"&&k;return o.jsxs(Th,{className:`library-view${ee?" is-detail":""}`,"aria-label":f("library.title"),children:[ee?null:o.jsx(zx,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[E.has("skills")?o.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:o.jsx(v5t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:N.skills,onPageTitleChange:O,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:B("library-skills-region-filter")})}):null,E.has("knowledge")?o.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:o.jsx(r1t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:N.knowledge,onDetailChange:S,toolbarLeading:q,toolbarFilters:B("library-knowledge-region-filter")})}):null,E.has("artifacts")?o.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:o.jsx(Got,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:N.artifacts,loading:T,error:R?jd(R,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void K(),onEdit:Zot,onDelete:Jot,onDownload:elt,onOpenSource:d?le=>d(le.appName,le.sessionId):void 0,toolbarLeading:q,toolbarFilters:B("library-artifacts-region-filter")})}):null]})]})}const uje="veadk_agentkit_connections",O5t=3e3,hte=6e4;function ku(){try{const e=localStorage.getItem(uje);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function LI(e){try{localStorage.setItem(uje,JSON.stringify(e))}catch{}}function Lu(e,t){return`agentkit:${e}:${t}`}function dje(e){try{return new URL(e).host}catch{return e}}function o1(e){Mbe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)Dbe(Lu(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function fje(e,t,n,i,r,s){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s},l=ku(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,LI(l),o1(l),a}async function S5t(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of Qk(n))try{const h=await Fv(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await J0e(e,f),s=h,a=f;break}}catch(h){if(h instanceof Cx)throw lj(e),h;if(h instanceof Ds&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw lj(e),l||new Ds(V("connections.runtimeUnsupported"),!0,!0);const c=(r==null?void 0:r.trim())||s[0],u=Object.fromEntries(s.map(f=>[f,f===s[0]?c:f])),d=fje(e,t,a,s,u,i);return Lu(d.id,s[0])}function k5t(e){return new Promise(t=>window.setTimeout(t,e))}async function UA(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await S5t(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof Ds)||!a.retryable||l>=hte)throw a;const c=Math.min(O5t,hte-l);await k5t(c)}}async function hje(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await zk(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||dje(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...ku().filter(c=>c.base!==r),a];return LI(l),o1(l),a}function E5t(e){const t=ku().filter(n=>n.id!==e);return LI(t),o1(t),t}function lj(e){const t=ku().filter(n=>n.runtimeId!==e);return LI(t),o1(t),t}function pje(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const a=((l=r.appLabels)==null?void 0:l[s])??s;return{id:Lu(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:dje(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const pte=Object.freeze(Object.defineProperty({__proto__:null,addConnection:hje,addRuntimeConnection:fje,buildAgentEntries:pje,connectRuntime:UA,loadConnections:ku,registerConnections:o1,remoteAppId:Lu,removeConnection:E5t,removeRuntimeConnection:lj},Symbol.toStringTag,{value:"Module"}));function C5t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await hje(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Lu(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),o.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),o.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>a(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),o.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&o.jsx("div",{className:"addagent-error",children:f}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?o.jsx(fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const T5t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,A5t={"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"},_5t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function $I(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?A5t[e.messageCode]:void 0;if(n)return V(n);if(t&&(F7e().toLowerCase()==="zh-cn"||!T5t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const a={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(a)return V(a)}const i=e.phase?_5t[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function N5t(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 j5t=[{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"}]}],R5t={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function Ww(e,t){const n=R5t[e];return n?t(n):e}const mte=["basic","usage","evaluations","optimizations","integrations","versions"],I5t=20;function P5t(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const sw=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function iL(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function D5t(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 gte(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function bte(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 M5t(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function v8(e){return JSON.stringify(e)}function mje(e){return e==="key_auth"?`API_KEY = "" +`,4);return n>=0?t.slice(n+5).trimStart():e}function uje(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function h5t(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function p5t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function dte({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function m5t(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function g5t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:o.jsx(dte,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:o.jsx(dte,{direction:"right"})})]})]})}function b5t({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function nL({kind:e,title:t,description:n,error:i,action:r}){return o.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Title,{children:t}),n?o.jsx(Cn.Description,{children:n}):null,i?o.jsx(cl,{error:i}):null,r?o.jsx(Cn.ActionRow,{children:o.jsx(Ht,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function fte({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return o.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[o.jsxs("div",{className:"skillcenter-space-errors__content",children:[o.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:a})=>o.jsxs("section",{children:[o.jsx("span",{children:xh(s,t)}),o.jsx(cl,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function y5t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,onOptimize:u,onDownload:d,onClose:f}){const{t:h}=Te("ui");return p.useEffect(()=>{const m=g=>{g.key==="Escape"&&f()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[f]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:f,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:m=>m.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsx("div",{className:"skill-detail-heading",children:o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:uje((r==null?void 0:r.description)||e.skillDescription,h)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:d,disabled:s.length===0,children:h("skillCenter.downloadZip")}),o.jsx(oj,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:u,disabled:!c,children:h("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:f,"aria-label":h("skillCenter.closeSkillDetails"),children:o.jsx(h5t,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.version")}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.status")}),o.jsx("dd",{children:cje(e.skillStatus,h)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillSpace")}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("myAgents.region")}),o.jsx("dd",{children:xh(n,i)})]})]}),o.jsxs("div",{className:"skill-detail-content skill-detail-content--files",children:[o.jsx("div",{className:"skill-detail-content-title",children:h("skillCenter.allFiles")}),a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(m5t,{}),h("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(cl,{error:l})}):s.length>0?o.jsx(oje,{files:s.map(m=>m.path.endsWith("SKILL.md")&&m.content?{...m,content:f5t(m.content)}:m)}):o.jsx(b5t,{children:h("skillCenter.noSkillContent")})]})]})})}function v5t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const a=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),o.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:o.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),o.jsx("p",{title:e.name,children:e.name})]}),o.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),o.jsxs("div",{className:"skill-add-dialog__options",children:[o.jsxs("button",{type:"button",onClick:n,children:[o.jsx("strong",{children:s("skillCenter.localUpload")}),o.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),o.jsx(oj,{disabled:!t,placement:"inside",children:o.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[o.jsx("strong",{children:s("skillCenter.autoCreate")}),o.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function x5t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var ht;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState({}),[v,y]=p.useState(!1),[x,O]=p.useState(""),[w,k]=p.useState((r==null?void 0:r.space)??null),[S,E]=p.useState([]),[C,N]=p.useState(1),[_,j]=p.useState(0),[A,F]=p.useState(!1),[T,P]=p.useState(null),[R,L]=p.useState(!1),[M,U]=p.useState(""),[I,H]=p.useState("overview"),[K,Q]=p.useState(null),[q,B]=p.useState(null),[ee,le]=p.useState([]),[se,re]=p.useState(!1),[ge,W]=p.useState(null),[X,ae]=p.useState(null),[ue,Oe]=p.useState(!1),[ke,st]=p.useState(null),[Le,Me]=p.useState(null),[Ie,qe]=p.useState(null),[Ae,ze]=p.useState(0),[Ee,De]=p.useState(0),[J,he]=p.useState(""),[_e,Ze]=p.useState(""),[at,wt]=p.useState(null),[Se,ve]=p.useState(r),He=p.useRef(0),Je=p.useRef(0),Ce=p.useRef(!1),Wt=p.useRef(null),ln=p.useRef(null),cn=p.useRef(null),Ot=p.useDeferredValue(x),jt=p.useDeferredValue(M),gt=(Se&&(w||Se.selectPublishSpace)?Se.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((ht=Se.source)==null?void 0:ht.name)||u("skillCenter.skill")}):"")||(w==null?void 0:w.name)||u("skillCenter.library");p.useEffect(()=>{n&&(a==null||a(gt))},[n,a,gt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const Pe=p.useMemo(()=>{const pe=Ot.trim().toLocaleLowerCase();return pe?h.filter(We=>`${We.name} ${We.description||""} ${We.projectName||""}`.toLocaleLowerCase().includes(pe)):h},[Ot,h]),Et=p.useMemo(()=>{const pe=jt.trim().toLocaleLowerCase();return pe?S.filter(We=>`${We.skillName} ${We.skillDescription||""}`.toLocaleLowerCase().includes(pe)):S},[jt,S]),bt=(w==null?void 0:w.region)||Ji(e),Mt=p.useMemo(()=>f.flatMap(pe=>{var vt;const We=(vt=g[pe])==null?void 0:vt.error;return We?[{region:pe,error:We}]:[]}),[g,f]),$e=f.some(pe=>{const We=g[pe];return!!(We&&!We.done&&!We.error)}),ye=Mt.length===f.length;p.useEffect(()=>{const pe=new AbortController;return sI(pe.signal).then(ae).catch(()=>ae({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>pe.abort()},[u]);const Ue=p.useCallback(async(pe,We)=>{var pn;if(Ce.current||pe.length===0)return;Ce.current=!0,y(!0),We&&((pn=Wt.current)==null||pn.abort(),m([]),b(Object.fromEntries(pe.map(({region:Jt})=>[Jt,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const vt=new AbortController;Wt.current=vt;const vn=++Je.current,Ki=await Promise.allSettled(pe.map(async({region:Jt,page:en})=>({region:Jt,page:en,result:await b1t({region:Jt,page:en,pageSize:o5t,signal:vt.signal})})));if(Je.current!==vn)return;const Fe=Ki.map((Jt,en)=>{const Un=pe[en];return Jt.status==="rejected"?{request:Un,error:ja(Jt.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0}:{request:Un,error:null,items:(Jt.value.result.items||[]).map(wn=>({...wn,region:wn.region||Jt.value.region})),totalCount:Jt.value.result.totalCount||0}}),Pt=Fe.flatMap(Jt=>Jt.items);b(Jt=>{const en={...Jt};return Fe.forEach(({request:Un,error:wn,items:oi,totalCount:Oi})=>{const mi=en[Un.region]||{nextPage:Un.page,loadedCount:0,done:!1,error:null};if(wn){en[Un.region]={...mi,error:wn};return}const bn=mi.loadedCount+oi.length;en[Un.region]={nextPage:Un.page+1,loadedCount:bn,done:oi.length===0||bn>=Oi,error:null}}),en}),m(Jt=>d5t(We?[]:Jt,Pt)),k(Jt=>Jt&&(Pt.find(en=>zl(en)===zl(Jt))||Jt)),Ce.current=!1,y(!1)},[]),Ke=p.useCallback(()=>{if(Ce.current)return;const pe=f.flatMap(We=>{const vt=g[We];return vt&&!vt.done&&!vt.error?[{region:We,page:vt.nextPage}]:[]});Ue(pe,!1)},[Ue,g,f]);p.useEffect(()=>{Rt(),k(null),E([]),N(1)},[e]),p.useEffect(()=>{if(n)return Ue(f.map(pe=>({region:pe,page:1})),!0),()=>{var pe;Je.current+=1,(pe=Wt.current)==null||pe.abort(),Ce.current=!1}},[n,i,Ue,f,Ae]),p.useEffect(()=>{const pe=cn.current,We=ln.current;if(!pe||!We||!$e||v)return;const vt=new IntersectionObserver(([vn])=>{vn.isIntersecting&&Ke()},{root:We,rootMargin:"240px 0px",threshold:.01});return vt.observe(pe),()=>vt.disconnect()},[$e,Ke,v]);const ft=()=>{const pe=ln.current;!pe||!$e||v||pe.scrollHeight-pe.scrollTop-pe.clientHeight<=240&&Ke()};p.useEffect(()=>{if(!w){E([]),j(0),L(!1);return}let pe=!0;return F(!0),P(null),C1t(w.id,{region:bt,page:C,pageSize:cte,project:w.projectName}).then(We=>{pe&&(E(We.items||[]),j(We.totalCount||0),L(We.degraded===!0))}).catch(We=>{pe&&(E([]),j(0),L(!1),P(ja(We,u("skillCenter.errors.loadSkills"))))}).finally(()=>{pe&&F(!1)}),()=>{pe=!1}},[bt,w,C,Ee,u]);const ut=pe=>{Rt(),k(pe),H("overview"),N(1),U("")},Gt=()=>{Rt(),k(null),E([]),j(0),L(!1),H("overview"),N(1),U(""),wt(null)},Rt=()=>{He.current+=1,Q(null),B(null),le([]),W(null),re(!1)},zt=async pe=>{if(!w)return;const We=Fg(pe),vt=He.current+1;He.current=vt,Q(pe),B(null),W(null),re(!0);try{const[vn,Ki]=await Promise.all([T1t(w.id,We,pe.version,bt,w.projectName,pe.skillName,w.name),k1t({spaceId:w.id,skillId:We,version:pe.version,region:bt,skillSpaceName:w.name,skillName:pe.skillName})]);He.current===vt&&(B(vn),le(Ki))}catch(vn){He.current===vt&&W(ja(vn,u("skillCenter.errors.loadSkillDetails")))}finally{He.current===vt&&re(!1)}},Z=pe=>{if(w)return{kind:"skill-center",skillId:Fg(pe),version:pe.version,region:bt,projectName:w.projectName,skillSpaceId:w.id,skillSpaceName:w.name,name:pe.skillName,description:pe.skillDescription}},Bt=pe=>{const We=Z(pe);!We||!(X!=null&&X.enabled)||(Rt(),ve({operation:"optimize",source:We}))},Qe=async pe=>{if(!(!w||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:pe.skillName})))){he(pe.skillId),wt(null);try{await S1t({spaceId:w.id,skillId:pe.skillId,region:bt}),De(We=>We+1),ze(We=>We+1)}catch(We){wt(ja(We,u("skillCenter.errors.deleteSkill")))}finally{he("")}}},tt=async pe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:pe.name})))return;const We=zl(pe);Ze(We),wt(null);try{await x1t({spaceId:pe.id,region:pe.region||Ji(e)}),w&&zl(w)===We&&Gt(),ze(vt=>vt+1)}catch(vt){wt(ja(vt,u("skillCenter.errors.deleteSpace")))}finally{Ze("")}};return Se&&(w||Se.selectPublishSpace)?o.jsx(n5t,{operation:Se.operation,cloudProvider:e,space:w??void 0,availableSpaces:h,spacesLoading:v,initialIntent:Se.initialIntent,source:Se.source,onBack:()=>ve(null),onPublished:()=>{De(pe=>pe+1),ze(pe=>pe+1)}}):o.jsxs("section",{className:`skillcenter${w?" is-space":" resource-collection"}`,children:[w?o.jsx(uE,{className:"skillcenter-detail",title:w.name,description:w.description||u("skillCenter.manageSpaceDescription"),identitySeed:w.name,backLabel:u("skillCenter.backToSpaces"),onBack:Gt,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(jB,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:_})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:w.updatedAt?u5t(w.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:w.name}),children:[o.jsx(UOe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:_}),actions:o.jsx(wm,{"aria-label":u("skillCenter.searchSkills"),value:M,onChange:pe=>U(pe.target.value),placeholder:u("skillCenter.searchSkills")})}),R?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,A&&S.length===0?o.jsx(Ud,{}):T&&S.length===0?o.jsx(nL,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:T,action:{label:u("common.reload"),onClick:()=>De(pe=>pe+1)}}):Et.length===0?o.jsx(nL,{kind:"empty",title:M.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:M.trim()?u("skillCenter.tryAnotherName"):u("skillCenter.emptySkillsDescription"),action:M.trim()?void 0:{label:u("skillCenter.localUpload"),onClick:()=>qe(w)}}):o.jsx("div",{className:"skillcenter-table-wrap",children:o.jsxs("table",{className:"skillcenter-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:u("skillCenter.skills")}),o.jsx("th",{scope:"col",children:u("agentSelector.status")}),o.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),o.jsx("tbody",{children:Et.map(pe=>o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void zt(pe),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:pe.skillName,children:pe.skillName}),pe.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:pe.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:uje(pe.skillDescription,u)})]})}),o.jsx("td",{children:o.jsx("span",{className:`skillcenter-status ${c5t(pe.skillStatus)}`,children:cje(pe.skillStatus,u)})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void zt(pe),children:u("common.view")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsx("button",{type:"button",disabled:!(X!=null&&X.enabled),onClick:()=>Bt(pe),children:u("skillCenter.optimize")})}),pe.lookupByName?null:o.jsx("button",{type:"button",className:"is-danger",disabled:J===pe.skillId,onClick:()=>void Qe(pe),children:J===pe.skillId?u("common.deleting"):u("common.delete")})]})})]},`${Fg(pe)}:${pe.version}`))})]})}),!M.trim()&&!A&&!T&&_>0?o.jsx(g5t,{page:C,total:_,pageSize:cte,onPage:N}):null]})]})}],activeSectionKey:I,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:pe=>H(pe),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>st(w),children:u("skillCenter.editSpace")}),o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:_e===zl(w),onClick:()=>void tt(w),children:_e===zl(w)?u("common.deleting"):u("skillCenter.deleteSpace")}),o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>qe(w),children:u("skillCenter.localUpload")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsxs(Ht,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(X!=null&&X.enabled),onClick:()=>ve({operation:"create"}),children:[o.jsx(wbe,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(wm,{"aria-label":u("skillCenter.searchSpaces"),value:x,onChange:pe=>O(pe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs(Jb,{className:"skillcenter-list-results",ref:ln,"aria-label":u("skillCenter.spaceList"),onScroll:ft,children:[Mt.length>0&&!ye?o.jsx(fte,{errors:Mt,cloudProvider:e,onRetry:()=>ze(pe=>pe+1)}):null,v&&h.length===0?o.jsx(Ud,{}):ye&&h.length===0?o.jsx(fte,{errors:Mt,cloudProvider:e,fullPage:!0,onRetry:()=>ze(pe=>pe+1)}):Pe.length===0&&x.trim()?o.jsx(nL,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):o.jsxs(Vx,{children:[x.trim()?null:o.jsx(Cb,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(p5t,{}),onClick:()=>Oe(!0),children:u("skillCenter.newSpace")}),Pe.map(pe=>{const We=zl(pe);return o.jsx(pE,{className:"skillcenter-space-card",title:pe.name,description:pe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:pe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:KQ(pe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Me(pe)},detailAction:{label:u("common.viewDetails"),onClick:()=>ut(pe)}},We)})]}),!ye&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:cn,"aria-live":"polite",children:v?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):$e?o.jsx("span",{children:u("skillCenter.scrollForMore")}):Mt.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),K&&w&&o.jsx(y5t,{skill:K,space:w,region:bt,cloudProvider:e,detail:q,files:ee,loading:se,error:ge,canOptimize:(X==null?void 0:X.enabled)===!0,onOptimize:()=>Bt(K),onDownload:()=>void E1t({spaceId:w.id,skillId:Fg(K),version:K.version,region:bt,fallbackName:K.skillName,skillSpaceName:w.name,skillName:K.skillName}).catch(pe=>W(ja(pe,u("skillCenter.errors.downloadSkill")))),onClose:Rt}),ue?o.jsx(i5t,{region:t,regionOptions:Iu(e),onClose:()=>Oe(!1),onCreated:pe=>{Oe(!1),ze(We=>We+1),k({...pe,region:pe.region||t})}}):null,ke?o.jsx(r5t,{space:ke,region:ke.region||Ji(e),onClose:()=>st(null),onUpdated:pe=>{const We={...pe,region:pe.region||ke.region||Ji(e)};st(null),k(vt=>vt&&zl(vt)===zl(We)?We:vt),m(vt=>vt.map(vn=>zl(vn)===zl(We)?We:vn)),ze(vt=>vt+1)}}):null,Le?o.jsx(v5t,{space:Le,canUseSandbox:(X==null?void 0:X.enabled)===!0,onClose:()=>Me(null),onUpload:()=>{qe(Le),Me(null)},onSandbox:()=>{const pe=Le;Me(null),ut(pe),ve({operation:"create"})}}):null,Ie?o.jsx(s5t,{space:Ie,region:Ie.region||Ji(e),onClose:()=>qe(null),onUploaded:()=>{qe(null),De(pe=>pe+1),ze(pe=>pe+1)}}):null]})}function w5t(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 O5t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:a,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>w5t(f),[f]),g=f("library.tabs.skills"),b=tR(t)?t:Ji(e),[v,y]=p.useState(b),[x,O]=p.useState(g),w=p.useRef(g),[k,S]=p.useState(!1),[E,C]=p.useState(()=>new Set(["skills",n])),[N,_]=p.useState({skills:0,knowledge:0,artifacts:0}),j=p.useRef(u),[A,F]=p.useState([]),[T,P]=p.useState(!1),[R,L]=p.useState(""),M=p.useMemo(()=>{const le=zot(l,f("library.untitledSession"));return{key:JSON.stringify(le),candidates:le}},[l,f]),U=p.useRef(M);U.current.key!==M.key&&(U.current=M);const I=U.current.candidates,H=p.useMemo(()=>Iu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const le=w.current;O(se=>se===le?g:se),w.current=g},[g]),p.useEffect(()=>{j.current=u},[u]),p.useEffect(()=>{C(le=>{if(le.has(n))return le;const se=new Set(le);return se.add(n),se})},[n]),p.useEffect(()=>{var se;const le=n==="skills"?x:((se=m.find(re=>re.id===n))==null?void 0:se.label)||f("library.title");r==null||r(le)},[n,r,x,f,m]),p.useEffect(()=>{var le;n==="artifacts"&&((le=j.current)==null||le.call(j))},[n,N.artifacts]);const K=p.useCallback(async()=>{P(!0),L("");try{F(await Zot(I))}catch(le){L(le instanceof Error?le.message:String(le))}finally{P(!1)}},[I]);p.useEffect(()=>{n==="artifacts"&&K()},[n,N.artifacts,K]);const Q=le=>{C(se=>{if(se.has(le))return se;const re=new Set(se);return re.add(le),re}),_(se=>({...se,[le]:se[le]+1})),i(le)},q=o.jsx(dE,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:Q}),B=le=>o.jsx(lN,{id:le,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),ee=n==="skills"?x!==g:n==="knowledge"&&k;return o.jsxs(Th,{className:`library-view${ee?" is-detail":""}`,"aria-label":f("library.title"),children:[ee?null:o.jsx(zx,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[E.has("skills")?o.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:o.jsx(x5t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:N.skills,onPageTitleChange:O,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:B("library-skills-region-filter")})}):null,E.has("knowledge")?o.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:o.jsx(s1t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:N.knowledge,onDetailChange:S,toolbarLeading:q,toolbarFilters:B("library-knowledge-region-filter")})}):null,E.has("artifacts")?o.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:o.jsx(Kot,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:N.artifacts,loading:T,error:R?jd(R,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void K(),onEdit:Jot,onDelete:elt,onDownload:tlt,onOpenSource:d?le=>d(le.appName,le.sessionId):void 0,toolbarLeading:q,toolbarFilters:B("library-artifacts-region-filter")})}):null]})]})}const dje="veadk_agentkit_connections",S5t=3e3,hte=6e4;function ku(){try{const e=localStorage.getItem(dje);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function LI(e){try{localStorage.setItem(dje,JSON.stringify(e))}catch{}}function Lu(e,t){return`agentkit:${e}:${t}`}function fje(e){try{return new URL(e).host}catch{return e}}function o1(e){Lbe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)Mbe(Lu(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function hje(e,t,n,i,r,s){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s},l=ku(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,LI(l),o1(l),a}async function k5t(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of Qk(n))try{const h=await Fv(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await eye(e,f),s=h,a=f;break}}catch(h){if(h instanceof Cx)throw lj(e),h;if(h instanceof Ds&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw lj(e),l||new Ds(V("connections.runtimeUnsupported"),!0,!0);const c=(r==null?void 0:r.trim())||s[0],u=Object.fromEntries(s.map(f=>[f,f===s[0]?c:f])),d=hje(e,t,a,s,u,i);return Lu(d.id,s[0])}function E5t(e){return new Promise(t=>window.setTimeout(t,e))}async function UA(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await k5t(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof Ds)||!a.retryable||l>=hte)throw a;const c=Math.min(S5t,hte-l);await E5t(c)}}async function pje(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await zk(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||fje(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...ku().filter(c=>c.base!==r),a];return LI(l),o1(l),a}function C5t(e){const t=ku().filter(n=>n.id!==e);return LI(t),o1(t),t}function lj(e){const t=ku().filter(n=>n.runtimeId!==e);return LI(t),o1(t),t}function mje(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const a=((l=r.appLabels)==null?void 0:l[s])??s;return{id:Lu(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:fje(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const pte=Object.freeze(Object.defineProperty({__proto__:null,addConnection:pje,addRuntimeConnection:hje,buildAgentEntries:mje,connectRuntime:UA,loadConnections:ku,registerConnections:o1,remoteAppId:Lu,removeConnection:C5t,removeRuntimeConnection:lj},Symbol.toStringTag,{value:"Module"}));function T5t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await pje(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Lu(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),o.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),o.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>a(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),o.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&o.jsx("div",{className:"addagent-error",children:f}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?o.jsx(fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const A5t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,_5t={"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"},N5t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function $I(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?_5t[e.messageCode]:void 0;if(n)return V(n);if(t&&(B7e().toLowerCase()==="zh-cn"||!A5t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const a={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(a)return V(a)}const i=e.phase?N5t[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function j5t(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 R5t=[{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"}]}],I5t={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function Ww(e,t){const n=I5t[e];return n?t(n):e}const mte=["basic","usage","evaluations","optimizations","integrations","versions"],P5t=20;function D5t(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const sw=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function iL(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function M5t(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 gte(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function bte(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 L5t(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function v8(e){return JSON.stringify(e)}function gje(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 L5t(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python +HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function $5t(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python import uuid import requests @@ -753,7 +753,7 @@ BASE_URL = ${v8(i)} APP_NAME = ${v8(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${mje(n)} +${gje(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -783,13 +783,13 @@ with requests.post( for line in response.iter_lines(): if line: print(line.decode("utf-8")) -\`\`\``}function $5t(e,t){return`\`\`\`python +\`\`\``}function F5t(e,t){return`\`\`\`python import uuid import requests AGENT_URL = ${v8(e)} -${mje(t)} +${gje(t)} response = requests.post( AGENT_URL, @@ -810,24 +810,24 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function F5t({visible:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function yte({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:a,children:r?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx(F5t,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function vte({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return o.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:i.map(a=>o.jsxs("div",{children:[o.jsx("dt",{children:a.label}),o.jsx("dd",{children:a.value||s("agentWorkspace.notAvailable")})]},a.label))}),n&&r&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:s("agentWorkspace.pythonExample")}),o.jsx(Bu,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function B5t(e,t,n){var i;return CB({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 gje(e){return e?1+e.children.reduce((t,n)=>t+gje(n),0):1}function bje(e){return 1+e.subAgents.reduce((t,n)=>t+bje(n),0)}function x8(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 U5t(e,t,n){const i=x8(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 Q5t(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function z5t(e,t){return t(`agentWorkspace.priority.${e}`)}const V5t={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 H5t(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(V5t[e.module])}function q5t(e,t){return e.find(n=>n.kind===t)}function xte(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>x8(i.createdAt)-x8(n.createdAt))}function W5t(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 G5t(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 K5t(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function yje(e,t){const n=G5t(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(K5t(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function vje(e,t){const n=yje(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function X5t(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 xje({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,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 B5t({visible:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function yte({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:a,children:r?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx(B5t,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function vte({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return o.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:i.map(a=>o.jsxs("div",{children:[o.jsx("dt",{children:a.label}),o.jsx("dd",{children:a.value||s("agentWorkspace.notAvailable")})]},a.label))}),n&&r&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:s("agentWorkspace.pythonExample")}),o.jsx(Bu,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function U5t(e,t,n){var i;return CB({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 bje(e){return e?1+e.children.reduce((t,n)=>t+bje(n),0):1}function yje(e){return 1+e.subAgents.reduce((t,n)=>t+yje(n),0)}function x8(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 Q5t(e,t,n){const i=x8(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 z5t(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function V5t(e,t){return t(`agentWorkspace.priority.${e}`)}const H5t={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 q5t(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(H5t[e.module])}function W5t(e,t){return e.find(n=>n.kind===t)}function xte(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>x8(i.createdAt)-x8(n.createdAt))}function G5t(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 K5t(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 X5t(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function vje(e,t){const n=K5t(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(X5t(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function xje(e,t){const n=vje(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function Y5t(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 wje({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,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(` `),y=d?b:v.slice(-36).join(` -`),x=(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 O=X5t(e.updatedAt,l.resolvedLanguage??l.language),w=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",S=[w,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",k,O].filter(Boolean).join(" · ");async function E(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:n}),o.jsx("span",{children:S})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(C=>!C),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void E(),"aria-label":h?a("agentWorkspace.copiedLabel",{label:r}):a("agentWorkspace.copyLabel",{label:r}),title:h?a("agentWorkspace.copied"):a("agentWorkspace.copyLabel",{label:r}),children:[h?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),o.jsx("span",{children:a(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?o.jsx("pre",{ref:c,children:y}):o.jsx("div",{className:"aw-deploy-log-empty",children:x}))]})}function Y5t({task:e}){var n;const{t}=Te("ui");return o.jsx(xje,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&vje(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function Z5t({task:e}){var n;const{t}=Te("ui");return o.jsx(xje,{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 J5t({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),i=yje(e,n),r=vje(e,n),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),a=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled");return o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?o.jsx(X2,{}):e.status==="running"?o.jsx(fi,{className:"spin"}):e.status==="success"?o.jsx(u7e,{}):e.status==="error"?o.jsx(X2,{}):o.jsx(h4,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:a}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:i.map((l,c)=>{const u=e.status==="success"||cnew Set),[Pt,pn]=p.useState(()=>new Set),[Jt,en]=p.useState(!1),[Un,wn]=p.useState(""),[oi,Oi]=p.useState(null),[mi,bn]=p.useState([]),[qi,ri]=p.useState([]),[zi,as]=p.useState(!1),[Lr,_r]=p.useState(""),[xs,os]=p.useState(""),[ia,Nr]=p.useState(0),[As,Vs]=p.useState([]),[Yr,ra]=p.useState(!1),[sa,ls]=p.useState(""),[va,aa]=p.useState(0),[ws,Ua]=p.useState(null),[oa,Qa]=p.useState(1),[Jn,Ni]=p.useState(!1),[Eo,xa]=p.useState(""),[Xi,Co]=p.useState(0),[xe,Xe]=p.useState(!1),[Yt,tn]=p.useState(()=>new Set),[In,mr]=p.useState(!1),[jr,_s]=p.useState(""),[Si,la]=p.useState(""),[Hs,$r]=p.useState(()=>new Set),wa=p.useRef(!1),cs=p.useRef(""),Vi=p.useRef(null),so=p.useRef(0),ao=p.useRef(0),Go=p.useRef(0),[oo,ed]=p.useState(j5t),[bc,uu]=p.useState("");p.useEffect(()=>{e.length!==0&&ed(te=>te.map((je,Ve)=>Ve===0&&je.agentIds.length===0?{...je,agentIds:e.slice(0,2).map(mt=>mt.id)}:je))},[e]);const To=p.useMemo(()=>{const te=new Map;for(const je of e)je.runtimeId&&te.set(je.runtimeId,je);return te},[e]),yc=p.useMemo(()=>{var je;const te=new Map;for(const Ve of t){const mt=(je=Ve.deploymentTarget)==null?void 0:je.runtimeId;if(!mt||!To.has(mt))continue;const dn=te.get(mt);(!dn||Ve.updatedAt>dn.updatedAt)&&te.set(mt,Ve)}return te},[To,t]),Cl=p.useMemo(()=>{const te=new Map;for(const je of f){if(!je.runtimeId)continue;const Ve=te.get(je.runtimeId);(!Ve||je.startedAt>Ve.startedAt)&&te.set(je.runtimeId,je)}return te},[f]),td=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return te?e.filter(je=>{const Ve=je.runtimeId?yc.get(je.runtimeId):void 0,mt=je.runtimeId?Cl.get(je.runtimeId):void 0;return[je.label,je.app,je.host??"",(Ve==null?void 0:Ve.draft.name)??"",(Ve==null?void 0:Ve.draft.description)??"",(mt==null?void 0:mt.runtimeName)??""].join(" ").toLowerCase().includes(te)}):e},[e,Cl,Ue,yc]),Oa=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return t.filter(je=>{var mt;const Ve=(mt=je.deploymentTarget)==null?void 0:mt.runtimeId;return Ve&&To.has(Ve)?!1:te?`${je.draft.name} ${je.draft.description}`.toLowerCase().includes(te):!0})},[To,t,Ue]),Wh=p.useMemo(()=>t.filter(te=>{var Ve;const je=(Ve=te.deploymentTarget)==null?void 0:Ve.runtimeId;return!je||!To.has(je)}).length,[To,t]),Gh=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return te?oo.filter(je=>je.name.toLowerCase().includes(te)):oo},[oo,Ue]),ce=e.find(te=>te.id===I),li=t.find(te=>te.id===K),ci=h?f.find(te=>te.id===h):void 0,Sa=ce!=null&&ce.runtimeId?yc.get(ce.runtimeId):void 0,Hn=y?ln:I&&r===I?i:null,ji=(Hn==null?void 0:Hn.appName)||(ce==null?void 0:ce.runtimeApp)||(ce==null?void 0:ce.app)||"",vc=(c&&(ce!=null&&ce.runtimeId)?mte:mte.filter(te=>te!=="usage")).map(te=>({id:te,label:T(`agentWorkspace.sections.${te}`)})),du=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"cn-beijing",ji,oa]),us=(ws==null?void 0:ws.requestKey)===du?ws.value:null,Tl=`${(ce==null?void 0:ce.region)??"cn-beijing"}:${(ce==null?void 0:ce.runtimeId)??""}`,xc=(ke==null?void 0:ke.requestKey)===Tl?ke.value:"",Sr=(ee==null?void 0:ee.requestKey)===Tl?ee:null,Qn=!!((f0=Sr==null?void 0:Sr.apiApps)!=null&&f0.length),za=!!(Sr!=null&&Sr.a2a),rf=((rC=Sr==null?void 0:Sr.apiApps)==null?void 0:rC[0])??ji,Al=(q==null?void 0:q.endpoint)??"",be=D5t(((kc=Sr==null?void 0:Sr.a2a)==null?void 0:kc.endpoint)??"",Al),Ye=(ce==null?void 0:ce.runtimeApp)||"",Ct=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"",(ce==null?void 0:ce.currentVersion)??null,Ye]),_n=l&&(ce!=null&&ce.runtimeId)&&ce.region&&$e===0?T4({runtimeId:ce.runtimeId,region:ce.region,appName:Ye,currentVersion:ce.currentVersion}):null,Dt=(Se==null?void 0:Se.requestKey)===Ct?Se.value:_n,fn=Dt!=null&&Dt.reason?jd(Dt.reason,P.resolvedLanguage||P.language):"",On=(Dt==null?void 0:Dt.warnings.filter(te=>jd(te,P.resolvedLanguage||P.language)))??[];p.useEffect(()=>{const te=so.current+1;so.current=te,ve(null),Wt("");const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"";if(!l||!je||!Ve){Je(!1);return}const mt=$e===0?T4({runtimeId:je,region:Ve,appName:Ye,currentVersion:ce==null?void 0:ce.currentVersion}):null;if(mt){ve({requestKey:Ct,value:mt}),Je(!1);return}const dn=new AbortController;let nt,ei=0;const ua=60;Je(!0);const Xn=Ns=>{oR({runtimeId:je,region:Ve,appName:Ye,currentVersion:ce==null?void 0:ce.currentVersion,signal:dn.signal,force:Ns&&$e>0}).then(Ao=>{var oC,Gm;if(te!==so.current)return;const m1=Ao.recoveryStatus==="preparing";if(Ao.runtime.runtimeId!==je||Ao.runtime.region!==Ve||!m1&&Ye&&((oC=Ao.agent)==null?void 0:oC.appName)!==Ye||Ao.canUpdate&&!((Gm=Ao.agent)!=null&&Gm.appName)){Wt(T("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ve({requestKey:Ct,value:Ao}),Je(!1),!!m1){if(ei+=1,ei>=ua){Wt(T("agentWorkspace.errors.updateConfigRestoring"));return}nt=window.setTimeout(()=>Xn(!1),1e3)}}).catch(()=>{te!==so.current||dn.signal.aborted||Wt(T("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{te===so.current&&!dn.signal.aborted&&Je(!1)})};return Xn(!0),()=>{dn.abort(),nt!=null&&window.clearTimeout(nt)}},[l,Ye,$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,Ct]);const Y=p.useMemo(()=>{const te=new Map(e.map((Ve,mt)=>[Ve.id,mt])),je=new Map(n.map((Ve,mt)=>[Ve,mt]));return[...td].sort((Ve,mt)=>{const dn=Ve.runtimeId?Cl.get(Ve.runtimeId):void 0,nt=mt.runtimeId?Cl.get(mt.runtimeId):void 0,ei=(dn==null?void 0:dn.status)==="running"?dn.startedAt:0,ua=(nt==null?void 0:nt.status)==="running"?nt.startedAt:0;if(ei!==ua)return ua-ei;const Xn=je.get(Ve.id),Ns=je.get(mt.id);return Xn!=null&&Ns!=null?Xn-Ns:Xn!=null?-1:Ns!=null?1:(te.get(Ve.id)??0)-(te.get(mt.id)??0)})},[n,e,td,Cl]),we=(ce==null?void 0:ce.label)||(Hn==null?void 0:Hn.name)||(li==null?void 0:li.draft.name)||(ci==null?void 0:ci.agentName)||((sC=ci==null?void 0:ci.agentDraft)==null?void 0:sC.name)||T("agentWorkspace.noAgentSelected"),Ge=oo.find(te=>te.id===bc),_t=Y.filter(te=>te.canDelete===!0),un=Y.filter(te=>Ki.has(te.id)&&te.canDelete===!0),Nn=Oa.filter(te=>Pt.has(te.id)),Yi=_t.length+Oa.length,Ri=un.length+Nn.length,Kn=p.useMemo(()=>{var je;if(ci!=null&&ci.agentDraft)return ci.agentDraft;if(li!=null&&li.draft)return li.draft;const te=(je=ce==null?void 0:ce.region)!=null&&je.startsWith("ap-")?"byteplus":"volcengine";return Dt!=null&&Dt.agent&&(Dt.recoveryStatus==="complete"||Dt.recoveryStatus==="draft-only")?CB(Dt.agent,te,Dt.runtime.configuredEnvKeys):B5t(Hn,ji||(ce==null?void 0:ce.label)||"agent",te)},[Hn,ji,ce==null?void 0:ce.label,ce==null?void 0:ce.region,li==null?void 0:li.draft,ci==null?void 0:ci.agentDraft,Dt]),zn=((Yh=Hn==null?void 0:Hn.draft)==null?void 0:Yh.harnessSidecar)??Lst(q==null?void 0:q.envs),ds=zn?Ux.filter(te=>zn.componentOverrides[te]):[],$n=li?a?"":T("agentWorkspace.errors.noCreatePermission"):l?ce!=null&&ce.runtimeId?ce.region?He?T("agentWorkspace.errors.checkingUpdateConfig"):Ce||(Dt?Dt.recoveryStatus!=="complete"&&Dt.recoveryStatus!=="draft-only"?fn||T("agentWorkspace.errors.originalConfigUnavailable"):Dt.canUpdate?(aC=Dt.agent)!=null&&aC.appName?"":T("agentWorkspace.errors.agentInfoMissing"):fn||T("agentWorkspace.errors.updateUnsupported"):T("agentWorkspace.errors.updateCapabilityPending")):T("agentWorkspace.errors.runtimeRegionMissing"):T("agentWorkspace.errors.cloudOnlyUpdate"):T("agentWorkspace.errors.noManagePermission"),ca="aw-update-disabled-reason",lt=p.useMemo(()=>{if(Hn)return Hn.tools;const te=(Kn.builtinTools??[]).map(je=>{var Ve;return((Ve=Bx.find(mt=>mt.id===je))==null?void 0:Ve.label)??je});return Array.from(new Set([...Kn.tools,...te,...(Kn.customTools??[]).map(je=>je.name),...(Kn.mcpTools??[]).map(je=>je.name)].filter(Boolean)))},[Kn,Hn]),Sn=p.useMemo(()=>Hn?Hn.skillsPreviewSupported?Hn.skills.map(te=>te.name):null:Array.from(new Set([...(Kn.selectedSkills??[]).map(te=>te.name),...Kn.skills].filter(Boolean))),[Kn,Hn]),Qt=p.useMemo(()=>{if(ci)return ci;if(li){const te=f.filter(je=>je.draftId===li.id).sort((je,Ve)=>Ve.startedAt-je.startedAt)[0];return te||f.filter(je=>{var Ve,mt;return((Ve=je.agentDraft)==null?void 0:Ve.name)===li.draft.name||je.agentName===li.draft.name||!!((mt=li.deploymentTarget)!=null&&mt.runtimeId)&&je.runtimeId===li.deploymentTarget.runtimeId}).sort((je,Ve)=>Ve.startedAt-je.startedAt)[0]}if(ce)return f.filter(te=>!!ce.runtimeId&&te.runtimeId===ce.runtimeId||te.agentName===ce.label).sort((te,je)=>je.startedAt-te.startedAt)[0]},[f,ce,li,ci]),si=!!(h&&Qt&&Qt.id===h),fs=!!(Qt&&(Qt.status!=="success"||si)),or=(Qt==null?void 0:Qt.status)==="running",hs=Qt!=null&&Qt.draftId?t.find(te=>te.id===Qt.draftId)??(Qt.agentDraft?{id:Qt.draftId,draft:Qt.agentDraft,updatedAt:Qt.startedAt}:void 0):void 0,wc=p.useMemo(()=>W5t(Kn),[Kn]),Oc=(ce==null?void 0:ce.currentVersion)??(q==null?void 0:q.currentVersion)??null,Kh=Oc??(ci==null?void 0:ci.startedAt)??"unknown",Ko=Hn?`runtime:${(ce==null?void 0:ce.runtimeId)??Hn.name}:v${Kh}:${wc}`:`draft:${(ci==null?void 0:ci.id)??(li==null?void 0:li.id)??(ce==null?void 0:ce.id)??we}:${wc}`;p.useEffect(()=>{M==="usage"&&!c&&U("basic")},[c,M]),p.useEffect(()=>{if(!h)return;const te=f.find(Ve=>Ve.id===h),je=te!=null&&te.runtimeId?To.get(te.runtimeId):void 0;if(je){Q(""),H(je.id),U("basic");return}H(""),Q(""),U("basic")},[To,f,h]),p.useEffect(()=>{if(!m){cs.current="";return}const te=`${m}:${g}:${b}:${c}`;cs.current!==te&&e.some(je=>je.id===m)&&(cs.current=te,Q(""),H(m),U(g==="usage"&&!c?"basic":g),g==="evaluations"&&(ut(b),Rt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const te of Y.slice(0,8)){if(!te.runtimeId)continue;const je=te.region??"cn-beijing";rye(te.runtimeId,je),i0e(te.runtimeId,je,te.runtimeApp??"")}},[Y]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=(ce==null?void 0:ce.runtimeApp)??"",dn=je?n0e(je,Ve,mt):null;if(cn(dn),gt(""),Et(!1),jt(!!dn||!y||!je),!(!y||!je))return YF(je,Ve,mt,{force:!0}).then(nt=>{te||cn(nt)}).catch(nt=>{!te&&!dn&&cn(null),te||(Et(nt instanceof Ds&&nt.unsupported),gt(T("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{te||jt(!0)}),()=>{te=!0}},[y,$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeApp,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing";if(Vs([]),ls(""),M!=="optimizations"||!je){ra(!1);return}if(y&&!ji){ra(!Ot);return}return ra(!0),qbe({runtimeId:je,region:Ve,appName:ji}).then(mt=>{te||Vs(mt.groups)}).catch(()=>{te||ls(T("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{te||ra(!1)}),()=>{te=!0}},[Ot,y,va,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{Qa(1)},[ce==null?void 0:ce.runtimeId,ji]),p.useEffect(()=>{const te=Go.current+1;Go.current=te;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=ji;if(xa(""),M!=="usage"||!je){Ni(!1);return}if(!mt){Ni(y&&!Ot);return}const dn=new AbortController;return Ni(!0),H0e({runtimeId:je,region:Ve,appName:mt,page:oa,pageSize:I5t,signal:dn.signal}).then(nt=>{if(te===Go.current){if(nt.runtimeId!==je||nt.appName!==mt||nt.page!==oa){xa(T("agentWorkspace.errors.usageMismatch"));return}Ua({requestKey:du,value:nt})}}).catch(()=>{te!==Go.current||dn.signal.aborted||xa(T("agentWorkspace.errors.loadUsage"))}).finally(()=>{te===Go.current&&Ni(!1)}),()=>{dn.abort()}},[oa,Xi,du,Ot,y,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{ao.current+=1,st(null),Me(!1),qe(!1),ze(""),Oe("api-server")},[Tl,M]);function fu(){ao.current+=1,st(null),Me(!1),qe(!1),ze("")}function sf(te){te!==ue&&(fu(),Oe(te))}async function af(){if(Le){fu();return}const te=(ce==null?void 0:ce.runtimeId)??"",je=(ce==null?void 0:ce.region)??"cn-beijing";if(!te)return;const Ve=ao.current+1;ao.current=Ve,qe(!0),ze("");try{const mt=await tye(te,je);if(Ve!==ao.current)return;st({requestKey:Tl,value:mt}),Me(!0)}catch(mt){if(Ve!==ao.current)return;st(null),Me(!1),ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.loadApiKey"))}finally{Ve===ao.current&&qe(!1)}}p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=je?iye(je,Ve):null;if(B(mt),Mt(""),!!je)return r7(je,Ve,{force:!0}).then(dn=>{te||B(dn)}).catch(()=>{!te&&!mt&&B(null),te||Mt(T("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{te=!0}},[$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"";if(Ze(""),M!=="versions"||!je){he(!1),je||De(null);return}return he(!0),nA(je).then(Ve=>{te||De(Ve)}).catch(()=>{te||(De(null),Ze(T("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{te||he(!1)}),()=>{te=!0}},[M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=`${Ve}:${je}`;if(W(""),M!=="integrations"||!je){re(!1),je||le(null);return}re(!0);const dn=Fv(je,Ve,{retryProbe:!0}).catch(nt=>{if(nt instanceof Ds&&nt.unsupported)return null;throw nt});return Promise.all([dn,eye(je,Ve,{retryProbe:!0})]).then(([nt,ei])=>{te||le({requestKey:mt,apiApps:nt,a2a:ei})}).catch(()=>{te||(le(null),W(T("agentWorkspace.errors.probeIntegration")))}).finally(()=>{te||re(!1)}),()=>{te=!0}},[X,M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=je&&ji?Wbe({runtimeId:je,region:Ve,appName:ji,pageSize:100}):null;if(bn(mt?xte(mt,T):[]),ri((mt==null?void 0:mt.sets)??[]),_r(""),os((mt==null?void 0:mt.unsupportedMessage)??""),M!=="evaluations"||!je){as(!1);return}if(y&&!ji){as(!Ot);return}return as(!mt),rR({runtimeId:je,region:Ve,appName:ji,pageSize:100},{force:!0}).then(dn=>{te||(ri(dn.sets),bn(xte(dn,T)),os(dn.unsupportedMessage??""))}).catch(()=>{te||(_r(T("agentWorkspace.errors.loadEvaluations")),os(""))}).finally(()=>{te||as(!1)}),()=>{te=!0}},[Ot,y,ia,M,ji,Hn==null?void 0:Hn.appName,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,T]);async function Sc(te){const je=(ce==null?void 0:ce.runtimeId)??"",Ve=te.commitSha??"";if(!(!je||!Ve||at)){wt(Ve),Ze("");try{await M0e({runtimeId:je,targetCommitSha:Ve});const mt=await nA(je);De(mt)}catch(mt){Ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.rollbackVersion"))}finally{wt("")}}}p.useEffect(()=>{const te=new Set(mi.map(je=>je.id));tn(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve}),$r(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve}),Si&&!te.has(Si)&&la("")},[mi,Si]),p.useEffect(()=>{Xe(!1),tn(new Set),$r(new Set),_s(""),la("")},[ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{const te=new Set(Y.filter(je=>je.canDelete===!0).map(je=>je.id));Fe(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve})},[Y]),p.useEffect(()=>{const te=new Set(Oa.map(je=>je.id));pn(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve})},[Oa]);const Xo=p.useMemo(()=>!v||!(ce!=null&&ce.runtimeId)||v.runtimeId!==ce.runtimeId||ji&&v.agentName&&v.agentName!==ji?null:{...v,tag:T(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,ce==null?void 0:ce.runtimeId,ji,T]),lo=p.useMemo(()=>N5t(T),[T]),ka=p.useMemo(()=>ce!=null&&ce.runtimeId?Xo?[Xo,...mi.filter(te=>te.id!==Xo.id&&(!te.messageId||te.messageId!==Xo.messageId))]:mi:lo,[lo,mi,Xo,ce==null?void 0:ce.runtimeId]),_l=ka.filter(te=>{if(te.kind!==ft||(te.source==="auto"?"auto":"user")!==zt)return!1;const Ve=Gt.trim().toLowerCase();return Ve?[te.input,te.output,te.referenceOutput,te.comment,te.tag??"",te.sessionId,te.messageId,te.userId,te.evaluationSetName].join(" ").toLowerCase().includes(Ve):!0}),of=_l.filter(te=>Yt.has(te.id)),qm=!!(ce!=null&&ce.runtimeId),lf=te=>{ut(te),Rt(""),_s("");const je=ka.find(Ve=>Ve.kind===te);la((je==null?void 0:je.id)??""),window.setTimeout(()=>{var Ve;(Ve=Vi.current)==null||Ve.scrollIntoView({behavior:"smooth",block:"start"})},0)},Fr=te=>{_s(""),tn(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve})},cf=()=>{_s(""),tn(new Set(_l.map(te=>te.id)))},eP=()=>{_s(""),tn(new Set),Xe(!1)},Br=te=>{$r(je=>{const Ve=new Set(je);return Ve.has(te)?Ve.delete(te):Ve.add(te),Ve})},l0=te=>{la(te.id),_s(""),!(!te.sessionId||!te.messageId)&&(N==null||N(te))},YE=async te=>{if(!(ce!=null&&ce.runtimeId)||!ji||In||te.length===0)return;const je=te.length===1?T("agentWorkspace.deleteOneCaseConfirm"):T("agentWorkspace.deleteCasesConfirm",{count:te.length});if(!window.confirm(je))return;const Ve=te.map(dn=>dn.id),mt=new Set(Ve);mr(!0),_s("");try{await Xbe({runtimeId:ce.runtimeId,region:ce.region??"cn-beijing",appName:ji,itemIds:Ve});const dn=new Map;for(const nt of te)dn.set(nt.kind,(dn.get(nt.kind)??0)+1);bn(nt=>nt.filter(ei=>!mt.has(ei.id))),ri(nt=>nt.map(ei=>({...ei,itemCount:Math.max(0,ei.itemCount-(dn.get(ei.kind)??0))}))),tn(nt=>new Set([...nt].filter(ei=>!mt.has(ei)))),$r(nt=>new Set([...nt].filter(ei=>!mt.has(ei)))),Si&&mt.has(Si)&&la(""),te.length>1&&Xe(!1),_==null||_(te)}catch(dn){_s(dn instanceof Error?dn.message:String(dn))}finally{mr(!1)}},h1=te=>{ed(je=>je.map(Ve=>Ve.id===te.id?te:Ve))},ZE=()=>{const te=new Set(e.map(mt=>mt.id)),je=n.filter(mt=>te.has(mt)),Ve=new Set(je);return[...je,...e.filter(mt=>!Ve.has(mt.id)).map(mt=>mt.id)]},JE=(te,je,Ve)=>{if(!w||te===je)return;const mt=ZE().filter(ei=>ei!==te),dn=mt.indexOf(je),nt=dn<0?mt.length:Ve==="after"?dn+1:dn;mt.splice(nt,0,te),w(mt)},eC=(te,je)=>{if(!Bt||Bt===je)return;const Ve=te.currentTarget.getBoundingClientRect();ht(je),We(te.clientY>Ve.top+Ve.height/2?"after":"before")},Wm=(te,je)=>{if(!w)return;const Ve=ZE(),mt=Ve.indexOf(te),dn=Math.max(0,Math.min(Ve.length-1,mt+je));mt<0||mt===dn||(Ve.splice(mt,1),Ve.splice(dn,0,te),w(Ve))},c0=te=>{te.canDelete===!0&&(wn(""),Fe(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve}))},tC=te=>{wn(""),pn(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve})},nC=()=>{wn(""),Fe(new Set(_t.map(te=>te.id))),pn(new Set(Oa.map(te=>te.id)))},Lt=()=>{wn(""),Fe(new Set),pn(new Set),vn(!1)},u0=()=>{if(Ri===0||Jt)return;const te=un.length,je=Nn.length;wn(""),Oi({kind:"selection",title:T(te===1&&je===0?"agentWorkspace.deleteAgentTitle":te===0&&je===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:te===1&&je===0?T("agentWorkspace.deleteAgentDescription",{name:un[0].label}):te===0&&je===1?T("agentWorkspace.deleteDraftDescription",{name:Nn[0].draft.name||T("agentSelector.unnamedAgent")}):T("agentWorkspace.deleteSelectionDescription",{count:Ri,warning:te>0?T("agentWorkspace.runtimeDeletionWarning",{count:te}):T("agentWorkspace.draftDeletionWarning")}),confirmLabel:T(te===0&&je===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:un,drafts:Nn})},p1=async()=>{if(!(!oi||Jt)){en(!0),wn("");try{if(oi.kind==="selection"){const{agents:te,drafts:je}=oi;if(te.length>0){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k(te)}je.length>0&&(S==null||S(je)),Fe(new Set),pn(new Set),vn(!1),te.some(Ve=>Ve.id===I)&&H(""),je.some(Ve=>Ve.id===K)&&Q("")}else if(oi.kind==="agent"){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k([oi.agent]),I===oi.agent.id&&H("")}else{if(!S)throw new Error(T("agentWorkspace.errors.deleteDraftUnsupported"));S([oi.draft]),K===oi.draft.id&&Q("")}Oi(null)}catch(te){wn(te instanceof Error?te.message:String(te))}finally{en(!1)}}},d0=te=>{!k||te.canDelete!==!0||Jt||(wn(""),Oi({kind:"agent",title:T("agentWorkspace.deleteAgentTitle"),description:T("agentWorkspace.deleteAgentDescription",{name:te.label}),confirmLabel:T("agentWorkspace.deleteAgent"),agent:te}))},Wi=te=>{if(!S||Jt)return;const je=te.draft.name||T("agentSelector.unnamedAgent");wn(""),Oi({kind:"draft",title:T("myAgents.deleteDraftTitle"),description:T("agentWorkspace.deleteDraftDescription",{name:je}),confirmLabel:T("myAgents.deleteDraft"),draft:te})},Xh=()=>{const te=`eval-${Date.now()}`,je={id:te,name:T("agentWorkspace.newEvaluationGroupName",{count:oo.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};ed(Ve=>[je,...Ve]),uu(te)},iC=te=>{h1({...te,history:[{id:`run-${Date.now()}`,createdAt:T("agentWorkspace.evaluationDefaults.justNow"),score:86+te.history.length%7,status:"completed"},...te.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${y?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":T("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:R==="library"?"is-active":"","aria-pressed":R==="library",onClick:()=>{L("library"),Ke("")},children:T("agentWorkspace.library")}),o.jsx("button",{type:"button",className:R==="evaluation"?"is-active":"","aria-pressed":R==="evaluation",onClick:()=>{L("evaluation"),Ke("")},children:T("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":R==="evaluation"||void 0,ref:te=>{te==null||te.toggleAttribute("inert",R==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":T(R==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{value:Ue,onChange:te=>Ke(te.currentTarget.value),placeholder:T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:R==="library"?j:Xh,disabled:R==="library"&&!a,children:[o.jsx(Fo,{"aria-hidden":!0}),o.jsx("span",{children:T(R==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),R==="library"&&(k||S)&&o.jsx("div",{className:`aw-selection-toolbar${vt?" is-active":""}`,children:vt?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCount",{count:Ri})}),o.jsx("button",{type:"button",onClick:nC,disabled:Yi===0||Jt,children:T("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void u0(),disabled:Ri===0||Jt,children:T(Jt?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:Lt,disabled:Jt,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{wn(""),vn(!0)},disabled:Yi===0,children:T("common.select")})}),R==="library"&&Un&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Un}),o.jsx("div",{className:"aw-agent-list",children:R==="evaluation"?Gh.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.noMatchingEvaluationGroups")}):Gh.map(te=>o.jsxs("button",{type:"button",className:`aw-agent-item${te.id===bc?" is-active":""}`,onClick:()=>uu(te.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:Ww(te.name,T)}),o.jsx("small",{children:T("agentWorkspace.groupStats",{agents:te.agentIds.length,runs:te.history.length})})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)):u&&Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.loadingCloudAgents")}):d&&Y.length===0&&Oa.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),O&&o.jsx("button",{type:"button",onClick:O,children:T("common.retry")})]}):Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Oa.map(te=>{const Ve=f.filter(dn=>dn.draftId===te.id).sort((dn,nt)=>nt.startedAt-dn.startedAt)[0]??f.filter(dn=>{var nt,ei;return((nt=dn.agentDraft)==null?void 0:nt.name)===te.draft.name||dn.agentName===te.draft.name||!!((ei=te.deploymentTarget)!=null&&ei.runtimeId)&&dn.runtimeId===te.deploymentTarget.runtimeId}).sort((dn,nt)=>nt.startedAt-dn.startedAt)[0],mt=Pt.has(te.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",vt?"is-selecting":"",mt?"is-selected-for-delete":"",te.id===K?"is-active":""].filter(Boolean).join(" "),"aria-pressed":vt?mt:void 0,onClick:()=>{if(vt){tC(te);return}H(""),Q(te.id),U("basic")},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:te.draft.name||T("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(Ve==null?void 0:Ve.status)==="running"?" is-deploying":""}`,children:(Ve==null?void 0:Ve.status)==="running"?T("myAgents.deploying"):T("myAgents.draft")})]}),o.jsx("small",{children:te.deploymentTarget?T("agentWorkspace.updatePending"):T("agentWorkspace.notPublished")})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)}),Y.map(te=>{const je=te.runtimeId?Cl.get(te.runtimeId):void 0,Ve=te.runtimeId?yc.get(te.runtimeId):void 0,mt=Ki.has(te.id),dn=te.canDelete===!0,nt=(je==null?void 0:je.status)==="running"?{label:T("myAgents.deploying"),className:" is-deploying"}:(je==null?void 0:je.status)==="error"?{label:T("agentWorkspace.failed"),className:" is-error"}:(je==null?void 0:je.status)==="cancelled"?{label:T("agentWorkspace.cancelled"),className:" is-muted"}:Ve?{label:T("agentWorkspace.updatePending"),className:""}:null,ei=(je==null?void 0:je.status)==="running"?T("agentWorkspace.updatingDeployment"):Ve?T("agentWorkspace.updatePending"):te.remote?te.host||T("agentWorkspace.remoteAgent"):T("agentWorkspace.localAgent"),ua=["aw-agent-item","aw-agent-item--sortable",te.id===I?"is-active":"",vt?"is-selecting":"",mt?"is-selected-for-delete":"",vt&&!dn?"is-selection-disabled":"",te.id===Bt?"is-dragging":"",te.id===tt&&te.id!==Bt?`is-drop-target is-drop-${pe}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!w&&!vt,className:ua,"aria-pressed":vt?mt:void 0,"aria-keyshortcuts":w?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Xn=>{w&&(wa.current=!0,Qe(te.id),Xn.dataTransfer.effectAllowed="move",Xn.dataTransfer.setData("text/plain",te.id))},onDragEnter:Xn=>{eC(Xn,te.id)},onDragOver:Xn=>{!Bt||Bt===te.id||(Xn.preventDefault(),Xn.dataTransfer.dropEffect="move",eC(Xn,te.id))},onDragLeave:Xn=>{const Ns=Xn.relatedTarget;Ns instanceof Node&&Xn.currentTarget.contains(Ns)||tt===te.id&&ht("")},onDrop:Xn=>{Xn.preventDefault();const Ns=Xn.dataTransfer.getData("text/plain")||Bt;JE(Ns,te.id,pe),Qe(""),ht(""),We("before")},onDragEnd:()=>{Qe(""),ht(""),We("before"),window.setTimeout(()=>{wa.current=!1},0)},onKeyDown:Xn=>{Xn.altKey&&(Xn.key==="ArrowUp"?(Xn.preventDefault(),Wm(te.id,-1)):Xn.key==="ArrowDown"&&(Xn.preventDefault(),Wm(te.id,1)))},onClick:Xn=>{if(vt){Xn.preventDefault(),c0(te);return}if(wa.current){Xn.preventDefault(),wa.current=!1;return}Q(""),H(te.id),U("basic"),E(te.id)},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:te.label}),te.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",te.currentVersion]}),nt&&o.jsx("span",{className:`aw-draft-badge${nt.className}`,children:nt.label})]}),o.jsx("small",{children:ei})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)})]})}),o.jsx("div",{className:"aw-list-count",children:T("agentWorkspace.totalCount",{count:R==="library"?e.length+Wh:oo.length})})]}),R==="evaluation"&&Ge?o.jsx(rLt,{group:Ge,agents:e,cases:ka,onChange:h1,onRun:iC}):R==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noEvaluationGroupSelected")})}):!ce&&!li&&!ci?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${or?" is-deploying":""}${y?" resource-page":""}`,children:[ce&&!Hn&&s&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:T("agentWorkspace.loadingAgent")}),o.jsx("small",{children:T("agentWorkspace.loadingAgentDescription")})]})]})}),M==="integrations"&&se&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:T("agentWorkspace.probingIntegration")}),o.jsx("small",{children:T("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(uE,{className:"aw-agent-detail",title:we,description:Kn.description||T(s||y&&!Ot?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:we,backLabel:T("agentWorkspace.backToAgentList"),onBack:y?x:void 0,meta:o.jsxs(o.Fragment,{children:[Oc!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",Oc]}),li&&o.jsx("span",{className:"aw-agent-meta",children:T("myAgents.draft")}),Sa&&o.jsx("span",{className:"aw-agent-meta",children:T("agentWorkspace.updatePending")}),!ce&&!li&&ci&&o.jsx("span",{className:"aw-agent-meta",children:ci.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:li||Sa||ce!=null&&ce.canDelete?o.jsxs(o.Fragment,{children:[(li||Sa)&&o.jsxs(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const te=li??Sa;te&&Wi(te)},disabled:Jt,"aria-label":T("myAgents.deleteDraft"),title:T("myAgents.deleteDraft"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T("myAgents.deleteDraft")})]}),(ce==null?void 0:ce.canDelete)&&o.jsxs(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void d0(ce),disabled:Jt,"aria-label":T("agentWorkspace.deleteAgent"),title:T("agentWorkspace.deleteAgent"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T(Jt?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:vc.map(te=>{var je,Ve,mt,dn;return{key:te.id,label:te.label,disabled:or,content:te.id===M?o.jsxs(o.Fragment,{children:[Qt&&fs&&o.jsx("div",{className:`aw-detail-deployment${or?" is-running":""}`,children:o.jsx(J5t,{task:Qt,onReturnToEdit:hs&&F?()=>F(hs):void 0})}),o.jsxs("div",{className:"aw-content",children:[M==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[Pe&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:T("agentWorkspace.partialInfoUnavailable"),description:T("agentWorkspace.upgradeRuntimeForDetails")}),(ot&&!Pe||bt)&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:T("agentWorkspace.detailLoadFailed"),description:T("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>ye(nt=>nt+1),children:T("common.retry")})}),ce&&Dt&&!Dt.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:Dt.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:Dt.recoveryStatus==="preparing"?T("agentWorkspace.restoringUpdateConfig"):T("agentWorkspace.updateConfigUnavailable")}),fn&&o.jsx("span",{children:fn}),On.map(nt=>o.jsx("span",{children:nt},nt))]}),o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:T("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.runtimeStatus")}),o.jsxs("dd",{className:(q==null?void 0:q.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(q==null?void 0:q.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(q==null?void 0:q.status)||T("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(ce==null?void 0:ce.region)||(Qt==null?void 0:Qt.region)||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):T("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(LS,{draft:Kn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Ko)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.model")}),o.jsx("dd",{children:EB(Hn==null?void 0:Hn.model)||Kn.modelName||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:Hn!=null&&Hn.graph?gje(Hn.graph):bje(Kn)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:lt.length?lt.map(nt=>o.jsx("span",{children:nt},nt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:Sn===null?T("agentSelector.previewUnsupported"):Sn.length?Sn.map(nt=>o.jsx("span",{children:nt},nt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("systemInfo.currentVersion")}),o.jsx("dd",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.status")}),o.jsx("dd",{children:li?T("myAgents.draft"):(Qt==null?void 0:Qt.status)==="error"?T("agentWorkspace.deploymentFailed"):(Qt==null?void 0:Qt.status)==="cancelled"?T("agentWorkspace.cancelled"):Sa?T("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":T("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:T("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:zn!=null&&zn.enabled?"is-ready":void 0,children:zn?zn.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.enabled")]}):T("skillCenter.status.inactive"):T("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:zn?Dst(zn.profile):T("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:zn?ds.length?ds.map(nt=>o.jsx("span",{children:mA(nt)},nt)):T("agentWorkspace.noneSelected"):T("agentWorkspace.legacyConfigMissing")})]})]})]})]}),M==="usage"&&(ce==null?void 0:ce.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Jn,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:T("agentWorkspace.usageOverview")})}),Jn&&!us&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:T("agentWorkspace.loadingUsage")})}),Eo&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:Eo}),o.jsx("button",{type:"button",onClick:()=>Co(nt=>nt+1),children:T("common.retry")})]}),!Jn&&!Eo&&!us&&!ji&&o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.usageUnavailable")}),us&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":T("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.totalCalls")}),o.jsx("dd",{children:us.totalInvocations.toLocaleString(P.resolvedLanguage??P.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.userCount")}),o.jsx("dd",{children:us.totalUsers.toLocaleString(P.resolvedLanguage??P.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:T("agentWorkspace.userDetails")}),Jn&&o.jsx(xn,{as:"span",role:"status","aria-live":"polite",children:T("agentWorkspace.refreshing")})]}),us.users.length===0?o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:T("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:T("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:us.users.map(nt=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:nt.displayName||nt.userId||T("agentWorkspace.unknownUser")}),nt.displayName&&nt.userId&&o.jsx("small",{title:nt.userId,children:nt.userId})]}),o.jsx("td",{children:nt.invocationCount.toLocaleString(P.resolvedLanguage??P.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:nt.lastUsedAt,children:P5t(nt.lastUsedAt,P.resolvedLanguage??P.language,T)})})]},nt.userId))})]})}),us.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":T("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Jn||us.page<=1,onClick:()=>Qa(nt=>Math.max(1,nt-1)),children:T("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:T("agentWorkspace.pageOf",{page:us.page,total:us.totalPages})}),o.jsx("button",{type:"button",disabled:Jn||us.page>=us.totalPages,onClick:()=>Qa(nt=>nt+1),children:T("common.nextPage")})]})]})]}),M==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.githubVersions")}),o.jsx("p",{children:(je=Ee==null?void 0:Ee.cicd)!=null&&je.enabled?T("agentWorkspace.githubVersionsDescription"):T("agentWorkspace.currentVersionOnly")})]}),J&&o.jsx("div",{className:"aw-case-empty",children:T("agentWorkspace.loadingVersions")}),_e&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:_e}),(ce==null?void 0:ce.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void nA(ce.runtimeId??"").then(De),children:T("common.retry")})]}),!J&&!_e&&o.jsxs("div",{className:"aw-version-list",children:[(Ee==null?void 0:Ee.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:Ee.githubSyncError})}),(Ee==null?void 0:Ee.latestSourceRuntimeStatus)&&Ee.latestSourceRuntimeStatus!=="published"&&((Ve=Ee.versions[0])==null?void 0:Ve.commitSha)&&Ee.versions[0].commitSha!==Ee.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[T("agentWorkspace.sourceMergedRuntimeStill"),bte(Ee.latestSourceRuntimeStatus,T),T("agentWorkspace.currentProductionVersionHint")]})}),Ee!=null&&Ee.versions.length?Ee.versions.map(nt=>{var Ao;const ei=nt.commitSha??"",ua=nt.runtimeStatus??nt.status,Xn=nt.changeType==="rollback",Ns=!!((Ao=Ee.cicd)!=null&&Ao.enabled)&&!!ei&&!Xn&&ei!==Ee.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:M5t(nt,T)}),o.jsx("small",{children:nt.createdAt||T("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.prLink")}),nt.pullRequestUrl?o.jsx("a",{href:nt.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewPr")}):o.jsx("em",{children:T("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.author")}),o.jsx("em",{children:nt.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.publishStatus")}),o.jsx("em",{children:bte(ua,T)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Ns||at===ei,onClick:()=>void Sc(nt),children:T(at===ei?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),nt.workflowRunUrl&&o.jsx("a",{href:nt.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewRelease")})]})]},`${nt.version}-${ei||nt.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||T("agentWorkspace.noTime")})]}),o.jsx("p",{children:T("agentWorkspace.currentVersionOnly")})]})]})]}),M==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.integrationMethods")}),o.jsx("p",{children:T("agentWorkspace.integrationDescription")})]}),ge&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ge}),o.jsx("button",{type:"button",onClick:()=>ae(nt=>nt+1),children:T("common.retry")})]}),!ge&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":T("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),sw.map((nt,ei)=>o.jsx("button",{type:"button",id:`integration-${nt.id}-tab`,role:"tab","aria-selected":ue===nt.id,"aria-controls":`integration-${nt.id}-panel`,tabIndex:ue===nt.id?0:-1,onClick:()=>sf(nt.id),onKeyDown:ua=>{var Ao;if(!["ArrowLeft","ArrowRight","Home","End"].includes(ua.key))return;ua.preventDefault();const Xn=ua.key==="Home"?0:ua.key==="End"?sw.length-1:(ei+(ua.key==="ArrowRight"?1:-1)+sw.length)%sw.length,Ns=sw[Xn];sf(Ns.id),(Ao=document.getElementById(`integration-${Ns.id}-tab`))==null||Ao.focus()},children:nt.label},nt.id))]}),ue==="api-server"?o.jsx(vte,{protocol:"api-server",title:"API Server",available:Qn,fields:[{label:"Agent",value:Qn?((mt=Sr==null?void 0:Sr.apiApps)==null?void 0:mt.join("、"))??"":""},{label:T("agentWorkspace.discoveryEndpoint"),value:Qn?iL(Al,"/list-apps"):""},{label:T("agentWorkspace.invocationEndpoint"),value:Qn?iL(Al,"/run_sse"):""},{label:T("agentWorkspace.authentication"),value:Qn?gte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(yte,{available:Qn,authType:q==null?void 0:q.authType,value:xc,visible:Le&&!!xc,loading:Ie,error:Ae,onToggle:()=>void af()})}],example:Qn?L5t(Al,rf,q==null?void 0:q.authType):""}):o.jsx(vte,{protocol:"a2a",title:"A2A",available:za,fields:[{label:"Agent",value:((dn=Sr==null?void 0:Sr.a2a)==null?void 0:dn.name)??""},{label:"Agent Card",value:za?iL(Al,"/.well-known/agent-card.json"):""},{label:T("agentWorkspace.invocationUrl"),value:be},{label:T("agentWorkspace.authentication"),value:za?gte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(yte,{available:za,authType:q==null?void 0:q.authType,value:xc,visible:Le&&!!xc,loading:Ie,error:Ae,onToggle:()=>void af()})}],example:za?$5t(be,q==null?void 0:q.authType):""})]})]}),M==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(ce==null?void 0:ce.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(nt=>{const ei=q5t(qi,nt),ua=ka.filter(Ns=>Ns.kind===nt).length,Xn=Xo?ua:(ei==null?void 0:ei.itemCount)??ua;return o.jsxs("button",{type:"button",onClick:()=>lf(nt),children:[o.jsx("strong",{children:Xn}),o.jsx("span",{children:T(nt==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},nt)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":T("agentWorkspace.caseResultFilter"),children:["good","bad"].map(nt=>o.jsx("button",{type:"button",className:ft===nt?"is-active":"","aria-pressed":ft===nt,onClick:()=>ut(nt),children:T(nt==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},nt))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":T("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(nt=>o.jsx("button",{type:"button",className:zt===nt?"is-active":"","aria-pressed":zt===nt,onClick:()=>Z(nt),children:T(nt==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},nt))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:Gt,onChange:nt=>Rt(nt.currentTarget.value),placeholder:T("agentWorkspace.searchCasesPlaceholder"),"aria-label":T("agentWorkspace.searchCases")})]})]}),qm&&o.jsx("div",{className:`aw-case-toolbar${xe?" is-active":""}`,children:xe?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCaseCount",{count:of.length})}),o.jsx("button",{type:"button",onClick:cf,disabled:_l.length===0||In,children:T("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YE(of),disabled:of.length===0||In,children:T(In?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:eP,disabled:In,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{_s(""),Xe(!0)},disabled:_l.length===0||In,children:T("agentWorkspace.selectCases")})}),jr&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:jr}),o.jsx("div",{ref:Vi,children:o.jsx(iLt,{cases:_l,loading:zi&&_l.length===0,error:Lr,notice:xs,runtimeBacked:!!(ce!=null&&ce.runtimeId),selectionMode:xe,selectedCaseIds:Yt,focusedCaseId:Si,expandedCaseIds:Hs,deleting:In,canDelete:qm,onOpenCase:l0,onToggleCase:Fr,onToggleExpanded:Br,onDeleteCase:nt=>void YE([nt]),onRetry:()=>Nr(nt=>nt+1)})})]}),M==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:T("agentWorkspace.optimizations")}),o.jsx("p",{children:T("agentWorkspace.optimizationsDescription")})]}),Yr?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.loadingOptimizations")})]}):sa?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:sa}),o.jsx("button",{type:"button",onClick:()=>aa(nt=>nt+1),children:T("common.retry")})]}):As.length>0?o.jsx(tLt,{groups:As}):o.jsx("div",{className:"aw-optimization-state",children:T("agentWorkspace.noOptimizations")})]})]}),M==="basic"&&(ce||li)&&o.jsxs("div",{className:"aw-basic-actions",children:[ce&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>C==null?void 0:C(ce),children:[o.jsx(T7e,{"aria-hidden":!0}),o.jsx("span",{children:T("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${$n?" is-disabled":""}`,tabIndex:$n?0:void 0,"aria-describedby":$n?ca:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$n,"aria-busy":He||void 0,"aria-describedby":$n?ca:void 0,onClick:()=>li?F==null?void 0:F(li):Dt?A(Dt):void 0,children:He?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.preparing")})]}):T(li||Sa?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$n&&o.jsx("span",{id:ca,className:"aw-update-disabled-reason",role:"tooltip",children:$n})]})]})]}):null}}),activeSectionKey:M,navigationLabel:T("agentWorkspace.agentDetails"),onSectionChange:U})]})]}),R==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:T("agentWorkspace.comingSoon")})})]})]}),oi&&o.jsx(pc,{variant:"danger",title:oi.title,description:oi.description,confirmLabel:Jt?T("common.deleting"):oi.confirmLabel,closeLabel:T("agentWorkspace.closeDeleteConfirmation"),busy:Jt,onCancel:()=>Oi(null),onConfirm:()=>void p1()})]})}function tLt({groups:e}){const{t}=Te("ui");return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${n.priority}`,children:z5t(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:H5t(n,t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>o.jsxs("li",{children:[o.jsx("strong",{children:i.suggestion}),o.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function nLt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function iLt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:a,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:v("agentWorkspace.userInput")}),o.jsx("span",{children:v("agentWorkspace.agentOutput")}),o.jsx("span",{children:v("agentWorkspace.score")}),o.jsx("span",{children:v("agentWorkspace.scoreReason")}),o.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?o.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),b&&o.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?o.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(x=>{var _,j;const O=x.id.startsWith("local:"),w=(a==null?void 0:a.has(x.id))??!1,k=(c==null?void 0:c.has(x.id))??!1,E=x.output.length+x.referenceOutput.length>220||(((_=x.reason)==null?void 0:_.length)??0)>120,C=d&&!O,N=!!(x.comment&&x.comment.trim()!==((j=x.reason)==null?void 0:j.trim()));return o.jsxs("div",{className:["aw-case-row",l===x.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){C&&(h==null||h(x));return}f==null||f(x)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?C&&(h==null||h(x)):f==null||f(x)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&C&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:x.input,children:x.input||v("agentWorkspace.noUserInput")})]}),N&&o.jsxs("small",{title:x.comment,children:[v("agentWorkspace.note"),x.comment]}),o.jsx("small",{className:"aw-case-time",children:U5t(x.createdAt,y.resolvedLanguage??y.language,v)}),(x.userId||x.sessionId)&&o.jsx("small",{title:[x.userId,x.sessionId].filter(Boolean).join(" · "),children:[x.userId,x.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:x.output,children:x.output||v("agentWorkspace.noVisibleResponse")}),x.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:x.referenceOutput,children:[v("agentWorkspace.reference"),": ",x.referenceOutput]}),E&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(x.id)},children:v(k?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:Q5t(x,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:x.reason||void 0,children:x.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:C&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(x)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(nLt,{})})})]},x.id)})]})}function rLt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[a,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Ww(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:Ww(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(x7e,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[o.jsx("button",{type:"button",className:a==="config"?"is-active":"","aria-pressed":a==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),o.jsx("button",{type:"button",className:a==="history"?"is-active":"","aria-pressed":a==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),o.jsx("div",{className:"aw-content",children:a==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),o.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:h.label}),o.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluationSet")}),o.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[o.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),o.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),o.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),o.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluator")}),o.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[o.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),o.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),o.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.concurrency")}),o.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),o.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),o.jsx("div",{className:"aw-metric-list",children:u.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),o.jsx("span",{children:Ww(h,s)})]},h))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:s("agentWorkspace.historyResults")}),o.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:s("agentWorkspace.noHistory")}),o.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:Ww(h.createdAt,s),agents:c.length})})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:h.score}),o.jsx("small",{children:s("agentWorkspace.overallScore")})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Vu,{}),s("agentWorkspace.completed")]}),o.jsx(bO,{"aria-hidden":!0})]},h.id))})]})})]})}const sLt=5e3,aLt=4;let rL=0;const wte=[];function Ote(e){return e instanceof Error&&e.name==="AbortError"}function oLt(e){return e instanceof Error&&e.name==="TimeoutError"}function lLt(e){return oLt(e)||e instanceof i7&&[500,502,503,504].includes(e.status)}function cLt(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 uLt(e={},t={}){const n=t.request??_x,i=t.wait??cLt;try{return await n(e)}catch(r){if(!lLt(r))throw r;return await i(sLt,e.signal),n(e)}}async function wje(e){var t;rL>=aLt&&await new Promise(n=>wte.push(n)),rL+=1;try{return await e()}finally{rL-=1,(t=wte.shift())==null||t()}}async function dLt(e,t){await Promise.allSettled(e.map(n=>wje(()=>t(n))))}const fLt="/web/sandbox/sessions",Ste="/web/sandbox/codex-project-handoff",kte=3e4,sL=33e4,hLt=6e4,pLt=6e5,aw=15e3,If=6e4,mLt=33e4,Ete=3e4,gLt=60*60,Cte=40;function FI(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function XQ(e){switch(e.trim().toLowerCase()){case"ready":return V("sandbox.status.ready");case"wakeable":return V("sandbox.status.wakeable");case"creating":return V("sandbox.status.creating");case"starting":case"initializing":return V("sandbox.status.starting");case"pending":return V("sandbox.status.pending");case"running":return V("sandbox.status.running");case"failed":case"error":return V("sandbox.status.failed");case"stopped":return V("sandbox.status.stopped");case"expired":return V("sandbox.status.expired");case"deleting":return V("sandbox.status.deleting");case"deleted":return V("sandbox.status.deleted");default:return V("sandbox.status.unknown")}}function Jr(e){const t=Hu(e);return t.has("Accept")||t.set("Accept","application/json"),t}class BI extends Error{constructor(n,i={}){var r;super(n);ki(this,"code");ki(this,"retryable");ki(this,"publicMessage");ki(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Tte(e){return e instanceof BI?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?V("sandbox.developmentTimeout"):e instanceof TypeError?V("sandbox.developmentDisconnected"):V("sandbox.developmentFailed")}async function es(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?V("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,a=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof a=="string"?a:a==null?"":JSON.stringify(a),c=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?V("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new BI(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function Ate(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function og(e,t="codex"){if(!e.sessionId||!e.status)throw new Error(V("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:e.toolName==="intelligent-development",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:UI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:Eg(e.conversation)}}}function _te(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(V("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function Nte(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const ow={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function UI(e){if(!e||typeof e!="object")return{...ow};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ow.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ow.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ow.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ow.networkAccess}}function jte(e){if(!e||typeof e!="object")throw new Error(V("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:UI(t.permissions)}}function _a(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function bLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function yLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function Oje(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function Eg(e){const t=_a(e),n=Oje(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(V("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=_a(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const a=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=_a(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...a.length?{skillNames:a}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:UI(t.permissions)}}function w8(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 vLt(e){const t=w8(e.usage);if(!t||typeof e.turnId!="string")return;const n=w8(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 xLt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function wLt(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="",s="";const a=[],l=new Map;let c,u;function d(){var b;const g=c?[...a,c]:a;(b=t.onBlocks)==null||b.call(t,g.map(v=>({...v})))}function f(g){s+=g;const b=a[a.length-1],v=a.length-1,y=[...l.values()].includes(v);(b==null?void 0:b.kind)==="text"&&!y?b.text+=g:a.push({kind:"text",text:g}),d()}function h(g){if(typeof g.id!="string"||g.kind!=="thinking"&&g.kind!=="commentary"&&g.kind!=="tool"||g.status!=="running"&&g.status!=="done")return;const b=g.status==="done";let v;if(g.kind==="thinking"){if(typeof g.text!="string"||!g.text)return;v={kind:"thinking",text:g.text,done:b}}else if(g.kind==="commentary"){if(typeof g.text!="string"||!g.text)return;v={kind:"text",text:g.text}}else{if(typeof g.name!="string"||!g.name)return;v={kind:"tool",name:g.name,args:g.args,response:g.response,done:b}}const y=l.get(g.id);y===void 0?(l.set(g.id,a.length),a.push(v)):a[y]=v,d()}function m(g){var x,O,w;let b="message";const v=[];for(const k of g.split(/\r?\n/))k.startsWith("event:")&&(b=k.slice(6).trim()),k.startsWith("data:")&&v.push(k.slice(5).trimStart());if(v.length===0)return;let y;try{y=JSON.parse(v.join(` -`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(b==="error"){const k=typeof y.message=="string"&&y.message?y.message:V("sandbox.conversationFailed");throw new BI(k,{code:typeof y.code=="string"?y.code:"",retryable:y.retryable===!0,publicMessage:k})}if(b==="progress"&&typeof y.text=="string"&&y.text&&(c={kind:"progress",text:y.text},d()),b==="activity"&&h(y),b==="development.source_ready"||b==="development.succeeded"){const k=_a(y.payload),S=_a(k==null?void 0:k.delivery),E=b==="development.succeeded";if(S&&typeof S.sessionId=="string"&&typeof S.artifactSha256=="string"&&typeof S.validationReportSha256=="string"&&typeof S.agentName=="string"&&typeof S.entryPoint=="string"&&typeof S.fileCount=="number"&&typeof S.artifactSize=="number"&&typeof S.validatedAt=="string"&&S.deployable===!0&&S.verified===E&&typeof S.validationSummary=="string"&&Array.isArray(S.gateSummary)&&S.gateSummary.every(C=>typeof C=="string")){const C={kind:"delivery",value:{sessionId:S.sessionId,...typeof S.projectId=="string"&&typeof S.versionId=="string"?{projectId:S.projectId,versionId:S.versionId,...S.parentVersionId===null||typeof S.parentVersionId=="string"?{parentVersionId:S.parentVersionId}:{}}:{},artifactSha256:S.artifactSha256,validationReportSha256:S.validationReportSha256,agentName:S.agentName,entryPoint:S.entryPoint,fileCount:S.fileCount,artifactSize:S.artifactSize,validatedAt:S.validatedAt,gateSummary:S.gateSummary,deployable:S.deployable,verified:S.verified,validationSummary:S.validationSummary}},N=a.findIndex(_=>_.kind==="delivery"&&_.value.sessionId===S.sessionId&&_.value.artifactSha256===S.artifactSha256&&_.value.validationReportSha256===S.validationReportSha256);N===-1?a.push(C):a[N]=C,d()}}if(b==="approval"){const k=xLt(y);k&&((x=t.onApproval)==null||x.call(t,k))}if(b==="usage"){const k=vLt(y);k&&(u=k,(O=t.onUsage)==null||O.call(t,k))}b==="approval_resolved"&&typeof y.approvalId=="string"&&((w=t.onApprovalResolved)==null||w.call(t,y.approvalId)),b==="delta"&&typeof y.text=="string"&&f(y.text),b==="done"&&!s&&typeof y.text=="string"&&f(y.text),b==="done"&&c&&(c=void 0,d())}for(;;){const{done:g,value:b}=await n.read();r+=i.decode(b,{stream:!g});const v=r.split(/\r?\n\r?\n/);if(r=v.pop()??"",v.forEach(m),g)break}if(r.trim()&&m(r),c&&(c=void 0,d()),a.length===0)throw new Error(V("sandbox.emptyReply"));return{text:s,blocks:a,...u?{usage:u}:{}}}async function $l(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await An(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Jr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},If);if(!l.ok)throw await es(l,a);return l.json()}function Sje(e,t={}){return{async listSessions(n={}){const i=await An(Nte(e,n),{method:"GET",headers:Jr(),signal:n.signal},kte);if(!i.ok)throw await es(i,V("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(V("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(V("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>og(s)),...(r.snapshots??[]).map(s=>_te(s))]},async startSession(n={}){var r,s;const i=await An(e,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((r=n.displayName)==null?void 0:r.trim())??"",...(s=n.modelId)!=null&&s.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},sL);if(!i.ok)throw await es(i,V("sandbox.startFailed"));return og(await i.json())},async listAgentSessions(n,i={}){const r=await An(Nte(`/web/${n}/sessions`,i),{method:"GET",headers:Jr(),signal:i.signal},kte);if(!r.ok)throw await es(r,V("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(V("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(V("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(a=>og(a,n)),...(s.snapshots??[]).map(a=>_te(a,n))]},async startAgentSession(n,i={}){var s;const r=await An(`/web/${n}/sessions`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},sL);if(!r.ok)throw await es(r,V("sandbox.createAgentFailed",{kind:n}));return og(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openAgentFailed",{kind:n}));const a=await s.json();if(typeof a.webuiUrl!="string"||!a.webuiUrl.startsWith("/"))throw new Error(V("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:og(a,n),kind:n,webuiUrl:Uo(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:kje(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!s.ok&&s.status!==404)throw await es(s,V("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await An(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Jr(),signal:r.signal},sL);if(!a.ok)throw await es(a,V("sandbox.resumeSnapshotFailed"));return og(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await An(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!a.ok&&a.status!==404)throw await es(a,V("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(V("sandbox.missingSessionToConnect"));const r=await An(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),signal:i.signal},hLt);if(!r.ok)throw await es(r,V("sandbox.connectCodexFailed"));const s=og(await r.json());if(s.status.toLowerCase()!=="ready")throw new Error(V("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(V("sandbox.invalidMessage"));const r=await An(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Jr({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??pLt);if(!r.ok)throw await es(r,V("sandbox.conversationFailed"));return wLt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Jr(),signal:i.signal},t.interruptTimeoutMs??aw);if(!r.ok&&![404,409].includes(r.status))throw await es(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await $l(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=jte(r),a=_a(r),l=w8(a==null?void 0:a.threadTotal),c=a==null?void 0:a.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=_a(await $l(e,n,"endpoint",{options:i,fallback:V("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(V("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await An(`${Ste}/pairings`,{method:"POST",headers:Jr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:gLt}),signal:n.signal},Ete);if(!i.ok)throw await es(i,V("sandbox.createHandoffPairingFailed"));const r=_a(await Ate(i,V("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(V("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await An(`${Ste}/pairings/${encodeURIComponent(n)}`,{headers:Jr({Accept:"application/json"}),signal:i.signal},Ete);if(!r.ok)throw await es(r,V("sandbox.getHandoffStatusFailed"));const s=_a(await Ate(r,V("sandbox.getHandoffStatusFailed"))),a=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!a.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(V("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=_a(await $l(e,n,"models",{options:i,fallback:V("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(V("sandbox.invalidModelList"));return r.models.flatMap(s=>{const a=bLt(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=_a(await $l(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:V("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(V("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const a=_a(await $l(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:V("sandbox.listSkillsFailed")}));if(!Array.isArray(a==null?void 0:a.skills))throw new Error(V("sandbox.invalidSkillList"));return a.skills.flatMap(l=>{const c=yLt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const a=s.size?`?${s}`:"",l=_a(await $l(e,n,`threads${a}`,{options:r,fallback:V("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(V("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=Oje(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return Eg(await $l(e,n,"threads/new",{method:"POST",options:i,fallback:V("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(V("sandbox.missingThread"));return Eg(await $l(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return Eg(await $l(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return Eg(await $l(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=_a(await $l(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(V("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:Eg(s)}:{}}},async deleteThread(n,i,r={}){const s=_a(await $l(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(V("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:Eg(s)}:{}}},async compactThread(n,i={}){await $l(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await An(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V("sandbox.getSettingsFailed"));return jte(await r.json())},async updatePermissions(n,i,r={}){const s=await An(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return UI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await An(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updateWorkspaceFailed"));const a=await s.json();if(typeof a.cwd!="string"||!a.cwd)throw new Error(V("sandbox.invalidWorkingDirectory"));return a.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),a=await An(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Jr(),signal:r.signal},If);if(!a.ok)throw await es(a,V("sandbox.listDirectoriesFailed"));const l=await a.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(V("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const a=await An(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},If);if(!a.ok)throw await es(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return Rte(e,n,"terminal",i)},async launchBrowser(n,i={}){return Rte(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await An(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Jr(),body:s,signal:r.signal},mLt);if(!a.ok)throw await es(a,V("sandbox.uploadFileFailed"));const l=await a.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(V("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.deleteCodexFailed"))}}}const dr=Sje(fLt),fp=Sje("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3});async function Rte(e,t,n,i){const r=await An(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:kje(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function kje(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Uo(e);let n;try{n=new URL(e)}catch{throw new Error(V("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(V("sandbox.unsafeToolUrl",{label:t}));return n.toString()}function Rg(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||V("common.unknownError"));return[V("requestError.actionFailed",{action:t}),V("requestError.detail",{detail:i}),n?V("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}function Yf({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function OLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function SLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function kLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function ELt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),o.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),o.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),o.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function wk({kind:e,...t}){return e==="codex"?o.jsx(OLt,{...t}):e==="deepseek-harness"?o.jsx(ELt,{...t}):e==="openclaw"?o.jsx(SLt,{...t}):o.jsx(kLt,{...t})}const CLt=["general","codex","deepseek-harness","openclaw","hermes"],TLt=24,ALt=3e4,_Lt=7e3,NLt=2e4,jLt=6,RLt=2,ILt=250,Vp=new Map,yv=new Map,PLt=new Set;function lg(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Ite(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ds&&e.unsupported?"unsupported":"error",message:n}}function b2(e){if(!e){Vp.clear(),yv.clear(),_4();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of yv)i.page.runtimes.some(r=>t.has(r.runtimeId))&&yv.delete(n);for(const n of t)_4(n);Vp.clear()}}function DLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function MLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function LLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $Lt({type:e}){return e==="general"?o.jsx(Yf,{}):o.jsx(wk,{kind:e})}function FLt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),a=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:a})}function Pte(e,t){var n;return{id:e.runtimeId,name:e.name,description:((n=e.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:IEe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function BLt(e,t){const n=FI(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:IEe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function ULt(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 QLt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function zLt(e,t){return e.trim()||Ji(t)}async function VLt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=yv.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Pte(d,r))),l.page.nextToken;l&&yv.delete(a);let c=Vp.get(a);c||(c=uLt({scope:e,region:t,pageSize:TLt,nextToken:n,signal:s}),Vp.set(a,c),c.then(()=>Vp.delete(a),()=>Vp.delete(a)));const u=await c;return yv.set(a,{page:u,expiresAt:Date.now()+ALt}),i(u.runtimes.map(d=>Pte(d,r))),u.nextToken}function HLt({agent:e,onUse:t,onViewDetails:n,onPrepareUpdate:i,compatibility:r,onRetryCompatibility:s,connecting:a,connectError:l,connected:c,deploymentTask:u,nowMs:d,onViewDeploymentTask:f,onEditDraft:h,onDeleteDraft:m}){var _,j,A,F;const{t:g,i18n:b}=Te("ui"),v=(_=e.sandbox)==null?void 0:_.status.toLowerCase(),y=((j=e.sandbox)==null?void 0:j.resourceType)==="snapshot",x=!!(e.runtime||v==="ready"||v==="wakeable"),O=(r==null?void 0:r.status)==="checking",w=(r==null?void 0:r.status)==="unsupported",k=(r==null?void 0:r.status)==="error",S=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(F=e.sandbox)==null?void 0:F.id,E=()=>{if(e.draft){u?f==null||f(u):n==null||n(e);return}!x&&!e.sandbox||(u?f==null||f(u):n==null||n(e))},C=(e.draft||x||!!e.sandbox)&&!!(u?f:n),N=e.draft?u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.viewRuntimeDetails",{name:e.name}):u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.viewDetails",{name:e.name});return o.jsxs(RB,{className:a?"my-agent-card is-connecting":"my-agent-card",activateLabel:C?N:void 0,onActivate:C?E:void 0,onPointerEnter:()=>i==null?void 0:i(e),onFocusCapture:()=>i==null?void 0:i(e),footer:o.jsx(UOe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:g("myAgents.time"),value:KQ(e.createdAt,d,b.resolvedLanguage??b.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:g("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?g("myAgents.neverExpires"):FLt(e.sandbox.expireAt,d,g),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(C6,{"aria-label":u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.editDraftNamed",{name:e.name}),onClick:()=>u?f==null?void 0:f(u):h==null?void 0:h(e.draft),children:g(u?"myAgents.viewProgress":"common.edit")}),o.jsx(C6,{tone:"danger","aria-label":g("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>m==null?void 0:m(e.draft),children:g("common.delete")})]}):k||w?o.jsxs(Ht,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":g("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>s==null?void 0:s(e),children:[o.jsx(Kj,{}),g("common.retry")]}):o.jsx(T6,{className:c?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||w||a||c,"aria-busy":a||void 0,label:c?g("myAgents.connectedNamed",{name:e.name}):y?g("myAgents.wakeAndChat",{name:e.name}):g("myAgents.chatWith",{name:e.name}),onClick:()=>void(t==null?void 0:t(e)),children:a?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:g(y?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(MLt,{})}),children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:S,children:S}):void 0,status:e.draft?u?o.jsx("span",{className:"my-agent-deploying-badge",children:g("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:g("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":FI(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&u?o.jsx("span",{className:"my-agent-deploying-badge",children:g("myAgents.deploying")}):O?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsxs(ba,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[o.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),o.jsx("span",{children:g("myAgents.checking")})]})})}):w?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:g("myAgents.chatUnsupported")})})}):k?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:g("myAgents.checkFailed")})})}):null}),l?o.jsx(go,{content:l,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:o.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:l})}):null,y&&a?o.jsx("p",{className:"my-agent-wake-note",role:"status",children:o.jsx(xn,{children:g("myAgents.wakingHint")})}):null,e.sandbox?null:o.jsx(PB,{children:e.description})]})}function qLt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:a,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=PLt,drafts:x=[],deploymentTasks:O=[],draftDeploymentTaskIds:w={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:E}){const{t:C}=Te("ui"),N=p.useRef(null),_=p.useRef(null),j=p.useRef(0),A=p.useRef(null),F=p.useRef(0),T=p.useRef(null),P=p.useRef(new Map),R=zLt(t,e),[L,M]=p.useState(""),[U,I]=p.useState(s==="mine"?"mine":"all"),[H,K]=p.useState(R),[Q,q]=p.useState([]),[B,ee]=p.useState(""),[le,se]=p.useState(!0),[re,ge]=p.useState(""),[W,X]=p.useState([]),[ae,ue]=p.useState(!1),[Oe,ke]=p.useState(""),[st,Le]=p.useState(""),[Me,Ie]=p.useState({}),[qe,Ae]=p.useState({}),[ze,Ee]=p.useState(null),[De,J]=p.useState(()=>Date.now()),he=p.useMemo(()=>CLt.map($e=>({value:$e,label:C(`myAgents.agentTypes.${$e}`)})),[C]),_e=p.useMemo(()=>{const $e=Iu(e);return $e.some(ye=>ye.value===R)?$e:[{value:R,label:R},...$e]},[e,R]);p.useEffect(()=>{s==="mine"&&I("mine")},[s]),p.useEffect(()=>{K(R)},[R]),p.useEffect(()=>{J(Date.now());const $e=window.setInterval(()=>J(Date.now()),1e3);return()=>window.clearInterval($e)},[]);const Ze=p.useMemo(()=>x.map($e=>ULt($e,C)),[x,C]),at=p.useMemo(()=>{const $e=new Map,ye=new Map,Ue=new Map;for(const Ke of O){if(Ke.status!=="running")continue;if($e.set(Ke.id,Ke),Ke.draftId){const ut=ye.get(Ke.draftId);(!ut||Ke.startedAt>ut.startedAt)&&ye.set(Ke.draftId,Ke)}if(!Ke.runtimeId)continue;const ft=Ue.get(Ke.runtimeId);(!ft||Ke.startedAt>ft.startedAt)&&Ue.set(Ke.runtimeId,Ke)}return{byId:$e,byDraftId:ye,byRuntimeId:Ue}},[O]),wt=p.useCallback($e=>{var Ue;if($e.draft){const Ke=w[$e.draft.id];return at.byDraftId.get($e.draft.id)??(Ke?at.byId.get(Ke):void 0)}const ye=(Ue=$e.runtime)==null?void 0:Ue.runtimeId;return ye?at.byRuntimeId.get(ye):void 0},[at,w]),Se=p.useCallback(($e,ye)=>{var ft;(ft=A.current)==null||ft.abort(),Vp.clear();const Ue=new AbortController;A.current=Ue;const Ke=++j.current;return se(!0),ge(""),VLt(U,H,$e,ut=>{j.current===Ke&&q(Gt=>ye?ut:[...Gt,...ut])},C,Ue.signal).then(ut=>{j.current===Ke&&ee(ut)}).catch(ut=>{j.current===Ke&&(Ote(ut)||ge(Rg(ut,C("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{j.current===Ke&&se(!1),A.current===Ue&&(A.current=null)})},[U,H,C]);p.useEffect(()=>{if(m==="general")return q([]),ee(""),Se("",!0),()=>{var $e;($e=A.current)==null||$e.abort(),A.current=null,Vp.clear(),j.current+=1}},[m,Se]),p.useEffect(()=>{if(m!=="general"){for(const Ue of P.current.values())Ue.abort();P.current.clear();return}const $e=new Set(Q.filter(Ue=>{var Ke,ft;return((Ke=Ue.runtime)==null?void 0:Ke.runtimeId)!==v&&((ft=Ue.runtime)==null?void 0:ft.region)===H}).map(lg).filter(Boolean));for(const[Ue,Ke]of P.current)$e.has(Ue)||(Ke.abort(),P.current.delete(Ue));const ye=Q.filter(Ue=>{var Gt,Rt,zt;const Ke=(Gt=Ue.runtime)==null?void 0:Gt.runtimeId;if(!Ke||Ke===v||((Rt=Ue.runtime)==null?void 0:Rt.region)!==H)return!1;const ft=lg(Ue),ut=(zt=qe[ft])==null?void 0:zt.status;return!P.current.has(ft)&&(!ut||ut==="checking")});for(const Ue of ye)P.current.set(lg(Ue),new AbortController);Ae(Ue=>{var ut,Gt;let Ke=!1;const ft={...Ue};for(const Rt of Q){const zt=lg(Rt);if(!zt)continue;const Z=((ut=Rt.runtime)==null?void 0:ut.runtimeId)===v;Z&&((Gt=ft[zt])==null?void 0:Gt.status)!=="compatible"?(ft[zt]={status:"compatible",message:C("myAgents.compatibility.supported")},Ke=!0):!Z&&!ft[zt]&&(ft[zt]={status:"checking",message:C("myAgents.compatibility.checking")},Ke=!0)}return Ke?ft:Ue}),dLt(ye,async Ue=>{const Ke=Ue.runtime;if(!Ke)return;const ft=lg(Ue),ut=P.current.get(ft);if(ut)try{const Gt=await Fv(Ke.runtimeId,Ke.region,{signal:ut.signal,preferCached:!0,timeoutMs:_Lt,currentVersion:Ke.currentVersion});if(ut.signal.aborted)return;Ae(Rt=>({...Rt,[ft]:Gt&&Gt.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(Gt){if(ut.signal.aborted||(Gt==null?void 0:Gt.name)==="AbortError")return;Ae(Rt=>({...Rt,[ft]:Ite(Gt,C)}))}finally{P.current.get(ft)===ut&&P.current.delete(ft)}})},[m,v,H,Q,C]),p.useEffect(()=>()=>{var $e;($e=A.current)==null||$e.abort();for(const ye of P.current.values())ye.abort();P.current.clear()},[]);const ve=p.useCallback(async $e=>{var Ke;(Ke=T.current)==null||Ke.abort();const ye=new AbortController;T.current=ye;const Ue=++F.current;ue(!0),ke(""),X([]);try{const ft=$e==="codex"?await dr.listSessions({signal:ye.signal,autoResumeSnapshots:!1}):await dr.listAgentSessions($e,{signal:ye.signal,autoResumeSnapshots:!1});if(F.current!==Ue)return;X(ft.map(ut=>BLt(ut,C)))}catch(ft){if((ft==null?void 0:ft.name)==="AbortError"||F.current!==Ue)return;ke(Rg(ft,C("myAgents.loadAgentType",{type:C(`myAgents.agentTypes.${$e}`)}),`GET /web/${$e==="codex"?"sandbox":$e}/sessions`))}finally{T.current===ye&&(T.current=null),F.current===Ue&&ue(!1)}},[C]);function He($e){var ye;$e!==m&&($e==="general"?(j.current+=1,q([]),ee(""),ge(""),se(!0)):((ye=T.current)==null||ye.abort(),T.current=null,F.current+=1,X([]),ke(""),ue(!0)),g($e))}function Je(){m==="general"&&(j.current+=1,q([]),ee(""),ge(""),se(!0))}function Ce($e){$e!==U&&(Je(),I($e))}function Wt($e){$e!==H&&(Je(),K($e))}p.useEffect(()=>{var $e;if(m==="general"){($e=T.current)==null||$e.abort(),T.current=null,F.current+=1;return}return ve(m),()=>{var ye;(ye=T.current)==null||ye.abort(),T.current=null,F.current+=1}},[m,ve,b]),p.useEffect(()=>{const $e=_.current,ye=N.current;if(!$e||!ye||m!=="general"||!B||le)return;const Ue=new IntersectionObserver(([Ke])=>{Ke.isIntersecting&&Se(B,!1)},{root:ye,rootMargin:"240px 0px",threshold:.01});return Ue.observe($e),()=>Ue.disconnect()},[m,Se,le,B]);const ln=p.useCallback(async $e=>{if(!st){Le($e.id),Ie(ye=>({...ye,[$e.id]:""}));try{await new Promise(ye=>requestAnimationFrame(()=>ye())),$e.sandbox?await f($e.sandbox):await c($e)}catch(ye){Ie(Ue=>({...Ue,[$e.id]:ye instanceof Error?ye.message:String(ye)}))}finally{Le("")}}},[st,c,f]),cn=p.useCallback(async $e=>{var ft;const ye=$e.runtime;if(!ye)return;const Ue=lg($e);Ae(ut=>({...ut,[Ue]:{status:"checking",message:C("myAgents.compatibility.checking")}})),(ft=P.current.get(Ue))==null||ft.abort();const Ke=new AbortController;P.current.set(Ue,Ke);try{const ut=await wje(()=>Fv(ye.runtimeId,ye.region,{retryProbe:!0,signal:Ke.signal,timeoutMs:NLt,currentVersion:ye.currentVersion}));if(Ke.signal.aborted)return;Ae(Gt=>({...Gt,[Ue]:ut&&ut.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(ut){if(Ke.signal.aborted||Ote(ut))return;Ae(Gt=>({...Gt,[Ue]:Ite(ut,C)}))}finally{P.current.get(Ue)===Ke&&P.current.delete(Ue)}},[C]),Ot=p.useCallback($e=>{const ye=$e.runtime;!r||!ye||wt($e)||A4({runtimeId:ye.runtimeId,region:ye.region,appName:$e.appName,currentVersion:ye.currentVersion})},[r,wt]),jt=p.useMemo(()=>{const $e=L.trim().toLocaleLowerCase(),ye=m==="general"?[...Ze,...Q]:W,Ke=(U==="mine"?ye.filter(Rt=>Rt.isMine):ye).filter(Rt=>{var Z;const zt=((Z=Rt.runtime)==null?void 0:Z.region)??Rt.region;return!zt||zt===H}),ft=$e?Ke.filter(Rt=>Rt.name.toLocaleLowerCase().includes($e)):Ke;if(m!=="general")return ft;const ut=y.size>0?ft.filter(Rt=>!Rt.runtime||!y.has(Rt.runtime.runtimeId)):ft,Gt=ut.findIndex(Rt=>{var zt;return((zt=Rt.runtime)==null?void 0:zt.runtimeId)===v});return Gt<=0?ut:[ut[Gt],...ut.slice(0,Gt),...ut.slice(Gt+1)]},[m,v,Ze,y,L,U,H,Q,W]);p.useEffect(()=>{if(!r||m!=="general")return;const $e=jt.filter(ut=>!!ut.runtime).filter(ut=>!wt(ut)).slice(0,jLt);if($e.length===0)return;let ye=!1,Ue=0;const Ke=async()=>{for(;!ye;){const ut=$e[Ue];if(Ue+=1,!(ut!=null&&ut.runtime)||(await A4({runtimeId:ut.runtime.runtimeId,region:ut.runtime.region,appName:ut.appName,currentVersion:ut.runtime.currentVersion}),ye))return}},ft=window.setTimeout(()=>{for(let ut=0;ut{ye=!0,window.clearTimeout(ft)}},[m,r,wt,jt]);const ot=C(`myAgents.agentTypes.${m}`,{defaultValue:C("myAgents.agent")}),gt=m==="general"?le&&Q.length===0&&Ze.length===0:ae&&W.length===0,Pe=!gt&&jt.length===0,bt=(m==="general"?n:i)?m==="general"?()=>a(H):()=>d(m):void 0,Mt=m==="codex"&&i&&!!l;return o.jsxs(Th,{className:"my-agents-page","aria-label":C("myAgents.agent"),children:[o.jsx(zx,{title:C("myAgents.agent"),className:"my-agents-header"}),o.jsxs(Zb,{className:"my-agent-toolbar",children:[o.jsx(dE,{idPrefix:"my-agent-ownership",ariaLabel:C("myAgents.creatorFilter"),value:U,items:[{id:"all",label:C("common.all"),disabled:s==="mine"},{id:"mine",label:C("agentSelector.createdByMe")}],onChange:Ce}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"my-agent-type-filter",ariaLabel:C("myAgents.agentType"),value:m,options:he,onChange:He}),o.jsx(lN,{id:"my-agent-region-filter",ariaLabel:C("myAgents.region"),value:H,options:_e,onChange:Wt}),o.jsx(wm,{className:"my-agent-search","aria-label":C("myAgents.searchAgents"),value:L,onChange:$e=>M($e.target.value),placeholder:C("common.search")}),Mt?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx(LLt,{}),o.jsx("span",{children:C("myAgents.handoff")})]}):null]})]}),o.jsxs(Jb,{className:"my-agent-results",ref:N,"aria-label":C("myAgents.agentList",{type:ot}),children:[gt?o.jsx(Ud,{}):(m==="general"?re:Oe)&&jt.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:m==="general"?re:Oe}),o.jsx("button",{type:"button",onClick:()=>{m==="general"?Se("",!0):ve(m)},children:C("common.reload")})]}):Pe&&!bt?L.trim()||U==="mine"||H!==R?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(QFe,{})}),o.jsx(Cn.Title,{children:C("myAgents.noMatchingAgents")}),o.jsx(Cn.Description,{children:C("myAgents.adjustSearch")})]})}):m!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx($Lt,{type:m})}),o.jsx(Cn.Title,{className:"my-agent-sandbox-empty-title",children:C("myAgents.noAgentType",{type:ot})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(Yf,{})}),o.jsx(Cn.Title,{children:C("myAgents.noGeneralAgents")}),o.jsx(Cn.Description,{children:C("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[m==="general"&&re?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:re}),o.jsx("button",{type:"button",onClick:()=>void Se("",!0),children:C("common.reload")})]}):null,o.jsxs(Vx,{className:"my-agent-grid",children:[bt?o.jsx(Cb,{className:"my-agent-create-card","aria-label":C("myAgents.createAgentType",{type:ot}),onClick:bt,icon:o.jsx(DLt,{}),children:C("myAgents.createAgent")}):null,jt.map($e=>{var Ue;const ye=QLt($e,Q,C);return o.jsx(HLt,{agent:$e,deploymentTask:wt($e),nowMs:De,onViewDeploymentTask:k,onUse:ln,compatibility:$e.runtime?qe[lg($e)]??{status:"checking",message:C("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:cn,onPrepareUpdate:Ot,onViewDetails:ye?()=>{ye.sandbox?h(ye.sandbox):u(ye)}:void 0,connecting:$e.id===st,connectError:Me[$e.id],connected:((Ue=$e.runtime)==null?void 0:Ue.runtimeId)===v,onEditDraft:S,onDeleteDraft:Ee},$e.id)})]})]}),m==="general"&&!re&&!gt&&(jt.length>0||!!B)&&o.jsx("div",{className:"my-agent-load-more",ref:_,"aria-live":"polite",children:le?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:C("myAgents.loadingMore")})]}):B?o.jsx("span",{children:C("myAgents.scrollForMore")}):o.jsx("span",{children:C("myAgents.allLoaded")})})]}),ze?o.jsx(pc,{title:C("myAgents.deleteDraftTitle"),description:C("myAgents.deleteDraftDescription",{name:ze.draft.name||C("agentSelector.unnamedAgent")}),confirmLabel:C("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Ee(null),onConfirm:()=>{E==null||E(ze),Ee(null)}}):null]})}const WLt="_Container_13560_1",GLt="_Textarea_13560_174",Dte={Container:WLt,Textarea:GLt},Rm=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:x,autoSelect:O,rows:w=3,maxRows:k,autoResize:S,ref:E,onChange:C,...N}=e,[_,j]=p.useState(!1),A=S?Math.max(k??10,w):w;p.useEffect(()=>{var P;O&&((P=t.current)==null||P.select())},[O]);const F=P=>{y==null||y(P),P.animationName==="native-autofill-in"&&(x==null||x())},T=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const P=t.current.scrollHeight;t.current.style.height=P+"px"},[S,A]);return p.useEffect(()=>{T()},[e.value,w,T]),o.jsx("div",{className:pi(Dte.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":_,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Wb({"textarea-min-rows":`${w}`,"textarea-max-rows":`${A}`}),children:o.jsx("textarea",{...N,onChange:P=>{C==null||C(P),T()},ref:Zk([t,E]),id:r||(g?void 0:i),className:Dte.Textarea,name:s,readOnly:h,disabled:f,rows:w,onFocus:P=>{j(!0),b==null||b(P)},onBlur:P=>{j(!1),v==null||v(P)},onAnimationStart:F,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},QI="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",KLt="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",XLt="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",YLt="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",ZLt="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",JLt="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",e3t="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",t3t="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",n3t="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",i3t="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 YQ(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}xo.registerLanguage("bash",JB);const r3t=48;function s3t(e,t=r3t){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function a3t(e){return xo.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function o3t({status:e}){return e==="succeeded"?o.jsx(Vu,{"aria-hidden":!0}):e==="failed"?o.jsx(h4,{"aria-hidden":!0}):e==="running"?o.jsx(fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(d7e,{"aria-hidden":!0})}function Mte(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 l3t({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>a3t(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return o.jsxs("div",{className:"studio-build-progress",children:[o.jsx("ol",{className:"studio-build-progress__steps","aria-label":a("studioBuildProgress.steps"),children:e.map(g=>o.jsxs("li",{className:`is-${g.status}`,children:[o.jsx("span",{className:"studio-build-progress__step-icon",children:o.jsx(o3t,{status:g.status})}),o.jsx("span",{children:g.label})]},g.key))}),o.jsxs("section",{className:"studio-build-progress__log","aria-label":a("studioBuildProgress.log"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:a("studioBuildProgress.log")}),o.jsxs("span",{children:[a(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?a("studioBuildProgress.recentOnly"):"",Mte(r,l.resolvedLanguage??l.language)?` · ${Mte(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),a(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?o.jsx("pre",{ref:c,tabIndex:0,"aria-label":a("studioBuildProgress.logContent"),onScroll:g=>{u.current=s3t(g.currentTarget)},children:o.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):o.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||a(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Lte({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:a=""}){return o.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${a?` ${a}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[o.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),o.jsxs("span",{className:"studio-package-option__content",children:[o.jsx("strong",{children:e}),t?o.jsx("span",{children:t}):null]}),o.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?o.jsx(HFe,{}):o.jsx(GFe,{})})]})}function cg(e,t){return e[t]|e[t+1]<<8}function Q0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function c3t(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 Eje(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Q0(e,u)===101010256){i=u;break}if(i<0)throw new Error($t("helpers.zip.invalid"));const r=cg(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error($t("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Q0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error($t("helpers.zip.tooLarge"));const x=cg(e,v+26),O=cg(e,v+28),w=v+30+x+O,k=e.subarray(w,w+f);let S;if(d===0)S=k;else if(d===8)S=await c3t(k);else{s+=46+m+g+b;continue}l.push({name:y,text:a.decode(S)}),s+=46+m+g+b}return l}const O8=/(^|\/)skill\.md$/i;function u3t(e){const t=(e??"").replace(/\r\n?/g,` +`),x=(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 O=Y5t(e.updatedAt,l.resolvedLanguage??l.language),w=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",S=[w,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",k,O].filter(Boolean).join(" · ");async function E(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:n}),o.jsx("span",{children:S})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(C=>!C),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void E(),"aria-label":h?a("agentWorkspace.copiedLabel",{label:r}):a("agentWorkspace.copyLabel",{label:r}),title:h?a("agentWorkspace.copied"):a("agentWorkspace.copyLabel",{label:r}),children:[h?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),o.jsx("span",{children:a(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?o.jsx("pre",{ref:c,children:y}):o.jsx("div",{className:"aw-deploy-log-empty",children:x}))]})}function Z5t({task:e}){var n;const{t}=Te("ui");return o.jsx(wje,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&xje(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function J5t({task:e}){var n;const{t}=Te("ui");return o.jsx(wje,{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 eLt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),i=vje(e,n),r=xje(e,n),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),a=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled");return o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?o.jsx(X2,{}):e.status==="running"?o.jsx(fi,{className:"spin"}):e.status==="success"?o.jsx(d7e,{}):e.status==="error"?o.jsx(X2,{}):o.jsx(h4,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:a}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:i.map((l,c)=>{const u=e.status==="success"||cnew Set),[Pt,pn]=p.useState(()=>new Set),[Jt,en]=p.useState(!1),[Un,wn]=p.useState(""),[oi,Oi]=p.useState(null),[mi,bn]=p.useState([]),[qi,ri]=p.useState([]),[zi,as]=p.useState(!1),[Lr,_r]=p.useState(""),[xs,os]=p.useState(""),[ia,Nr]=p.useState(0),[As,Vs]=p.useState([]),[Yr,ra]=p.useState(!1),[sa,ls]=p.useState(""),[va,aa]=p.useState(0),[ws,Ua]=p.useState(null),[oa,Qa]=p.useState(1),[Jn,Ni]=p.useState(!1),[Eo,xa]=p.useState(""),[Xi,Co]=p.useState(0),[xe,Xe]=p.useState(!1),[Yt,tn]=p.useState(()=>new Set),[In,mr]=p.useState(!1),[jr,_s]=p.useState(""),[Si,la]=p.useState(""),[Hs,$r]=p.useState(()=>new Set),wa=p.useRef(!1),cs=p.useRef(""),Vi=p.useRef(null),so=p.useRef(0),ao=p.useRef(0),Go=p.useRef(0),[oo,ed]=p.useState(R5t),[bc,uu]=p.useState("");p.useEffect(()=>{e.length!==0&&ed(te=>te.map((je,Ve)=>Ve===0&&je.agentIds.length===0?{...je,agentIds:e.slice(0,2).map(mt=>mt.id)}:je))},[e]);const To=p.useMemo(()=>{const te=new Map;for(const je of e)je.runtimeId&&te.set(je.runtimeId,je);return te},[e]),yc=p.useMemo(()=>{var je;const te=new Map;for(const Ve of t){const mt=(je=Ve.deploymentTarget)==null?void 0:je.runtimeId;if(!mt||!To.has(mt))continue;const dn=te.get(mt);(!dn||Ve.updatedAt>dn.updatedAt)&&te.set(mt,Ve)}return te},[To,t]),Cl=p.useMemo(()=>{const te=new Map;for(const je of f){if(!je.runtimeId)continue;const Ve=te.get(je.runtimeId);(!Ve||je.startedAt>Ve.startedAt)&&te.set(je.runtimeId,je)}return te},[f]),td=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return te?e.filter(je=>{const Ve=je.runtimeId?yc.get(je.runtimeId):void 0,mt=je.runtimeId?Cl.get(je.runtimeId):void 0;return[je.label,je.app,je.host??"",(Ve==null?void 0:Ve.draft.name)??"",(Ve==null?void 0:Ve.draft.description)??"",(mt==null?void 0:mt.runtimeName)??""].join(" ").toLowerCase().includes(te)}):e},[e,Cl,Ue,yc]),Oa=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return t.filter(je=>{var mt;const Ve=(mt=je.deploymentTarget)==null?void 0:mt.runtimeId;return Ve&&To.has(Ve)?!1:te?`${je.draft.name} ${je.draft.description}`.toLowerCase().includes(te):!0})},[To,t,Ue]),Wh=p.useMemo(()=>t.filter(te=>{var Ve;const je=(Ve=te.deploymentTarget)==null?void 0:Ve.runtimeId;return!je||!To.has(je)}).length,[To,t]),Gh=p.useMemo(()=>{const te=Ue.trim().toLowerCase();return te?oo.filter(je=>je.name.toLowerCase().includes(te)):oo},[oo,Ue]),ce=e.find(te=>te.id===I),li=t.find(te=>te.id===K),ci=h?f.find(te=>te.id===h):void 0,Sa=ce!=null&&ce.runtimeId?yc.get(ce.runtimeId):void 0,Hn=y?ln:I&&r===I?i:null,ji=(Hn==null?void 0:Hn.appName)||(ce==null?void 0:ce.runtimeApp)||(ce==null?void 0:ce.app)||"",vc=(c&&(ce!=null&&ce.runtimeId)?mte:mte.filter(te=>te!=="usage")).map(te=>({id:te,label:T(`agentWorkspace.sections.${te}`)})),du=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"cn-beijing",ji,oa]),us=(ws==null?void 0:ws.requestKey)===du?ws.value:null,Tl=`${(ce==null?void 0:ce.region)??"cn-beijing"}:${(ce==null?void 0:ce.runtimeId)??""}`,xc=(ke==null?void 0:ke.requestKey)===Tl?ke.value:"",Sr=(ee==null?void 0:ee.requestKey)===Tl?ee:null,Qn=!!((f0=Sr==null?void 0:Sr.apiApps)!=null&&f0.length),za=!!(Sr!=null&&Sr.a2a),rf=((rC=Sr==null?void 0:Sr.apiApps)==null?void 0:rC[0])??ji,Al=(q==null?void 0:q.endpoint)??"",be=M5t(((kc=Sr==null?void 0:Sr.a2a)==null?void 0:kc.endpoint)??"",Al),Ye=(ce==null?void 0:ce.runtimeApp)||"",Ct=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"",(ce==null?void 0:ce.currentVersion)??null,Ye]),_n=l&&(ce!=null&&ce.runtimeId)&&ce.region&&$e===0?T4({runtimeId:ce.runtimeId,region:ce.region,appName:Ye,currentVersion:ce.currentVersion}):null,Dt=(Se==null?void 0:Se.requestKey)===Ct?Se.value:_n,fn=Dt!=null&&Dt.reason?jd(Dt.reason,P.resolvedLanguage||P.language):"",On=(Dt==null?void 0:Dt.warnings.filter(te=>jd(te,P.resolvedLanguage||P.language)))??[];p.useEffect(()=>{const te=so.current+1;so.current=te,ve(null),Wt("");const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"";if(!l||!je||!Ve){Je(!1);return}const mt=$e===0?T4({runtimeId:je,region:Ve,appName:Ye,currentVersion:ce==null?void 0:ce.currentVersion}):null;if(mt){ve({requestKey:Ct,value:mt}),Je(!1);return}const dn=new AbortController;let nt,ei=0;const ua=60;Je(!0);const Xn=Ns=>{oR({runtimeId:je,region:Ve,appName:Ye,currentVersion:ce==null?void 0:ce.currentVersion,signal:dn.signal,force:Ns&&$e>0}).then(Ao=>{var oC,Gm;if(te!==so.current)return;const m1=Ao.recoveryStatus==="preparing";if(Ao.runtime.runtimeId!==je||Ao.runtime.region!==Ve||!m1&&Ye&&((oC=Ao.agent)==null?void 0:oC.appName)!==Ye||Ao.canUpdate&&!((Gm=Ao.agent)!=null&&Gm.appName)){Wt(T("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ve({requestKey:Ct,value:Ao}),Je(!1),!!m1){if(ei+=1,ei>=ua){Wt(T("agentWorkspace.errors.updateConfigRestoring"));return}nt=window.setTimeout(()=>Xn(!1),1e3)}}).catch(()=>{te!==so.current||dn.signal.aborted||Wt(T("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{te===so.current&&!dn.signal.aborted&&Je(!1)})};return Xn(!0),()=>{dn.abort(),nt!=null&&window.clearTimeout(nt)}},[l,Ye,$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,Ct]);const Y=p.useMemo(()=>{const te=new Map(e.map((Ve,mt)=>[Ve.id,mt])),je=new Map(n.map((Ve,mt)=>[Ve,mt]));return[...td].sort((Ve,mt)=>{const dn=Ve.runtimeId?Cl.get(Ve.runtimeId):void 0,nt=mt.runtimeId?Cl.get(mt.runtimeId):void 0,ei=(dn==null?void 0:dn.status)==="running"?dn.startedAt:0,ua=(nt==null?void 0:nt.status)==="running"?nt.startedAt:0;if(ei!==ua)return ua-ei;const Xn=je.get(Ve.id),Ns=je.get(mt.id);return Xn!=null&&Ns!=null?Xn-Ns:Xn!=null?-1:Ns!=null?1:(te.get(Ve.id)??0)-(te.get(mt.id)??0)})},[n,e,td,Cl]),we=(ce==null?void 0:ce.label)||(Hn==null?void 0:Hn.name)||(li==null?void 0:li.draft.name)||(ci==null?void 0:ci.agentName)||((sC=ci==null?void 0:ci.agentDraft)==null?void 0:sC.name)||T("agentWorkspace.noAgentSelected"),Ge=oo.find(te=>te.id===bc),_t=Y.filter(te=>te.canDelete===!0),un=Y.filter(te=>Ki.has(te.id)&&te.canDelete===!0),Nn=Oa.filter(te=>Pt.has(te.id)),Yi=_t.length+Oa.length,Ri=un.length+Nn.length,Kn=p.useMemo(()=>{var je;if(ci!=null&&ci.agentDraft)return ci.agentDraft;if(li!=null&&li.draft)return li.draft;const te=(je=ce==null?void 0:ce.region)!=null&&je.startsWith("ap-")?"byteplus":"volcengine";return Dt!=null&&Dt.agent&&(Dt.recoveryStatus==="complete"||Dt.recoveryStatus==="draft-only")?CB(Dt.agent,te,Dt.runtime.configuredEnvKeys):U5t(Hn,ji||(ce==null?void 0:ce.label)||"agent",te)},[Hn,ji,ce==null?void 0:ce.label,ce==null?void 0:ce.region,li==null?void 0:li.draft,ci==null?void 0:ci.agentDraft,Dt]),zn=((Yh=Hn==null?void 0:Hn.draft)==null?void 0:Yh.harnessSidecar)??$st(q==null?void 0:q.envs),ds=zn?Ux.filter(te=>zn.componentOverrides[te]):[],$n=li?a?"":T("agentWorkspace.errors.noCreatePermission"):l?ce!=null&&ce.runtimeId?ce.region?He?T("agentWorkspace.errors.checkingUpdateConfig"):Ce||(Dt?Dt.recoveryStatus!=="complete"&&Dt.recoveryStatus!=="draft-only"?fn||T("agentWorkspace.errors.originalConfigUnavailable"):Dt.canUpdate?(aC=Dt.agent)!=null&&aC.appName?"":T("agentWorkspace.errors.agentInfoMissing"):fn||T("agentWorkspace.errors.updateUnsupported"):T("agentWorkspace.errors.updateCapabilityPending")):T("agentWorkspace.errors.runtimeRegionMissing"):T("agentWorkspace.errors.cloudOnlyUpdate"):T("agentWorkspace.errors.noManagePermission"),ca="aw-update-disabled-reason",lt=p.useMemo(()=>{if(Hn)return Hn.tools;const te=(Kn.builtinTools??[]).map(je=>{var Ve;return((Ve=Bx.find(mt=>mt.id===je))==null?void 0:Ve.label)??je});return Array.from(new Set([...Kn.tools,...te,...(Kn.customTools??[]).map(je=>je.name),...(Kn.mcpTools??[]).map(je=>je.name)].filter(Boolean)))},[Kn,Hn]),Sn=p.useMemo(()=>Hn?Hn.skillsPreviewSupported?Hn.skills.map(te=>te.name):null:Array.from(new Set([...(Kn.selectedSkills??[]).map(te=>te.name),...Kn.skills].filter(Boolean))),[Kn,Hn]),Qt=p.useMemo(()=>{if(ci)return ci;if(li){const te=f.filter(je=>je.draftId===li.id).sort((je,Ve)=>Ve.startedAt-je.startedAt)[0];return te||f.filter(je=>{var Ve,mt;return((Ve=je.agentDraft)==null?void 0:Ve.name)===li.draft.name||je.agentName===li.draft.name||!!((mt=li.deploymentTarget)!=null&&mt.runtimeId)&&je.runtimeId===li.deploymentTarget.runtimeId}).sort((je,Ve)=>Ve.startedAt-je.startedAt)[0]}if(ce)return f.filter(te=>!!ce.runtimeId&&te.runtimeId===ce.runtimeId||te.agentName===ce.label).sort((te,je)=>je.startedAt-te.startedAt)[0]},[f,ce,li,ci]),si=!!(h&&Qt&&Qt.id===h),fs=!!(Qt&&(Qt.status!=="success"||si)),or=(Qt==null?void 0:Qt.status)==="running",hs=Qt!=null&&Qt.draftId?t.find(te=>te.id===Qt.draftId)??(Qt.agentDraft?{id:Qt.draftId,draft:Qt.agentDraft,updatedAt:Qt.startedAt}:void 0):void 0,wc=p.useMemo(()=>G5t(Kn),[Kn]),Oc=(ce==null?void 0:ce.currentVersion)??(q==null?void 0:q.currentVersion)??null,Kh=Oc??(ci==null?void 0:ci.startedAt)??"unknown",Ko=Hn?`runtime:${(ce==null?void 0:ce.runtimeId)??Hn.name}:v${Kh}:${wc}`:`draft:${(ci==null?void 0:ci.id)??(li==null?void 0:li.id)??(ce==null?void 0:ce.id)??we}:${wc}`;p.useEffect(()=>{M==="usage"&&!c&&U("basic")},[c,M]),p.useEffect(()=>{if(!h)return;const te=f.find(Ve=>Ve.id===h),je=te!=null&&te.runtimeId?To.get(te.runtimeId):void 0;if(je){Q(""),H(je.id),U("basic");return}H(""),Q(""),U("basic")},[To,f,h]),p.useEffect(()=>{if(!m){cs.current="";return}const te=`${m}:${g}:${b}:${c}`;cs.current!==te&&e.some(je=>je.id===m)&&(cs.current=te,Q(""),H(m),U(g==="usage"&&!c?"basic":g),g==="evaluations"&&(ut(b),Rt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const te of Y.slice(0,8)){if(!te.runtimeId)continue;const je=te.region??"cn-beijing";sye(te.runtimeId,je),r0e(te.runtimeId,je,te.runtimeApp??"")}},[Y]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=(ce==null?void 0:ce.runtimeApp)??"",dn=je?i0e(je,Ve,mt):null;if(cn(dn),gt(""),Et(!1),jt(!!dn||!y||!je),!(!y||!je))return YF(je,Ve,mt,{force:!0}).then(nt=>{te||cn(nt)}).catch(nt=>{!te&&!dn&&cn(null),te||(Et(nt instanceof Ds&&nt.unsupported),gt(T("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{te||jt(!0)}),()=>{te=!0}},[y,$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeApp,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing";if(Vs([]),ls(""),M!=="optimizations"||!je){ra(!1);return}if(y&&!ji){ra(!Ot);return}return ra(!0),Wbe({runtimeId:je,region:Ve,appName:ji}).then(mt=>{te||Vs(mt.groups)}).catch(()=>{te||ls(T("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{te||ra(!1)}),()=>{te=!0}},[Ot,y,va,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{Qa(1)},[ce==null?void 0:ce.runtimeId,ji]),p.useEffect(()=>{const te=Go.current+1;Go.current=te;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=ji;if(xa(""),M!=="usage"||!je){Ni(!1);return}if(!mt){Ni(y&&!Ot);return}const dn=new AbortController;return Ni(!0),q0e({runtimeId:je,region:Ve,appName:mt,page:oa,pageSize:P5t,signal:dn.signal}).then(nt=>{if(te===Go.current){if(nt.runtimeId!==je||nt.appName!==mt||nt.page!==oa){xa(T("agentWorkspace.errors.usageMismatch"));return}Ua({requestKey:du,value:nt})}}).catch(()=>{te!==Go.current||dn.signal.aborted||xa(T("agentWorkspace.errors.loadUsage"))}).finally(()=>{te===Go.current&&Ni(!1)}),()=>{dn.abort()}},[oa,Xi,du,Ot,y,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{ao.current+=1,st(null),Me(!1),qe(!1),ze(""),Oe("api-server")},[Tl,M]);function fu(){ao.current+=1,st(null),Me(!1),qe(!1),ze("")}function sf(te){te!==ue&&(fu(),Oe(te))}async function af(){if(Le){fu();return}const te=(ce==null?void 0:ce.runtimeId)??"",je=(ce==null?void 0:ce.region)??"cn-beijing";if(!te)return;const Ve=ao.current+1;ao.current=Ve,qe(!0),ze("");try{const mt=await nye(te,je);if(Ve!==ao.current)return;st({requestKey:Tl,value:mt}),Me(!0)}catch(mt){if(Ve!==ao.current)return;st(null),Me(!1),ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.loadApiKey"))}finally{Ve===ao.current&&qe(!1)}}p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=je?rye(je,Ve):null;if(B(mt),Mt(""),!!je)return r7(je,Ve,{force:!0}).then(dn=>{te||B(dn)}).catch(()=>{!te&&!mt&&B(null),te||Mt(T("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{te=!0}},[$e,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"";if(Ze(""),M!=="versions"||!je){he(!1),je||De(null);return}return he(!0),nA(je).then(Ve=>{te||De(Ve)}).catch(()=>{te||(De(null),Ze(T("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{te||he(!1)}),()=>{te=!0}},[M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=`${Ve}:${je}`;if(W(""),M!=="integrations"||!je){re(!1),je||le(null);return}re(!0);const dn=Fv(je,Ve,{retryProbe:!0}).catch(nt=>{if(nt instanceof Ds&&nt.unsupported)return null;throw nt});return Promise.all([dn,tye(je,Ve,{retryProbe:!0})]).then(([nt,ei])=>{te||le({requestKey:mt,apiApps:nt,a2a:ei})}).catch(()=>{te||(le(null),W(T("agentWorkspace.errors.probeIntegration")))}).finally(()=>{te||re(!1)}),()=>{te=!0}},[X,M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Ve=(ce==null?void 0:ce.region)??"cn-beijing",mt=je&&ji?Gbe({runtimeId:je,region:Ve,appName:ji,pageSize:100}):null;if(bn(mt?xte(mt,T):[]),ri((mt==null?void 0:mt.sets)??[]),_r(""),os((mt==null?void 0:mt.unsupportedMessage)??""),M!=="evaluations"||!je){as(!1);return}if(y&&!ji){as(!Ot);return}return as(!mt),rR({runtimeId:je,region:Ve,appName:ji,pageSize:100},{force:!0}).then(dn=>{te||(ri(dn.sets),bn(xte(dn,T)),os(dn.unsupportedMessage??""))}).catch(()=>{te||(_r(T("agentWorkspace.errors.loadEvaluations")),os(""))}).finally(()=>{te||as(!1)}),()=>{te=!0}},[Ot,y,ia,M,ji,Hn==null?void 0:Hn.appName,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,T]);async function Sc(te){const je=(ce==null?void 0:ce.runtimeId)??"",Ve=te.commitSha??"";if(!(!je||!Ve||at)){wt(Ve),Ze("");try{await L0e({runtimeId:je,targetCommitSha:Ve});const mt=await nA(je);De(mt)}catch(mt){Ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.rollbackVersion"))}finally{wt("")}}}p.useEffect(()=>{const te=new Set(mi.map(je=>je.id));tn(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve}),$r(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve}),Si&&!te.has(Si)&&la("")},[mi,Si]),p.useEffect(()=>{Xe(!1),tn(new Set),$r(new Set),_s(""),la("")},[ce==null?void 0:ce.runtimeId]),p.useEffect(()=>{const te=new Set(Y.filter(je=>je.canDelete===!0).map(je=>je.id));Fe(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve})},[Y]),p.useEffect(()=>{const te=new Set(Oa.map(je=>je.id));pn(je=>{const Ve=new Set([...je].filter(mt=>te.has(mt)));return Ve.size===je.size?je:Ve})},[Oa]);const Xo=p.useMemo(()=>!v||!(ce!=null&&ce.runtimeId)||v.runtimeId!==ce.runtimeId||ji&&v.agentName&&v.agentName!==ji?null:{...v,tag:T(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,ce==null?void 0:ce.runtimeId,ji,T]),lo=p.useMemo(()=>j5t(T),[T]),ka=p.useMemo(()=>ce!=null&&ce.runtimeId?Xo?[Xo,...mi.filter(te=>te.id!==Xo.id&&(!te.messageId||te.messageId!==Xo.messageId))]:mi:lo,[lo,mi,Xo,ce==null?void 0:ce.runtimeId]),_l=ka.filter(te=>{if(te.kind!==ft||(te.source==="auto"?"auto":"user")!==zt)return!1;const Ve=Gt.trim().toLowerCase();return Ve?[te.input,te.output,te.referenceOutput,te.comment,te.tag??"",te.sessionId,te.messageId,te.userId,te.evaluationSetName].join(" ").toLowerCase().includes(Ve):!0}),of=_l.filter(te=>Yt.has(te.id)),qm=!!(ce!=null&&ce.runtimeId),lf=te=>{ut(te),Rt(""),_s("");const je=ka.find(Ve=>Ve.kind===te);la((je==null?void 0:je.id)??""),window.setTimeout(()=>{var Ve;(Ve=Vi.current)==null||Ve.scrollIntoView({behavior:"smooth",block:"start"})},0)},Fr=te=>{_s(""),tn(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve})},cf=()=>{_s(""),tn(new Set(_l.map(te=>te.id)))},eP=()=>{_s(""),tn(new Set),Xe(!1)},Br=te=>{$r(je=>{const Ve=new Set(je);return Ve.has(te)?Ve.delete(te):Ve.add(te),Ve})},l0=te=>{la(te.id),_s(""),!(!te.sessionId||!te.messageId)&&(N==null||N(te))},YE=async te=>{if(!(ce!=null&&ce.runtimeId)||!ji||In||te.length===0)return;const je=te.length===1?T("agentWorkspace.deleteOneCaseConfirm"):T("agentWorkspace.deleteCasesConfirm",{count:te.length});if(!window.confirm(je))return;const Ve=te.map(dn=>dn.id),mt=new Set(Ve);mr(!0),_s("");try{await Ybe({runtimeId:ce.runtimeId,region:ce.region??"cn-beijing",appName:ji,itemIds:Ve});const dn=new Map;for(const nt of te)dn.set(nt.kind,(dn.get(nt.kind)??0)+1);bn(nt=>nt.filter(ei=>!mt.has(ei.id))),ri(nt=>nt.map(ei=>({...ei,itemCount:Math.max(0,ei.itemCount-(dn.get(ei.kind)??0))}))),tn(nt=>new Set([...nt].filter(ei=>!mt.has(ei)))),$r(nt=>new Set([...nt].filter(ei=>!mt.has(ei)))),Si&&mt.has(Si)&&la(""),te.length>1&&Xe(!1),_==null||_(te)}catch(dn){_s(dn instanceof Error?dn.message:String(dn))}finally{mr(!1)}},h1=te=>{ed(je=>je.map(Ve=>Ve.id===te.id?te:Ve))},ZE=()=>{const te=new Set(e.map(mt=>mt.id)),je=n.filter(mt=>te.has(mt)),Ve=new Set(je);return[...je,...e.filter(mt=>!Ve.has(mt.id)).map(mt=>mt.id)]},JE=(te,je,Ve)=>{if(!w||te===je)return;const mt=ZE().filter(ei=>ei!==te),dn=mt.indexOf(je),nt=dn<0?mt.length:Ve==="after"?dn+1:dn;mt.splice(nt,0,te),w(mt)},eC=(te,je)=>{if(!Bt||Bt===je)return;const Ve=te.currentTarget.getBoundingClientRect();ht(je),We(te.clientY>Ve.top+Ve.height/2?"after":"before")},Wm=(te,je)=>{if(!w)return;const Ve=ZE(),mt=Ve.indexOf(te),dn=Math.max(0,Math.min(Ve.length-1,mt+je));mt<0||mt===dn||(Ve.splice(mt,1),Ve.splice(dn,0,te),w(Ve))},c0=te=>{te.canDelete===!0&&(wn(""),Fe(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve}))},tC=te=>{wn(""),pn(je=>{const Ve=new Set(je);return Ve.has(te.id)?Ve.delete(te.id):Ve.add(te.id),Ve})},nC=()=>{wn(""),Fe(new Set(_t.map(te=>te.id))),pn(new Set(Oa.map(te=>te.id)))},Lt=()=>{wn(""),Fe(new Set),pn(new Set),vn(!1)},u0=()=>{if(Ri===0||Jt)return;const te=un.length,je=Nn.length;wn(""),Oi({kind:"selection",title:T(te===1&&je===0?"agentWorkspace.deleteAgentTitle":te===0&&je===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:te===1&&je===0?T("agentWorkspace.deleteAgentDescription",{name:un[0].label}):te===0&&je===1?T("agentWorkspace.deleteDraftDescription",{name:Nn[0].draft.name||T("agentSelector.unnamedAgent")}):T("agentWorkspace.deleteSelectionDescription",{count:Ri,warning:te>0?T("agentWorkspace.runtimeDeletionWarning",{count:te}):T("agentWorkspace.draftDeletionWarning")}),confirmLabel:T(te===0&&je===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:un,drafts:Nn})},p1=async()=>{if(!(!oi||Jt)){en(!0),wn("");try{if(oi.kind==="selection"){const{agents:te,drafts:je}=oi;if(te.length>0){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k(te)}je.length>0&&(S==null||S(je)),Fe(new Set),pn(new Set),vn(!1),te.some(Ve=>Ve.id===I)&&H(""),je.some(Ve=>Ve.id===K)&&Q("")}else if(oi.kind==="agent"){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k([oi.agent]),I===oi.agent.id&&H("")}else{if(!S)throw new Error(T("agentWorkspace.errors.deleteDraftUnsupported"));S([oi.draft]),K===oi.draft.id&&Q("")}Oi(null)}catch(te){wn(te instanceof Error?te.message:String(te))}finally{en(!1)}}},d0=te=>{!k||te.canDelete!==!0||Jt||(wn(""),Oi({kind:"agent",title:T("agentWorkspace.deleteAgentTitle"),description:T("agentWorkspace.deleteAgentDescription",{name:te.label}),confirmLabel:T("agentWorkspace.deleteAgent"),agent:te}))},Wi=te=>{if(!S||Jt)return;const je=te.draft.name||T("agentSelector.unnamedAgent");wn(""),Oi({kind:"draft",title:T("myAgents.deleteDraftTitle"),description:T("agentWorkspace.deleteDraftDescription",{name:je}),confirmLabel:T("myAgents.deleteDraft"),draft:te})},Xh=()=>{const te=`eval-${Date.now()}`,je={id:te,name:T("agentWorkspace.newEvaluationGroupName",{count:oo.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};ed(Ve=>[je,...Ve]),uu(te)},iC=te=>{h1({...te,history:[{id:`run-${Date.now()}`,createdAt:T("agentWorkspace.evaluationDefaults.justNow"),score:86+te.history.length%7,status:"completed"},...te.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${y?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":T("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:R==="library"?"is-active":"","aria-pressed":R==="library",onClick:()=>{L("library"),Ke("")},children:T("agentWorkspace.library")}),o.jsx("button",{type:"button",className:R==="evaluation"?"is-active":"","aria-pressed":R==="evaluation",onClick:()=>{L("evaluation"),Ke("")},children:T("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":R==="evaluation"||void 0,ref:te=>{te==null||te.toggleAttribute("inert",R==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":T(R==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{value:Ue,onChange:te=>Ke(te.currentTarget.value),placeholder:T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:R==="library"?j:Xh,disabled:R==="library"&&!a,children:[o.jsx(Fo,{"aria-hidden":!0}),o.jsx("span",{children:T(R==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),R==="library"&&(k||S)&&o.jsx("div",{className:`aw-selection-toolbar${vt?" is-active":""}`,children:vt?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCount",{count:Ri})}),o.jsx("button",{type:"button",onClick:nC,disabled:Yi===0||Jt,children:T("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void u0(),disabled:Ri===0||Jt,children:T(Jt?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:Lt,disabled:Jt,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{wn(""),vn(!0)},disabled:Yi===0,children:T("common.select")})}),R==="library"&&Un&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Un}),o.jsx("div",{className:"aw-agent-list",children:R==="evaluation"?Gh.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.noMatchingEvaluationGroups")}):Gh.map(te=>o.jsxs("button",{type:"button",className:`aw-agent-item${te.id===bc?" is-active":""}`,onClick:()=>uu(te.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:Ww(te.name,T)}),o.jsx("small",{children:T("agentWorkspace.groupStats",{agents:te.agentIds.length,runs:te.history.length})})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)):u&&Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.loadingCloudAgents")}):d&&Y.length===0&&Oa.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),O&&o.jsx("button",{type:"button",onClick:O,children:T("common.retry")})]}):Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Oa.map(te=>{const Ve=f.filter(dn=>dn.draftId===te.id).sort((dn,nt)=>nt.startedAt-dn.startedAt)[0]??f.filter(dn=>{var nt,ei;return((nt=dn.agentDraft)==null?void 0:nt.name)===te.draft.name||dn.agentName===te.draft.name||!!((ei=te.deploymentTarget)!=null&&ei.runtimeId)&&dn.runtimeId===te.deploymentTarget.runtimeId}).sort((dn,nt)=>nt.startedAt-dn.startedAt)[0],mt=Pt.has(te.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",vt?"is-selecting":"",mt?"is-selected-for-delete":"",te.id===K?"is-active":""].filter(Boolean).join(" "),"aria-pressed":vt?mt:void 0,onClick:()=>{if(vt){tC(te);return}H(""),Q(te.id),U("basic")},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:te.draft.name||T("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(Ve==null?void 0:Ve.status)==="running"?" is-deploying":""}`,children:(Ve==null?void 0:Ve.status)==="running"?T("myAgents.deploying"):T("myAgents.draft")})]}),o.jsx("small",{children:te.deploymentTarget?T("agentWorkspace.updatePending"):T("agentWorkspace.notPublished")})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)}),Y.map(te=>{const je=te.runtimeId?Cl.get(te.runtimeId):void 0,Ve=te.runtimeId?yc.get(te.runtimeId):void 0,mt=Ki.has(te.id),dn=te.canDelete===!0,nt=(je==null?void 0:je.status)==="running"?{label:T("myAgents.deploying"),className:" is-deploying"}:(je==null?void 0:je.status)==="error"?{label:T("agentWorkspace.failed"),className:" is-error"}:(je==null?void 0:je.status)==="cancelled"?{label:T("agentWorkspace.cancelled"),className:" is-muted"}:Ve?{label:T("agentWorkspace.updatePending"),className:""}:null,ei=(je==null?void 0:je.status)==="running"?T("agentWorkspace.updatingDeployment"):Ve?T("agentWorkspace.updatePending"):te.remote?te.host||T("agentWorkspace.remoteAgent"):T("agentWorkspace.localAgent"),ua=["aw-agent-item","aw-agent-item--sortable",te.id===I?"is-active":"",vt?"is-selecting":"",mt?"is-selected-for-delete":"",vt&&!dn?"is-selection-disabled":"",te.id===Bt?"is-dragging":"",te.id===tt&&te.id!==Bt?`is-drop-target is-drop-${pe}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!w&&!vt,className:ua,"aria-pressed":vt?mt:void 0,"aria-keyshortcuts":w?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Xn=>{w&&(wa.current=!0,Qe(te.id),Xn.dataTransfer.effectAllowed="move",Xn.dataTransfer.setData("text/plain",te.id))},onDragEnter:Xn=>{eC(Xn,te.id)},onDragOver:Xn=>{!Bt||Bt===te.id||(Xn.preventDefault(),Xn.dataTransfer.dropEffect="move",eC(Xn,te.id))},onDragLeave:Xn=>{const Ns=Xn.relatedTarget;Ns instanceof Node&&Xn.currentTarget.contains(Ns)||tt===te.id&&ht("")},onDrop:Xn=>{Xn.preventDefault();const Ns=Xn.dataTransfer.getData("text/plain")||Bt;JE(Ns,te.id,pe),Qe(""),ht(""),We("before")},onDragEnd:()=>{Qe(""),ht(""),We("before"),window.setTimeout(()=>{wa.current=!1},0)},onKeyDown:Xn=>{Xn.altKey&&(Xn.key==="ArrowUp"?(Xn.preventDefault(),Wm(te.id,-1)):Xn.key==="ArrowDown"&&(Xn.preventDefault(),Wm(te.id,1)))},onClick:Xn=>{if(vt){Xn.preventDefault(),c0(te);return}if(wa.current){Xn.preventDefault(),wa.current=!1;return}Q(""),H(te.id),U("basic"),E(te.id)},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:te.label}),te.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",te.currentVersion]}),nt&&o.jsx("span",{className:`aw-draft-badge${nt.className}`,children:nt.label})]}),o.jsx("small",{children:ei})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)})]})}),o.jsx("div",{className:"aw-list-count",children:T("agentWorkspace.totalCount",{count:R==="library"?e.length+Wh:oo.length})})]}),R==="evaluation"&&Ge?o.jsx(sLt,{group:Ge,agents:e,cases:ka,onChange:h1,onRun:iC}):R==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noEvaluationGroupSelected")})}):!ce&&!li&&!ci?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${or?" is-deploying":""}${y?" resource-page":""}`,children:[ce&&!Hn&&s&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:T("agentWorkspace.loadingAgent")}),o.jsx("small",{children:T("agentWorkspace.loadingAgentDescription")})]})]})}),M==="integrations"&&se&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:T("agentWorkspace.probingIntegration")}),o.jsx("small",{children:T("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(uE,{className:"aw-agent-detail",title:we,description:Kn.description||T(s||y&&!Ot?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:we,backLabel:T("agentWorkspace.backToAgentList"),onBack:y?x:void 0,meta:o.jsxs(o.Fragment,{children:[Oc!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",Oc]}),li&&o.jsx("span",{className:"aw-agent-meta",children:T("myAgents.draft")}),Sa&&o.jsx("span",{className:"aw-agent-meta",children:T("agentWorkspace.updatePending")}),!ce&&!li&&ci&&o.jsx("span",{className:"aw-agent-meta",children:ci.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:li||Sa||ce!=null&&ce.canDelete?o.jsxs(o.Fragment,{children:[(li||Sa)&&o.jsxs(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const te=li??Sa;te&&Wi(te)},disabled:Jt,"aria-label":T("myAgents.deleteDraft"),title:T("myAgents.deleteDraft"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T("myAgents.deleteDraft")})]}),(ce==null?void 0:ce.canDelete)&&o.jsxs(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void d0(ce),disabled:Jt,"aria-label":T("agentWorkspace.deleteAgent"),title:T("agentWorkspace.deleteAgent"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T(Jt?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:vc.map(te=>{var je,Ve,mt,dn;return{key:te.id,label:te.label,disabled:or,content:te.id===M?o.jsxs(o.Fragment,{children:[Qt&&fs&&o.jsx("div",{className:`aw-detail-deployment${or?" is-running":""}`,children:o.jsx(eLt,{task:Qt,onReturnToEdit:hs&&F?()=>F(hs):void 0})}),o.jsxs("div",{className:"aw-content",children:[M==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[Pe&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:T("agentWorkspace.partialInfoUnavailable"),description:T("agentWorkspace.upgradeRuntimeForDetails")}),(ot&&!Pe||bt)&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:T("agentWorkspace.detailLoadFailed"),description:T("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>ye(nt=>nt+1),children:T("common.retry")})}),ce&&Dt&&!Dt.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:Dt.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:Dt.recoveryStatus==="preparing"?T("agentWorkspace.restoringUpdateConfig"):T("agentWorkspace.updateConfigUnavailable")}),fn&&o.jsx("span",{children:fn}),On.map(nt=>o.jsx("span",{children:nt},nt))]}),o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:T("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.runtimeStatus")}),o.jsxs("dd",{className:(q==null?void 0:q.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(q==null?void 0:q.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(q==null?void 0:q.status)||T("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(ce==null?void 0:ce.region)||(Qt==null?void 0:Qt.region)||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):T("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(LS,{draft:Kn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Ko)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.model")}),o.jsx("dd",{children:EB(Hn==null?void 0:Hn.model)||Kn.modelName||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:Hn!=null&&Hn.graph?bje(Hn.graph):yje(Kn)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:lt.length?lt.map(nt=>o.jsx("span",{children:nt},nt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:Sn===null?T("agentSelector.previewUnsupported"):Sn.length?Sn.map(nt=>o.jsx("span",{children:nt},nt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("systemInfo.currentVersion")}),o.jsx("dd",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.status")}),o.jsx("dd",{children:li?T("myAgents.draft"):(Qt==null?void 0:Qt.status)==="error"?T("agentWorkspace.deploymentFailed"):(Qt==null?void 0:Qt.status)==="cancelled"?T("agentWorkspace.cancelled"):Sa?T("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":T("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:T("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:zn!=null&&zn.enabled?"is-ready":void 0,children:zn?zn.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.enabled")]}):T("skillCenter.status.inactive"):T("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:zn?Mst(zn.profile):T("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:zn?ds.length?ds.map(nt=>o.jsx("span",{children:mA(nt)},nt)):T("agentWorkspace.noneSelected"):T("agentWorkspace.legacyConfigMissing")})]})]})]})]}),M==="usage"&&(ce==null?void 0:ce.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Jn,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:T("agentWorkspace.usageOverview")})}),Jn&&!us&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:T("agentWorkspace.loadingUsage")})}),Eo&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:Eo}),o.jsx("button",{type:"button",onClick:()=>Co(nt=>nt+1),children:T("common.retry")})]}),!Jn&&!Eo&&!us&&!ji&&o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.usageUnavailable")}),us&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":T("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.totalCalls")}),o.jsx("dd",{children:us.totalInvocations.toLocaleString(P.resolvedLanguage??P.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.userCount")}),o.jsx("dd",{children:us.totalUsers.toLocaleString(P.resolvedLanguage??P.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:T("agentWorkspace.userDetails")}),Jn&&o.jsx(xn,{as:"span",role:"status","aria-live":"polite",children:T("agentWorkspace.refreshing")})]}),us.users.length===0?o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:T("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:T("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:us.users.map(nt=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:nt.displayName||nt.userId||T("agentWorkspace.unknownUser")}),nt.displayName&&nt.userId&&o.jsx("small",{title:nt.userId,children:nt.userId})]}),o.jsx("td",{children:nt.invocationCount.toLocaleString(P.resolvedLanguage??P.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:nt.lastUsedAt,children:D5t(nt.lastUsedAt,P.resolvedLanguage??P.language,T)})})]},nt.userId))})]})}),us.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":T("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Jn||us.page<=1,onClick:()=>Qa(nt=>Math.max(1,nt-1)),children:T("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:T("agentWorkspace.pageOf",{page:us.page,total:us.totalPages})}),o.jsx("button",{type:"button",disabled:Jn||us.page>=us.totalPages,onClick:()=>Qa(nt=>nt+1),children:T("common.nextPage")})]})]})]}),M==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.githubVersions")}),o.jsx("p",{children:(je=Ee==null?void 0:Ee.cicd)!=null&&je.enabled?T("agentWorkspace.githubVersionsDescription"):T("agentWorkspace.currentVersionOnly")})]}),J&&o.jsx("div",{className:"aw-case-empty",children:T("agentWorkspace.loadingVersions")}),_e&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:_e}),(ce==null?void 0:ce.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void nA(ce.runtimeId??"").then(De),children:T("common.retry")})]}),!J&&!_e&&o.jsxs("div",{className:"aw-version-list",children:[(Ee==null?void 0:Ee.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:Ee.githubSyncError})}),(Ee==null?void 0:Ee.latestSourceRuntimeStatus)&&Ee.latestSourceRuntimeStatus!=="published"&&((Ve=Ee.versions[0])==null?void 0:Ve.commitSha)&&Ee.versions[0].commitSha!==Ee.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[T("agentWorkspace.sourceMergedRuntimeStill"),bte(Ee.latestSourceRuntimeStatus,T),T("agentWorkspace.currentProductionVersionHint")]})}),Ee!=null&&Ee.versions.length?Ee.versions.map(nt=>{var Ao;const ei=nt.commitSha??"",ua=nt.runtimeStatus??nt.status,Xn=nt.changeType==="rollback",Ns=!!((Ao=Ee.cicd)!=null&&Ao.enabled)&&!!ei&&!Xn&&ei!==Ee.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:L5t(nt,T)}),o.jsx("small",{children:nt.createdAt||T("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.prLink")}),nt.pullRequestUrl?o.jsx("a",{href:nt.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewPr")}):o.jsx("em",{children:T("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.author")}),o.jsx("em",{children:nt.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.publishStatus")}),o.jsx("em",{children:bte(ua,T)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Ns||at===ei,onClick:()=>void Sc(nt),children:T(at===ei?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),nt.workflowRunUrl&&o.jsx("a",{href:nt.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewRelease")})]})]},`${nt.version}-${ei||nt.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||T("agentWorkspace.noTime")})]}),o.jsx("p",{children:T("agentWorkspace.currentVersionOnly")})]})]})]}),M==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.integrationMethods")}),o.jsx("p",{children:T("agentWorkspace.integrationDescription")})]}),ge&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ge}),o.jsx("button",{type:"button",onClick:()=>ae(nt=>nt+1),children:T("common.retry")})]}),!ge&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":T("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),sw.map((nt,ei)=>o.jsx("button",{type:"button",id:`integration-${nt.id}-tab`,role:"tab","aria-selected":ue===nt.id,"aria-controls":`integration-${nt.id}-panel`,tabIndex:ue===nt.id?0:-1,onClick:()=>sf(nt.id),onKeyDown:ua=>{var Ao;if(!["ArrowLeft","ArrowRight","Home","End"].includes(ua.key))return;ua.preventDefault();const Xn=ua.key==="Home"?0:ua.key==="End"?sw.length-1:(ei+(ua.key==="ArrowRight"?1:-1)+sw.length)%sw.length,Ns=sw[Xn];sf(Ns.id),(Ao=document.getElementById(`integration-${Ns.id}-tab`))==null||Ao.focus()},children:nt.label},nt.id))]}),ue==="api-server"?o.jsx(vte,{protocol:"api-server",title:"API Server",available:Qn,fields:[{label:"Agent",value:Qn?((mt=Sr==null?void 0:Sr.apiApps)==null?void 0:mt.join("、"))??"":""},{label:T("agentWorkspace.discoveryEndpoint"),value:Qn?iL(Al,"/list-apps"):""},{label:T("agentWorkspace.invocationEndpoint"),value:Qn?iL(Al,"/run_sse"):""},{label:T("agentWorkspace.authentication"),value:Qn?gte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(yte,{available:Qn,authType:q==null?void 0:q.authType,value:xc,visible:Le&&!!xc,loading:Ie,error:Ae,onToggle:()=>void af()})}],example:Qn?$5t(Al,rf,q==null?void 0:q.authType):""}):o.jsx(vte,{protocol:"a2a",title:"A2A",available:za,fields:[{label:"Agent",value:((dn=Sr==null?void 0:Sr.a2a)==null?void 0:dn.name)??""},{label:"Agent Card",value:za?iL(Al,"/.well-known/agent-card.json"):""},{label:T("agentWorkspace.invocationUrl"),value:be},{label:T("agentWorkspace.authentication"),value:za?gte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(yte,{available:za,authType:q==null?void 0:q.authType,value:xc,visible:Le&&!!xc,loading:Ie,error:Ae,onToggle:()=>void af()})}],example:za?F5t(be,q==null?void 0:q.authType):""})]})]}),M==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(ce==null?void 0:ce.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(nt=>{const ei=W5t(qi,nt),ua=ka.filter(Ns=>Ns.kind===nt).length,Xn=Xo?ua:(ei==null?void 0:ei.itemCount)??ua;return o.jsxs("button",{type:"button",onClick:()=>lf(nt),children:[o.jsx("strong",{children:Xn}),o.jsx("span",{children:T(nt==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},nt)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":T("agentWorkspace.caseResultFilter"),children:["good","bad"].map(nt=>o.jsx("button",{type:"button",className:ft===nt?"is-active":"","aria-pressed":ft===nt,onClick:()=>ut(nt),children:T(nt==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},nt))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":T("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(nt=>o.jsx("button",{type:"button",className:zt===nt?"is-active":"","aria-pressed":zt===nt,onClick:()=>Z(nt),children:T(nt==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},nt))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:Gt,onChange:nt=>Rt(nt.currentTarget.value),placeholder:T("agentWorkspace.searchCasesPlaceholder"),"aria-label":T("agentWorkspace.searchCases")})]})]}),qm&&o.jsx("div",{className:`aw-case-toolbar${xe?" is-active":""}`,children:xe?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCaseCount",{count:of.length})}),o.jsx("button",{type:"button",onClick:cf,disabled:_l.length===0||In,children:T("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YE(of),disabled:of.length===0||In,children:T(In?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:eP,disabled:In,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{_s(""),Xe(!0)},disabled:_l.length===0||In,children:T("agentWorkspace.selectCases")})}),jr&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:jr}),o.jsx("div",{ref:Vi,children:o.jsx(rLt,{cases:_l,loading:zi&&_l.length===0,error:Lr,notice:xs,runtimeBacked:!!(ce!=null&&ce.runtimeId),selectionMode:xe,selectedCaseIds:Yt,focusedCaseId:Si,expandedCaseIds:Hs,deleting:In,canDelete:qm,onOpenCase:l0,onToggleCase:Fr,onToggleExpanded:Br,onDeleteCase:nt=>void YE([nt]),onRetry:()=>Nr(nt=>nt+1)})})]}),M==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:T("agentWorkspace.optimizations")}),o.jsx("p",{children:T("agentWorkspace.optimizationsDescription")})]}),Yr?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.loadingOptimizations")})]}):sa?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:sa}),o.jsx("button",{type:"button",onClick:()=>aa(nt=>nt+1),children:T("common.retry")})]}):As.length>0?o.jsx(nLt,{groups:As}):o.jsx("div",{className:"aw-optimization-state",children:T("agentWorkspace.noOptimizations")})]})]}),M==="basic"&&(ce||li)&&o.jsxs("div",{className:"aw-basic-actions",children:[ce&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>C==null?void 0:C(ce),children:[o.jsx(A7e,{"aria-hidden":!0}),o.jsx("span",{children:T("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${$n?" is-disabled":""}`,tabIndex:$n?0:void 0,"aria-describedby":$n?ca:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$n,"aria-busy":He||void 0,"aria-describedby":$n?ca:void 0,onClick:()=>li?F==null?void 0:F(li):Dt?A(Dt):void 0,children:He?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.preparing")})]}):T(li||Sa?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$n&&o.jsx("span",{id:ca,className:"aw-update-disabled-reason",role:"tooltip",children:$n})]})]})]}):null}}),activeSectionKey:M,navigationLabel:T("agentWorkspace.agentDetails"),onSectionChange:U})]})]}),R==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:T("agentWorkspace.comingSoon")})})]})]}),oi&&o.jsx(pc,{variant:"danger",title:oi.title,description:oi.description,confirmLabel:Jt?T("common.deleting"):oi.confirmLabel,closeLabel:T("agentWorkspace.closeDeleteConfirmation"),busy:Jt,onCancel:()=>Oi(null),onConfirm:()=>void p1()})]})}function nLt({groups:e}){const{t}=Te("ui");return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${n.priority}`,children:V5t(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:q5t(n,t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>o.jsxs("li",{children:[o.jsx("strong",{children:i.suggestion}),o.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function iLt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function rLt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:a,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:v("agentWorkspace.userInput")}),o.jsx("span",{children:v("agentWorkspace.agentOutput")}),o.jsx("span",{children:v("agentWorkspace.score")}),o.jsx("span",{children:v("agentWorkspace.scoreReason")}),o.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?o.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),b&&o.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?o.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(x=>{var _,j;const O=x.id.startsWith("local:"),w=(a==null?void 0:a.has(x.id))??!1,k=(c==null?void 0:c.has(x.id))??!1,E=x.output.length+x.referenceOutput.length>220||(((_=x.reason)==null?void 0:_.length)??0)>120,C=d&&!O,N=!!(x.comment&&x.comment.trim()!==((j=x.reason)==null?void 0:j.trim()));return o.jsxs("div",{className:["aw-case-row",l===x.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){C&&(h==null||h(x));return}f==null||f(x)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?C&&(h==null||h(x)):f==null||f(x)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&C&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:x.input,children:x.input||v("agentWorkspace.noUserInput")})]}),N&&o.jsxs("small",{title:x.comment,children:[v("agentWorkspace.note"),x.comment]}),o.jsx("small",{className:"aw-case-time",children:Q5t(x.createdAt,y.resolvedLanguage??y.language,v)}),(x.userId||x.sessionId)&&o.jsx("small",{title:[x.userId,x.sessionId].filter(Boolean).join(" · "),children:[x.userId,x.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:x.output,children:x.output||v("agentWorkspace.noVisibleResponse")}),x.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:x.referenceOutput,children:[v("agentWorkspace.reference"),": ",x.referenceOutput]}),E&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(x.id)},children:v(k?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:z5t(x,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:x.reason||void 0,children:x.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:C&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(x)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(iLt,{})})})]},x.id)})]})}function sLt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[a,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Ww(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:Ww(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(w7e,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[o.jsx("button",{type:"button",className:a==="config"?"is-active":"","aria-pressed":a==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),o.jsx("button",{type:"button",className:a==="history"?"is-active":"","aria-pressed":a==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),o.jsx("div",{className:"aw-content",children:a==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),o.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:h.label}),o.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluationSet")}),o.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[o.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),o.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),o.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),o.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluator")}),o.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[o.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),o.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),o.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.concurrency")}),o.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),o.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),o.jsx("div",{className:"aw-metric-list",children:u.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),o.jsx("span",{children:Ww(h,s)})]},h))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:s("agentWorkspace.historyResults")}),o.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:s("agentWorkspace.noHistory")}),o.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:Ww(h.createdAt,s),agents:c.length})})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:h.score}),o.jsx("small",{children:s("agentWorkspace.overallScore")})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Vu,{}),s("agentWorkspace.completed")]}),o.jsx(bO,{"aria-hidden":!0})]},h.id))})]})})]})}const aLt=5e3,oLt=4;let rL=0;const wte=[];function Ote(e){return e instanceof Error&&e.name==="AbortError"}function lLt(e){return e instanceof Error&&e.name==="TimeoutError"}function cLt(e){return lLt(e)||e instanceof i7&&[500,502,503,504].includes(e.status)}function uLt(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 dLt(e={},t={}){const n=t.request??_x,i=t.wait??uLt;try{return await n(e)}catch(r){if(!cLt(r))throw r;return await i(aLt,e.signal),n(e)}}async function Oje(e){var t;rL>=oLt&&await new Promise(n=>wte.push(n)),rL+=1;try{return await e()}finally{rL-=1,(t=wte.shift())==null||t()}}async function fLt(e,t){await Promise.allSettled(e.map(n=>Oje(()=>t(n))))}const hLt="/web/sandbox/sessions",Ste="/web/sandbox/codex-project-handoff",kte=3e4,sL=33e4,pLt=6e4,mLt=6e5,aw=15e3,If=6e4,gLt=33e4,Ete=3e4,bLt=60*60,Cte=40;function FI(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function XQ(e){switch(e.trim().toLowerCase()){case"ready":return V("sandbox.status.ready");case"wakeable":return V("sandbox.status.wakeable");case"creating":return V("sandbox.status.creating");case"starting":case"initializing":return V("sandbox.status.starting");case"pending":return V("sandbox.status.pending");case"running":return V("sandbox.status.running");case"failed":case"error":return V("sandbox.status.failed");case"stopped":return V("sandbox.status.stopped");case"expired":return V("sandbox.status.expired");case"deleting":return V("sandbox.status.deleting");case"deleted":return V("sandbox.status.deleted");default:return V("sandbox.status.unknown")}}function Jr(e){const t=Hu(e);return t.has("Accept")||t.set("Accept","application/json"),t}class BI extends Error{constructor(n,i={}){var r;super(n);ki(this,"code");ki(this,"retryable");ki(this,"publicMessage");ki(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Tte(e){return e instanceof BI?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?V("sandbox.developmentTimeout"):e instanceof TypeError?V("sandbox.developmentDisconnected"):V("sandbox.developmentFailed")}async function es(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?V("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,a=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof a=="string"?a:a==null?"":JSON.stringify(a),c=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?V("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new BI(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function Ate(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function og(e,t="codex"){if(!e.sessionId||!e.status)throw new Error(V("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:e.toolName==="intelligent-development",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:UI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:Eg(e.conversation)}}}function _te(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(V("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function Nte(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const ow={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function UI(e){if(!e||typeof e!="object")return{...ow};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ow.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ow.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ow.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ow.networkAccess}}function jte(e){if(!e||typeof e!="object")throw new Error(V("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:UI(t.permissions)}}function _a(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function yLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function vLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function Sje(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function Eg(e){const t=_a(e),n=Sje(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(V("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=_a(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const a=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=_a(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...a.length?{skillNames:a}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:UI(t.permissions)}}function w8(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 xLt(e){const t=w8(e.usage);if(!t||typeof e.turnId!="string")return;const n=w8(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 wLt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function OLt(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="",s="";const a=[],l=new Map;let c,u;function d(){var b;const g=c?[...a,c]:a;(b=t.onBlocks)==null||b.call(t,g.map(v=>({...v})))}function f(g){s+=g;const b=a[a.length-1],v=a.length-1,y=[...l.values()].includes(v);(b==null?void 0:b.kind)==="text"&&!y?b.text+=g:a.push({kind:"text",text:g}),d()}function h(g){if(typeof g.id!="string"||g.kind!=="thinking"&&g.kind!=="commentary"&&g.kind!=="tool"||g.status!=="running"&&g.status!=="done")return;const b=g.status==="done";let v;if(g.kind==="thinking"){if(typeof g.text!="string"||!g.text)return;v={kind:"thinking",text:g.text,done:b}}else if(g.kind==="commentary"){if(typeof g.text!="string"||!g.text)return;v={kind:"text",text:g.text}}else{if(typeof g.name!="string"||!g.name)return;v={kind:"tool",name:g.name,args:g.args,response:g.response,done:b}}const y=l.get(g.id);y===void 0?(l.set(g.id,a.length),a.push(v)):a[y]=v,d()}function m(g){var x,O,w;let b="message";const v=[];for(const k of g.split(/\r?\n/))k.startsWith("event:")&&(b=k.slice(6).trim()),k.startsWith("data:")&&v.push(k.slice(5).trimStart());if(v.length===0)return;let y;try{y=JSON.parse(v.join(` +`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(b==="error"){const k=typeof y.message=="string"&&y.message?y.message:V("sandbox.conversationFailed");throw new BI(k,{code:typeof y.code=="string"?y.code:"",retryable:y.retryable===!0,publicMessage:k})}if(b==="progress"&&typeof y.text=="string"&&y.text&&(c={kind:"progress",text:y.text},d()),b==="activity"&&h(y),b==="development.source_ready"||b==="development.succeeded"){const k=_a(y.payload),S=_a(k==null?void 0:k.delivery),E=b==="development.succeeded";if(S&&typeof S.sessionId=="string"&&typeof S.artifactSha256=="string"&&typeof S.validationReportSha256=="string"&&typeof S.agentName=="string"&&typeof S.entryPoint=="string"&&typeof S.fileCount=="number"&&typeof S.artifactSize=="number"&&typeof S.validatedAt=="string"&&S.deployable===!0&&S.verified===E&&typeof S.validationSummary=="string"&&Array.isArray(S.gateSummary)&&S.gateSummary.every(C=>typeof C=="string")){const C={kind:"delivery",value:{sessionId:S.sessionId,...typeof S.projectId=="string"&&typeof S.versionId=="string"?{projectId:S.projectId,versionId:S.versionId,...S.parentVersionId===null||typeof S.parentVersionId=="string"?{parentVersionId:S.parentVersionId}:{}}:{},artifactSha256:S.artifactSha256,validationReportSha256:S.validationReportSha256,agentName:S.agentName,entryPoint:S.entryPoint,fileCount:S.fileCount,artifactSize:S.artifactSize,validatedAt:S.validatedAt,gateSummary:S.gateSummary,deployable:S.deployable,verified:S.verified,validationSummary:S.validationSummary}},N=a.findIndex(_=>_.kind==="delivery"&&_.value.sessionId===S.sessionId&&_.value.artifactSha256===S.artifactSha256&&_.value.validationReportSha256===S.validationReportSha256);N===-1?a.push(C):a[N]=C,d()}}if(b==="approval"){const k=wLt(y);k&&((x=t.onApproval)==null||x.call(t,k))}if(b==="usage"){const k=xLt(y);k&&(u=k,(O=t.onUsage)==null||O.call(t,k))}b==="approval_resolved"&&typeof y.approvalId=="string"&&((w=t.onApprovalResolved)==null||w.call(t,y.approvalId)),b==="delta"&&typeof y.text=="string"&&f(y.text),b==="done"&&!s&&typeof y.text=="string"&&f(y.text),b==="done"&&c&&(c=void 0,d())}for(;;){const{done:g,value:b}=await n.read();r+=i.decode(b,{stream:!g});const v=r.split(/\r?\n\r?\n/);if(r=v.pop()??"",v.forEach(m),g)break}if(r.trim()&&m(r),c&&(c=void 0,d()),a.length===0)throw new Error(V("sandbox.emptyReply"));return{text:s,blocks:a,...u?{usage:u}:{}}}async function $l(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await An(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Jr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},If);if(!l.ok)throw await es(l,a);return l.json()}function kje(e,t={}){return{async listSessions(n={}){const i=await An(Nte(e,n),{method:"GET",headers:Jr(),signal:n.signal},kte);if(!i.ok)throw await es(i,V("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(V("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(V("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>og(s)),...(r.snapshots??[]).map(s=>_te(s))]},async startSession(n={}){var r,s;const i=await An(e,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((r=n.displayName)==null?void 0:r.trim())??"",...(s=n.modelId)!=null&&s.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},sL);if(!i.ok)throw await es(i,V("sandbox.startFailed"));return og(await i.json())},async listAgentSessions(n,i={}){const r=await An(Nte(`/web/${n}/sessions`,i),{method:"GET",headers:Jr(),signal:i.signal},kte);if(!r.ok)throw await es(r,V("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(V("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(V("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(a=>og(a,n)),...(s.snapshots??[]).map(a=>_te(a,n))]},async startAgentSession(n,i={}){var s;const r=await An(`/web/${n}/sessions`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},sL);if(!r.ok)throw await es(r,V("sandbox.createAgentFailed",{kind:n}));return og(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openAgentFailed",{kind:n}));const a=await s.json();if(typeof a.webuiUrl!="string"||!a.webuiUrl.startsWith("/"))throw new Error(V("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:og(a,n),kind:n,webuiUrl:Uo(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:Eje(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await An(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!s.ok&&s.status!==404)throw await es(s,V("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await An(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Jr(),signal:r.signal},sL);if(!a.ok)throw await es(a,V("sandbox.resumeSnapshotFailed"));return og(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await An(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!a.ok&&a.status!==404)throw await es(a,V("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(V("sandbox.missingSessionToConnect"));const r=await An(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),signal:i.signal},pLt);if(!r.ok)throw await es(r,V("sandbox.connectCodexFailed"));const s=og(await r.json());if(s.status.toLowerCase()!=="ready")throw new Error(V("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(V("sandbox.invalidMessage"));const r=await An(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Jr({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??mLt);if(!r.ok)throw await es(r,V("sandbox.conversationFailed"));return OLt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Jr(),signal:i.signal},t.interruptTimeoutMs??aw);if(!r.ok&&![404,409].includes(r.status))throw await es(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await $l(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=jte(r),a=_a(r),l=w8(a==null?void 0:a.threadTotal),c=a==null?void 0:a.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=_a(await $l(e,n,"endpoint",{options:i,fallback:V("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(V("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await An(`${Ste}/pairings`,{method:"POST",headers:Jr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:bLt}),signal:n.signal},Ete);if(!i.ok)throw await es(i,V("sandbox.createHandoffPairingFailed"));const r=_a(await Ate(i,V("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(V("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await An(`${Ste}/pairings/${encodeURIComponent(n)}`,{headers:Jr({Accept:"application/json"}),signal:i.signal},Ete);if(!r.ok)throw await es(r,V("sandbox.getHandoffStatusFailed"));const s=_a(await Ate(r,V("sandbox.getHandoffStatusFailed"))),a=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!a.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(V("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=_a(await $l(e,n,"models",{options:i,fallback:V("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(V("sandbox.invalidModelList"));return r.models.flatMap(s=>{const a=yLt(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=_a(await $l(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:V("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(V("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const a=_a(await $l(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:V("sandbox.listSkillsFailed")}));if(!Array.isArray(a==null?void 0:a.skills))throw new Error(V("sandbox.invalidSkillList"));return a.skills.flatMap(l=>{const c=vLt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const a=s.size?`?${s}`:"",l=_a(await $l(e,n,`threads${a}`,{options:r,fallback:V("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(V("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=Sje(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return Eg(await $l(e,n,"threads/new",{method:"POST",options:i,fallback:V("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(V("sandbox.missingThread"));return Eg(await $l(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return Eg(await $l(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return Eg(await $l(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=_a(await $l(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(V("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:Eg(s)}:{}}},async deleteThread(n,i,r={}){const s=_a(await $l(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(V("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:Eg(s)}:{}}},async compactThread(n,i={}){await $l(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await An(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V("sandbox.getSettingsFailed"));return jte(await r.json())},async updatePermissions(n,i,r={}){const s=await An(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return UI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await An(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updateWorkspaceFailed"));const a=await s.json();if(typeof a.cwd!="string"||!a.cwd)throw new Error(V("sandbox.invalidWorkingDirectory"));return a.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),a=await An(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Jr(),signal:r.signal},If);if(!a.ok)throw await es(a,V("sandbox.listDirectoriesFailed"));const l=await a.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(V("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const a=await An(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},If);if(!a.ok)throw await es(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return Rte(e,n,"terminal",i)},async launchBrowser(n,i={}){return Rte(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await An(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Jr(),body:s,signal:r.signal},gLt);if(!a.ok)throw await es(a,V("sandbox.uploadFileFailed"));const l=await a.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(V("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await An(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.deleteCodexFailed"))}}}const dr=kje(hLt),fp=kje("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3});async function Rte(e,t,n,i){const r=await An(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:Eje(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function Eje(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Uo(e);let n;try{n=new URL(e)}catch{throw new Error(V("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(V("sandbox.unsafeToolUrl",{label:t}));return n.toString()}function Rg(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||V("common.unknownError"));return[V("requestError.actionFailed",{action:t}),V("requestError.detail",{detail:i}),n?V("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}function Yf({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function SLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function kLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function ELt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function CLt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),o.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),o.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),o.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function wk({kind:e,...t}){return e==="codex"?o.jsx(SLt,{...t}):e==="deepseek-harness"?o.jsx(CLt,{...t}):e==="openclaw"?o.jsx(kLt,{...t}):o.jsx(ELt,{...t})}const TLt=["general","codex","deepseek-harness","openclaw","hermes"],ALt=24,_Lt=3e4,NLt=7e3,jLt=2e4,RLt=6,ILt=2,PLt=250,Vp=new Map,yv=new Map,DLt=new Set;function lg(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Ite(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ds&&e.unsupported?"unsupported":"error",message:n}}function b2(e){if(!e){Vp.clear(),yv.clear(),_4();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of yv)i.page.runtimes.some(r=>t.has(r.runtimeId))&&yv.delete(n);for(const n of t)_4(n);Vp.clear()}}function MLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function LLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function $Lt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function FLt({type:e}){return e==="general"?o.jsx(Yf,{}):o.jsx(wk,{kind:e})}function BLt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),a=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:a})}function Pte(e,t){var n;return{id:e.runtimeId,name:e.name,description:((n=e.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:PEe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function ULt(e,t){const n=FI(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:PEe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function QLt(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 zLt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function VLt(e,t){return e.trim()||Ji(t)}async function HLt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=yv.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Pte(d,r))),l.page.nextToken;l&&yv.delete(a);let c=Vp.get(a);c||(c=dLt({scope:e,region:t,pageSize:ALt,nextToken:n,signal:s}),Vp.set(a,c),c.then(()=>Vp.delete(a),()=>Vp.delete(a)));const u=await c;return yv.set(a,{page:u,expiresAt:Date.now()+_Lt}),i(u.runtimes.map(d=>Pte(d,r))),u.nextToken}function qLt({agent:e,onUse:t,onViewDetails:n,onPrepareUpdate:i,compatibility:r,onRetryCompatibility:s,connecting:a,connectError:l,connected:c,deploymentTask:u,nowMs:d,onViewDeploymentTask:f,onEditDraft:h,onDeleteDraft:m}){var _,j,A,F;const{t:g,i18n:b}=Te("ui"),v=(_=e.sandbox)==null?void 0:_.status.toLowerCase(),y=((j=e.sandbox)==null?void 0:j.resourceType)==="snapshot",x=!!(e.runtime||v==="ready"||v==="wakeable"),O=(r==null?void 0:r.status)==="checking",w=(r==null?void 0:r.status)==="unsupported",k=(r==null?void 0:r.status)==="error",S=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(F=e.sandbox)==null?void 0:F.id,E=()=>{if(e.draft){u?f==null||f(u):n==null||n(e);return}!x&&!e.sandbox||(u?f==null||f(u):n==null||n(e))},C=(e.draft||x||!!e.sandbox)&&!!(u?f:n),N=e.draft?u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.viewRuntimeDetails",{name:e.name}):u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.viewDetails",{name:e.name});return o.jsxs(RB,{className:a?"my-agent-card is-connecting":"my-agent-card",activateLabel:C?N:void 0,onActivate:C?E:void 0,onPointerEnter:()=>i==null?void 0:i(e),onFocusCapture:()=>i==null?void 0:i(e),footer:o.jsx(QOe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:g("myAgents.time"),value:KQ(e.createdAt,d,b.resolvedLanguage??b.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:g("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?g("myAgents.neverExpires"):BLt(e.sandbox.expireAt,d,g),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(C6,{"aria-label":u?g("myAgents.viewDeploymentProgress",{name:e.name}):g("myAgents.editDraftNamed",{name:e.name}),onClick:()=>u?f==null?void 0:f(u):h==null?void 0:h(e.draft),children:g(u?"myAgents.viewProgress":"common.edit")}),o.jsx(C6,{tone:"danger","aria-label":g("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>m==null?void 0:m(e.draft),children:g("common.delete")})]}):k||w?o.jsxs(Ht,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":g("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>s==null?void 0:s(e),children:[o.jsx(Kj,{}),g("common.retry")]}):o.jsx(T6,{className:c?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||w||a||c,"aria-busy":a||void 0,label:c?g("myAgents.connectedNamed",{name:e.name}):y?g("myAgents.wakeAndChat",{name:e.name}):g("myAgents.chatWith",{name:e.name}),onClick:()=>void(t==null?void 0:t(e)),children:a?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:g(y?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(LLt,{})}),children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:S,children:S}):void 0,status:e.draft?u?o.jsx("span",{className:"my-agent-deploying-badge",children:g("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:g("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":FI(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&u?o.jsx("span",{className:"my-agent-deploying-badge",children:g("myAgents.deploying")}):O?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsxs(ba,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[o.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),o.jsx("span",{children:g("myAgents.checking")})]})})}):w?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:g("myAgents.chatUnsupported")})})}):k?o.jsx(go,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:g("myAgents.checkFailed")})})}):null}),l?o.jsx(go,{content:l,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:o.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:l})}):null,y&&a?o.jsx("p",{className:"my-agent-wake-note",role:"status",children:o.jsx(xn,{children:g("myAgents.wakingHint")})}):null,e.sandbox?null:o.jsx(PB,{children:e.description})]})}function WLt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:a,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=DLt,drafts:x=[],deploymentTasks:O=[],draftDeploymentTaskIds:w={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:E}){const{t:C}=Te("ui"),N=p.useRef(null),_=p.useRef(null),j=p.useRef(0),A=p.useRef(null),F=p.useRef(0),T=p.useRef(null),P=p.useRef(new Map),R=VLt(t,e),[L,M]=p.useState(""),[U,I]=p.useState(s==="mine"?"mine":"all"),[H,K]=p.useState(R),[Q,q]=p.useState([]),[B,ee]=p.useState(""),[le,se]=p.useState(!0),[re,ge]=p.useState(""),[W,X]=p.useState([]),[ae,ue]=p.useState(!1),[Oe,ke]=p.useState(""),[st,Le]=p.useState(""),[Me,Ie]=p.useState({}),[qe,Ae]=p.useState({}),[ze,Ee]=p.useState(null),[De,J]=p.useState(()=>Date.now()),he=p.useMemo(()=>TLt.map($e=>({value:$e,label:C(`myAgents.agentTypes.${$e}`)})),[C]),_e=p.useMemo(()=>{const $e=Iu(e);return $e.some(ye=>ye.value===R)?$e:[{value:R,label:R},...$e]},[e,R]);p.useEffect(()=>{s==="mine"&&I("mine")},[s]),p.useEffect(()=>{K(R)},[R]),p.useEffect(()=>{J(Date.now());const $e=window.setInterval(()=>J(Date.now()),1e3);return()=>window.clearInterval($e)},[]);const Ze=p.useMemo(()=>x.map($e=>QLt($e,C)),[x,C]),at=p.useMemo(()=>{const $e=new Map,ye=new Map,Ue=new Map;for(const Ke of O){if(Ke.status!=="running")continue;if($e.set(Ke.id,Ke),Ke.draftId){const ut=ye.get(Ke.draftId);(!ut||Ke.startedAt>ut.startedAt)&&ye.set(Ke.draftId,Ke)}if(!Ke.runtimeId)continue;const ft=Ue.get(Ke.runtimeId);(!ft||Ke.startedAt>ft.startedAt)&&Ue.set(Ke.runtimeId,Ke)}return{byId:$e,byDraftId:ye,byRuntimeId:Ue}},[O]),wt=p.useCallback($e=>{var Ue;if($e.draft){const Ke=w[$e.draft.id];return at.byDraftId.get($e.draft.id)??(Ke?at.byId.get(Ke):void 0)}const ye=(Ue=$e.runtime)==null?void 0:Ue.runtimeId;return ye?at.byRuntimeId.get(ye):void 0},[at,w]),Se=p.useCallback(($e,ye)=>{var ft;(ft=A.current)==null||ft.abort(),Vp.clear();const Ue=new AbortController;A.current=Ue;const Ke=++j.current;return se(!0),ge(""),HLt(U,H,$e,ut=>{j.current===Ke&&q(Gt=>ye?ut:[...Gt,...ut])},C,Ue.signal).then(ut=>{j.current===Ke&&ee(ut)}).catch(ut=>{j.current===Ke&&(Ote(ut)||ge(Rg(ut,C("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{j.current===Ke&&se(!1),A.current===Ue&&(A.current=null)})},[U,H,C]);p.useEffect(()=>{if(m==="general")return q([]),ee(""),Se("",!0),()=>{var $e;($e=A.current)==null||$e.abort(),A.current=null,Vp.clear(),j.current+=1}},[m,Se]),p.useEffect(()=>{if(m!=="general"){for(const Ue of P.current.values())Ue.abort();P.current.clear();return}const $e=new Set(Q.filter(Ue=>{var Ke,ft;return((Ke=Ue.runtime)==null?void 0:Ke.runtimeId)!==v&&((ft=Ue.runtime)==null?void 0:ft.region)===H}).map(lg).filter(Boolean));for(const[Ue,Ke]of P.current)$e.has(Ue)||(Ke.abort(),P.current.delete(Ue));const ye=Q.filter(Ue=>{var Gt,Rt,zt;const Ke=(Gt=Ue.runtime)==null?void 0:Gt.runtimeId;if(!Ke||Ke===v||((Rt=Ue.runtime)==null?void 0:Rt.region)!==H)return!1;const ft=lg(Ue),ut=(zt=qe[ft])==null?void 0:zt.status;return!P.current.has(ft)&&(!ut||ut==="checking")});for(const Ue of ye)P.current.set(lg(Ue),new AbortController);Ae(Ue=>{var ut,Gt;let Ke=!1;const ft={...Ue};for(const Rt of Q){const zt=lg(Rt);if(!zt)continue;const Z=((ut=Rt.runtime)==null?void 0:ut.runtimeId)===v;Z&&((Gt=ft[zt])==null?void 0:Gt.status)!=="compatible"?(ft[zt]={status:"compatible",message:C("myAgents.compatibility.supported")},Ke=!0):!Z&&!ft[zt]&&(ft[zt]={status:"checking",message:C("myAgents.compatibility.checking")},Ke=!0)}return Ke?ft:Ue}),fLt(ye,async Ue=>{const Ke=Ue.runtime;if(!Ke)return;const ft=lg(Ue),ut=P.current.get(ft);if(ut)try{const Gt=await Fv(Ke.runtimeId,Ke.region,{signal:ut.signal,preferCached:!0,timeoutMs:NLt,currentVersion:Ke.currentVersion});if(ut.signal.aborted)return;Ae(Rt=>({...Rt,[ft]:Gt&&Gt.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(Gt){if(ut.signal.aborted||(Gt==null?void 0:Gt.name)==="AbortError")return;Ae(Rt=>({...Rt,[ft]:Ite(Gt,C)}))}finally{P.current.get(ft)===ut&&P.current.delete(ft)}})},[m,v,H,Q,C]),p.useEffect(()=>()=>{var $e;($e=A.current)==null||$e.abort();for(const ye of P.current.values())ye.abort();P.current.clear()},[]);const ve=p.useCallback(async $e=>{var Ke;(Ke=T.current)==null||Ke.abort();const ye=new AbortController;T.current=ye;const Ue=++F.current;ue(!0),ke(""),X([]);try{const ft=$e==="codex"?await dr.listSessions({signal:ye.signal,autoResumeSnapshots:!1}):await dr.listAgentSessions($e,{signal:ye.signal,autoResumeSnapshots:!1});if(F.current!==Ue)return;X(ft.map(ut=>ULt(ut,C)))}catch(ft){if((ft==null?void 0:ft.name)==="AbortError"||F.current!==Ue)return;ke(Rg(ft,C("myAgents.loadAgentType",{type:C(`myAgents.agentTypes.${$e}`)}),`GET /web/${$e==="codex"?"sandbox":$e}/sessions`))}finally{T.current===ye&&(T.current=null),F.current===Ue&&ue(!1)}},[C]);function He($e){var ye;$e!==m&&($e==="general"?(j.current+=1,q([]),ee(""),ge(""),se(!0)):((ye=T.current)==null||ye.abort(),T.current=null,F.current+=1,X([]),ke(""),ue(!0)),g($e))}function Je(){m==="general"&&(j.current+=1,q([]),ee(""),ge(""),se(!0))}function Ce($e){$e!==U&&(Je(),I($e))}function Wt($e){$e!==H&&(Je(),K($e))}p.useEffect(()=>{var $e;if(m==="general"){($e=T.current)==null||$e.abort(),T.current=null,F.current+=1;return}return ve(m),()=>{var ye;(ye=T.current)==null||ye.abort(),T.current=null,F.current+=1}},[m,ve,b]),p.useEffect(()=>{const $e=_.current,ye=N.current;if(!$e||!ye||m!=="general"||!B||le)return;const Ue=new IntersectionObserver(([Ke])=>{Ke.isIntersecting&&Se(B,!1)},{root:ye,rootMargin:"240px 0px",threshold:.01});return Ue.observe($e),()=>Ue.disconnect()},[m,Se,le,B]);const ln=p.useCallback(async $e=>{if(!st){Le($e.id),Ie(ye=>({...ye,[$e.id]:""}));try{await new Promise(ye=>requestAnimationFrame(()=>ye())),$e.sandbox?await f($e.sandbox):await c($e)}catch(ye){Ie(Ue=>({...Ue,[$e.id]:ye instanceof Error?ye.message:String(ye)}))}finally{Le("")}}},[st,c,f]),cn=p.useCallback(async $e=>{var ft;const ye=$e.runtime;if(!ye)return;const Ue=lg($e);Ae(ut=>({...ut,[Ue]:{status:"checking",message:C("myAgents.compatibility.checking")}})),(ft=P.current.get(Ue))==null||ft.abort();const Ke=new AbortController;P.current.set(Ue,Ke);try{const ut=await Oje(()=>Fv(ye.runtimeId,ye.region,{retryProbe:!0,signal:Ke.signal,timeoutMs:jLt,currentVersion:ye.currentVersion}));if(Ke.signal.aborted)return;Ae(Gt=>({...Gt,[Ue]:ut&&ut.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(ut){if(Ke.signal.aborted||Ote(ut))return;Ae(Gt=>({...Gt,[Ue]:Ite(ut,C)}))}finally{P.current.get(Ue)===Ke&&P.current.delete(Ue)}},[C]),Ot=p.useCallback($e=>{const ye=$e.runtime;!r||!ye||wt($e)||A4({runtimeId:ye.runtimeId,region:ye.region,appName:$e.appName,currentVersion:ye.currentVersion})},[r,wt]),jt=p.useMemo(()=>{const $e=L.trim().toLocaleLowerCase(),ye=m==="general"?[...Ze,...Q]:W,Ke=(U==="mine"?ye.filter(Rt=>Rt.isMine):ye).filter(Rt=>{var Z;const zt=((Z=Rt.runtime)==null?void 0:Z.region)??Rt.region;return!zt||zt===H}),ft=$e?Ke.filter(Rt=>Rt.name.toLocaleLowerCase().includes($e)):Ke;if(m!=="general")return ft;const ut=y.size>0?ft.filter(Rt=>!Rt.runtime||!y.has(Rt.runtime.runtimeId)):ft,Gt=ut.findIndex(Rt=>{var zt;return((zt=Rt.runtime)==null?void 0:zt.runtimeId)===v});return Gt<=0?ut:[ut[Gt],...ut.slice(0,Gt),...ut.slice(Gt+1)]},[m,v,Ze,y,L,U,H,Q,W]);p.useEffect(()=>{if(!r||m!=="general")return;const $e=jt.filter(ut=>!!ut.runtime).filter(ut=>!wt(ut)).slice(0,RLt);if($e.length===0)return;let ye=!1,Ue=0;const Ke=async()=>{for(;!ye;){const ut=$e[Ue];if(Ue+=1,!(ut!=null&&ut.runtime)||(await A4({runtimeId:ut.runtime.runtimeId,region:ut.runtime.region,appName:ut.appName,currentVersion:ut.runtime.currentVersion}),ye))return}},ft=window.setTimeout(()=>{for(let ut=0;ut{ye=!0,window.clearTimeout(ft)}},[m,r,wt,jt]);const ot=C(`myAgents.agentTypes.${m}`,{defaultValue:C("myAgents.agent")}),gt=m==="general"?le&&Q.length===0&&Ze.length===0:ae&&W.length===0,Pe=!gt&&jt.length===0,bt=(m==="general"?n:i)?m==="general"?()=>a(H):()=>d(m):void 0,Mt=m==="codex"&&i&&!!l;return o.jsxs(Th,{className:"my-agents-page","aria-label":C("myAgents.agent"),children:[o.jsx(zx,{title:C("myAgents.agent"),className:"my-agents-header"}),o.jsxs(Zb,{className:"my-agent-toolbar",children:[o.jsx(dE,{idPrefix:"my-agent-ownership",ariaLabel:C("myAgents.creatorFilter"),value:U,items:[{id:"all",label:C("common.all"),disabled:s==="mine"},{id:"mine",label:C("agentSelector.createdByMe")}],onChange:Ce}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"my-agent-type-filter",ariaLabel:C("myAgents.agentType"),value:m,options:he,onChange:He}),o.jsx(lN,{id:"my-agent-region-filter",ariaLabel:C("myAgents.region"),value:H,options:_e,onChange:Wt}),o.jsx(wm,{className:"my-agent-search","aria-label":C("myAgents.searchAgents"),value:L,onChange:$e=>M($e.target.value),placeholder:C("common.search")}),Mt?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx($Lt,{}),o.jsx("span",{children:C("myAgents.handoff")})]}):null]})]}),o.jsxs(Jb,{className:"my-agent-results",ref:N,"aria-label":C("myAgents.agentList",{type:ot}),children:[gt?o.jsx(Ud,{}):(m==="general"?re:Oe)&&jt.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:m==="general"?re:Oe}),o.jsx("button",{type:"button",onClick:()=>{m==="general"?Se("",!0):ve(m)},children:C("common.reload")})]}):Pe&&!bt?L.trim()||U==="mine"||H!==R?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(zFe,{})}),o.jsx(Cn.Title,{children:C("myAgents.noMatchingAgents")}),o.jsx(Cn.Description,{children:C("myAgents.adjustSearch")})]})}):m!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(FLt,{type:m})}),o.jsx(Cn.Title,{className:"my-agent-sandbox-empty-title",children:C("myAgents.noAgentType",{type:ot})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(Yf,{})}),o.jsx(Cn.Title,{children:C("myAgents.noGeneralAgents")}),o.jsx(Cn.Description,{children:C("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[m==="general"&&re?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:re}),o.jsx("button",{type:"button",onClick:()=>void Se("",!0),children:C("common.reload")})]}):null,o.jsxs(Vx,{className:"my-agent-grid",children:[bt?o.jsx(Cb,{className:"my-agent-create-card","aria-label":C("myAgents.createAgentType",{type:ot}),onClick:bt,icon:o.jsx(MLt,{}),children:C("myAgents.createAgent")}):null,jt.map($e=>{var Ue;const ye=zLt($e,Q,C);return o.jsx(qLt,{agent:$e,deploymentTask:wt($e),nowMs:De,onViewDeploymentTask:k,onUse:ln,compatibility:$e.runtime?qe[lg($e)]??{status:"checking",message:C("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:cn,onPrepareUpdate:Ot,onViewDetails:ye?()=>{ye.sandbox?h(ye.sandbox):u(ye)}:void 0,connecting:$e.id===st,connectError:Me[$e.id],connected:((Ue=$e.runtime)==null?void 0:Ue.runtimeId)===v,onEditDraft:S,onDeleteDraft:Ee},$e.id)})]})]}),m==="general"&&!re&&!gt&&(jt.length>0||!!B)&&o.jsx("div",{className:"my-agent-load-more",ref:_,"aria-live":"polite",children:le?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:C("myAgents.loadingMore")})]}):B?o.jsx("span",{children:C("myAgents.scrollForMore")}):o.jsx("span",{children:C("myAgents.allLoaded")})})]}),ze?o.jsx(pc,{title:C("myAgents.deleteDraftTitle"),description:C("myAgents.deleteDraftDescription",{name:ze.draft.name||C("agentSelector.unnamedAgent")}),confirmLabel:C("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Ee(null),onConfirm:()=>{E==null||E(ze),Ee(null)}}):null]})}const GLt="_Container_13560_1",KLt="_Textarea_13560_174",Dte={Container:GLt,Textarea:KLt},Rm=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:x,autoSelect:O,rows:w=3,maxRows:k,autoResize:S,ref:E,onChange:C,...N}=e,[_,j]=p.useState(!1),A=S?Math.max(k??10,w):w;p.useEffect(()=>{var P;O&&((P=t.current)==null||P.select())},[O]);const F=P=>{y==null||y(P),P.animationName==="native-autofill-in"&&(x==null||x())},T=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const P=t.current.scrollHeight;t.current.style.height=P+"px"},[S,A]);return p.useEffect(()=>{T()},[e.value,w,T]),o.jsx("div",{className:pi(Dte.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":_,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Wb({"textarea-min-rows":`${w}`,"textarea-max-rows":`${A}`}),children:o.jsx("textarea",{...N,onChange:P=>{C==null||C(P),T()},ref:Zk([t,E]),id:r||(g?void 0:i),className:Dte.Textarea,name:s,readOnly:h,disabled:f,rows:w,onFocus:P=>{j(!0),b==null||b(P)},onBlur:P=>{j(!1),v==null||v(P)},onAnimationStart:F,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},QI="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",XLt="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",YLt="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",ZLt="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",JLt="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",e3t="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",t3t="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",n3t="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",i3t="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",r3t="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 YQ(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}xo.registerLanguage("bash",JB);const s3t=48;function a3t(e,t=s3t){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function o3t(e){return xo.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function l3t({status:e}){return e==="succeeded"?o.jsx(Vu,{"aria-hidden":!0}):e==="failed"?o.jsx(h4,{"aria-hidden":!0}):e==="running"?o.jsx(fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(f7e,{"aria-hidden":!0})}function Mte(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 c3t({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>o3t(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return o.jsxs("div",{className:"studio-build-progress",children:[o.jsx("ol",{className:"studio-build-progress__steps","aria-label":a("studioBuildProgress.steps"),children:e.map(g=>o.jsxs("li",{className:`is-${g.status}`,children:[o.jsx("span",{className:"studio-build-progress__step-icon",children:o.jsx(l3t,{status:g.status})}),o.jsx("span",{children:g.label})]},g.key))}),o.jsxs("section",{className:"studio-build-progress__log","aria-label":a("studioBuildProgress.log"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:a("studioBuildProgress.log")}),o.jsxs("span",{children:[a(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?a("studioBuildProgress.recentOnly"):"",Mte(r,l.resolvedLanguage??l.language)?` · ${Mte(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),a(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?o.jsx("pre",{ref:c,tabIndex:0,"aria-label":a("studioBuildProgress.logContent"),onScroll:g=>{u.current=a3t(g.currentTarget)},children:o.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):o.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||a(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Lte({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:a=""}){return o.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${a?` ${a}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[o.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),o.jsxs("span",{className:"studio-package-option__content",children:[o.jsx("strong",{children:e}),t?o.jsx("span",{children:t}):null]}),o.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?o.jsx(qFe,{}):o.jsx(KFe,{})})]})}function cg(e,t){return e[t]|e[t+1]<<8}function Q0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function u3t(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 Cje(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Q0(e,u)===101010256){i=u;break}if(i<0)throw new Error($t("helpers.zip.invalid"));const r=cg(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error($t("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Q0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error($t("helpers.zip.tooLarge"));const x=cg(e,v+26),O=cg(e,v+28),w=v+30+x+O,k=e.subarray(w,w+f);let S;if(d===0)S=k;else if(d===8)S=await u3t(k);else{s+=46+m+g+b;continue}l.push({name:y,text:a.decode(S)}),s+=46+m+g+b}return l}const O8=/(^|\/)skill\.md$/i;function d3t(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 f3t(...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 h3t(e,t){return t.trim()||e}function Cje(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 p3t(e){const t=new Map,n=new Set;for(const i of e)if(O8.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const a=O8.test("/"+i.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function m3t(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>O8.test("/"+c.path));if(!r)return{hit:null,error:$t("helpers.skills.missingManifest",{location:i})};const s=u3t(r.text),a=f3t(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:$t("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:$t("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:h3t(a,s.name),description:s.description||$t("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function g3t(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await Eje(t)).map(r=>({path:r.name,text:r.text}));return Tje(Cje(i),e.name)}async function b3t(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function v3t(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 Aje(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await y3t(e),path:n}];if(!e.isDirectory)return[];const i=await v3t(e);return(await Promise.all(i.map(r=>Aje(r,n)))).flat()}function x3t({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=w=>e.some(k=>k.source==="local"&&k.folder===w),m=w=>{w.localFiles&&(h(w.folder||w.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(w.folder||w.name)))):t([...e,{source:"local",folder:w.folder||w.name,name:w.name,description:w.description,localFiles:w.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=w=>{const k=new Set([...g.current.map(N=>N.folder||N.name),...b.current.filter(N=>N.source==="local").map(N=>N.folder)]),S=[],E=[];for(const N of w.hits){const _=N.folder||N.name;if(k.has(_)){S.push(N.name);continue}k.add(_),E.push(N)}a(N=>[...N,...E]);const C=[...w.errors];if(S.length>0&&C.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(C),E.length===1&&w.errors.length===0&&S.length===0){const N=E[0];N.localFiles&&t([...b.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},y=w=>{w.preventDefault(),f.current+=1,d(!0)},x=w=>{w.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},O=async w=>{if(w.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(w.dataTransfer.items).map(S=>{var E;return(E=S.webkitGetAsEntry)==null?void 0:E.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(N=>Aje(N)))).flat(),E=k.some(N=>N.isDirectory);if(!E&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await g3t(S[0].file));return}if(!E){r([n("skills.local.invalidDrop")]);return}const C=new Map(S.map(({file:N,path:_})=>[N,_]));v(await b3t(S.map(({file:N})=>N),C))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:w=>w.preventDefault(),onDragLeave:x,onDrop:w=>void O(w),children:[o.jsx(LF,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),o.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&o.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(w=>{var S;const k=h(w.folder||w.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(w),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:w.name}),w.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=w.localFiles)==null?void 0:S.length)??0})})]})]},w.id)})})]})}const w3t="/harness/skills/findskill";async function O3t(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${w3t}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!s.ok)throw new Error($t("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 S3t({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await O3t(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){a([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(P_,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(P_,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:u})]}),l&&s.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(v.description)}),v.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function k3t({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let w=!1;return(async()=>{f(!0),b(null);try{const k=await QEe();w||(s(k),k.length>0&&u(k[0].id))}catch(k){w||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{w||f(!1)}})(),()=>{w=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const w=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await zEe(c,w==null?void 0:w.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(w=>w.id===c),y=v?A1t(v.id,v.region,n):"",x=(w,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===w&&(S.version||"")===k),O=w=>{if(!v)return;const k=Fg(w);if(x(k,w.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===w.version)));else{const S=T1t(v,w);t([...e,{source:"skillspace",folder:S.folder||w.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return o.jsx("div",{className:"cw-skillspace",children:d?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:g})]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:w=>u(w.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(w=>o.jsxs("option",{value:w.id,children:[w.name||w.id,w.description?` — ${Ok(w.description)}`:""]},w.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:xh(v.region,n)}),y&&o.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:o.jsx(gb,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):a.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):o.jsx("div",{className:"cw-skill-results",children:a.map(w=>{const k=Fg(w),S=x(k,w.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>O(w),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[w.skillName,w.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",w.version]})]}),w.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(f7e,{className:"cw-i cw-i-sm"})," ",(v==null?void 0:v.name)||c]})]})]},`${k}/${w.version}`)})})]})})}function _je({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function aL(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 E3t(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function C3t({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=mS;e.source==="local"||e.source==="runtime"?r=LF:e.source==="skillspace"&&(r=_je);const s=`${i(E3t(e))}${e.description?` · ${Ok(e.description)}`:""}`;return o.jsxs(pr.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:o.jsx(r,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:o.jsx(Ba,{className:"cw-i cw-i-sm"})})]})}const oL=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:LF},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:_je},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:Zj}];function ZQ({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=oL.findIndex(x=>x.id===l),b=r??a("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const w=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[u]);const v=(x,O)=>{O.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:O.name}))||t(e.filter(w=>aL(w)!==x))},y=x=>{const O=new Set(x.filter(w=>w.source!=="runtime").map(w=>w.folder));t(x.filter(w=>w.source!=="runtime"||!O.has(w.folder)))};return o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:o.jsx(Fo,{className:"cw-i"})}),o.jsx("span",{children:b})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[s?o.jsx("span",{className:"cw-skill-selected-label",children:a("skillSourcePicker.selectedCount",{count:e.length})}):null,o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Ru,{initial:!1,children:e.map(x=>o.jsx(C3t,{skill:x,disabled:i,onRemove:()=>v(aL(x),x)},aL(x)))})})]}),Li.createPortal(o.jsx(Ru,{children:u&&o.jsx(pr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:x=>{x.target===x.currentTarget&&d(!1)},children:o.jsxs(pr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("header",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:f,children:b}),o.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Ba,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${oL.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),oL.map(({id:x,labelKey:O,shortLabelKey:w,icon:k})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${x}`,"aria-controls":h,"aria-selected":l===x,className:`cw-skill-pickertab ${l===x?"is-on":""}`,onClick:()=>c(x),children:[o.jsx(k,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(O)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(w)})]},x))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(S3t,{selected:e,onChange:y}),l==="local"&&o.jsx(x3t,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(k3t,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const Nje=128*1024,T3t={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function vv(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??T3t[e]}function zI(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function jje(e){return new TextEncoder().encode(e).byteLength}function A3t(e,t="ubuntu:22.04"){const n=zI(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function _3t(e){const t=zI(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 h3t(...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 p3t(e,t){return t.trim()||e}function Tje(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 m3t(e){const t=new Map,n=new Set;for(const i of e)if(O8.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const a=O8.test("/"+i.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function g3t(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>O8.test("/"+c.path));if(!r)return{hit:null,error:$t("helpers.skills.missingManifest",{location:i})};const s=d3t(r.text),a=h3t(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:$t("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:$t("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:p3t(a,s.name),description:s.description||$t("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function b3t(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await Cje(t)).map(r=>({path:r.name,text:r.text}));return Aje(Tje(i),e.name)}async function y3t(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function x3t(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 _je(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await v3t(e),path:n}];if(!e.isDirectory)return[];const i=await x3t(e);return(await Promise.all(i.map(r=>_je(r,n)))).flat()}function w3t({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=w=>e.some(k=>k.source==="local"&&k.folder===w),m=w=>{w.localFiles&&(h(w.folder||w.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(w.folder||w.name)))):t([...e,{source:"local",folder:w.folder||w.name,name:w.name,description:w.description,localFiles:w.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=w=>{const k=new Set([...g.current.map(N=>N.folder||N.name),...b.current.filter(N=>N.source==="local").map(N=>N.folder)]),S=[],E=[];for(const N of w.hits){const _=N.folder||N.name;if(k.has(_)){S.push(N.name);continue}k.add(_),E.push(N)}a(N=>[...N,...E]);const C=[...w.errors];if(S.length>0&&C.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(C),E.length===1&&w.errors.length===0&&S.length===0){const N=E[0];N.localFiles&&t([...b.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},y=w=>{w.preventDefault(),f.current+=1,d(!0)},x=w=>{w.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},O=async w=>{if(w.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(w.dataTransfer.items).map(S=>{var E;return(E=S.webkitGetAsEntry)==null?void 0:E.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(N=>_je(N)))).flat(),E=k.some(N=>N.isDirectory);if(!E&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await b3t(S[0].file));return}if(!E){r([n("skills.local.invalidDrop")]);return}const C=new Map(S.map(({file:N,path:_})=>[N,_]));v(await y3t(S.map(({file:N})=>N),C))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:w=>w.preventDefault(),onDragLeave:x,onDrop:w=>void O(w),children:[o.jsx(LF,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),o.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&o.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(w=>{var S;const k=h(w.folder||w.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(w),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:w.name}),w.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=w.localFiles)==null?void 0:S.length)??0})})]})]},w.id)})})]})}const O3t="/harness/skills/findskill";async function S3t(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${O3t}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!s.ok)throw new Error($t("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 k3t({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await S3t(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){a([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(P_,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(P_,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:u})]}),l&&s.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(v.description)}),v.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function E3t({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let w=!1;return(async()=>{f(!0),b(null);try{const k=await zEe();w||(s(k),k.length>0&&u(k[0].id))}catch(k){w||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{w||f(!1)}})(),()=>{w=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const w=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await VEe(c,w==null?void 0:w.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(w=>w.id===c),y=v?_1t(v.id,v.region,n):"",x=(w,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===w&&(S.version||"")===k),O=w=>{if(!v)return;const k=Fg(w);if(x(k,w.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===w.version)));else{const S=A1t(v,w);t([...e,{source:"skillspace",folder:S.folder||w.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return o.jsx("div",{className:"cw-skillspace",children:d?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:g})]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:w=>u(w.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(w=>o.jsxs("option",{value:w.id,children:[w.name||w.id,w.description?` — ${Ok(w.description)}`:""]},w.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:xh(v.region,n)}),y&&o.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:o.jsx(gb,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):a.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):o.jsx("div",{className:"cw-skill-results",children:a.map(w=>{const k=Fg(w),S=x(k,w.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>O(w),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx(Fo,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[w.skillName,w.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",w.version]})]}),w.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(h7e,{className:"cw-i cw-i-sm"})," ",(v==null?void 0:v.name)||c]})]})]},`${k}/${w.version}`)})})]})})}function Nje({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function aL(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 C3t(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function T3t({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=mS;e.source==="local"||e.source==="runtime"?r=LF:e.source==="skillspace"&&(r=Nje);const s=`${i(C3t(e))}${e.description?` · ${Ok(e.description)}`:""}`;return o.jsxs(pr.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:o.jsx(r,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:o.jsx(Ba,{className:"cw-i cw-i-sm"})})]})}const oL=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:LF},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:Nje},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:Zj}];function ZQ({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=oL.findIndex(x=>x.id===l),b=r??a("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const w=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[u]);const v=(x,O)=>{O.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:O.name}))||t(e.filter(w=>aL(w)!==x))},y=x=>{const O=new Set(x.filter(w=>w.source!=="runtime").map(w=>w.folder));t(x.filter(w=>w.source!=="runtime"||!O.has(w.folder)))};return o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:o.jsx(Fo,{className:"cw-i"})}),o.jsx("span",{children:b})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[s?o.jsx("span",{className:"cw-skill-selected-label",children:a("skillSourcePicker.selectedCount",{count:e.length})}):null,o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Ru,{initial:!1,children:e.map(x=>o.jsx(T3t,{skill:x,disabled:i,onRemove:()=>v(aL(x),x)},aL(x)))})})]}),Li.createPortal(o.jsx(Ru,{children:u&&o.jsx(pr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:x=>{x.target===x.currentTarget&&d(!1)},children:o.jsxs(pr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("header",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:f,children:b}),o.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Ba,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${oL.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),oL.map(({id:x,labelKey:O,shortLabelKey:w,icon:k})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${x}`,"aria-controls":h,"aria-selected":l===x,className:`cw-skill-pickertab ${l===x?"is-on":""}`,onClick:()=>c(x),children:[o.jsx(k,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(O)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(w)})]},x))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(k3t,{selected:e,onChange:y}),l==="local"&&o.jsx(w3t,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(E3t,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const jje=128*1024,A3t={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function vv(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??A3t[e]}function zI(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function Rje(e){return new TextEncoder().encode(e).byteLength}function _3t(e,t="ubuntu:22.04"){const n=zI(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function N3t(e){const t=zI(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` `).replace(/^\n+/,"")}function QA(e,t){const n=`FROM ${e.trim()}`,i=zI(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function N3t(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?vv("duplicateFrom",n):JQ(QA(t,e),void 0,n):vv("baseImageRequired",n)}function JQ(e,t=jje(e),n){return t>Nje?vv("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":vv("missingFrom",n):vv("empty",n)}async function j3t(e,t){if(e.size>Nje)return{content:"",error:vv("tooLarge",t)};const n=zI(await e.text());return{content:n,error:JQ(n,e.size,t)}}function R3t(e){return FU(e,{lineWidth:0})}function I3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function P3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function VE({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:a,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),x=p.useRef(null),O=p.useRef(null),w=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[E,C]=p.useState(!1),[N,_]=p.useState(0),j=r.find(M=>M.value===t),A=(j==null?void 0:j.label)??(t?n:void 0),F=a!==void 0&&!!f,T=()=>{C(!1),F&&a&&(f==null||f(""))};p.useEffect(()=>{if(!E)return;const M=U=>{U.target instanceof Node&&x.current&&!x.current.contains(U.target)&&T()};return window.addEventListener("pointerdown",M),()=>window.removeEventListener("pointerdown",M)},[E,f,a,F]),p.useEffect(()=>{var M,U;if(E){if(F){(M=w.current)==null||M.focus();return}(U=S.current[N])==null||U.focus()}},[E,F]),p.useEffect(()=>{var M;!E||F&&document.activeElement===w.current||(M=S.current[N])==null||M.focus()},[N,E,F]),p.useEffect(()=>{_(M=>Math.min(M,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!E||!u||c||!h)return;const M=window.requestAnimationFrame(()=>{const U=k.current;U&&U.scrollHeight<=U.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(M)},[u,c,h,E,r.length]);const P=(M=1)=>{const U=r.findIndex(H=>H.value===t),I=U>=0?U:M===1?0:Math.max(0,r.length-1);_(I),C(!0)},R=M=>{r.length!==0&&_((M+r.length)%r.length)},L=M=>{var U;m(M.value),T(),(U=O.current)==null||U.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:x,onKeyDown:M=>{var I,H;const U=M.target===w.current;if(M.key==="Escape"&&E){M.preventDefault(),T(),(I=O.current)==null||I.focus();return}if(M.key==="Tab"){T();return}if(U){M.key==="ArrowDown"&&r.length>0&&(M.preventDefault(),_(0),(H=S.current[0])==null||H.focus());return}M.key==="ArrowDown"?(M.preventDefault(),E?R(N+1):P(1)):M.key==="ArrowUp"?(M.preventDefault(),E?R(N-1):P(-1)):E&&M.key==="Home"?(M.preventDefault(),_(0)):E&&M.key==="End"&&(M.preventDefault(),_(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:O,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":E,"aria-controls":E?y:void 0,disabled:s,onClick:()=>{E?T():P()},children:[o.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),o.jsx(I3t,{className:`pp-deployment-select-chevron${E?" is-open":""}`})]}),E&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[F&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:w,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:M=>f==null?void 0:f(M.currentTarget.value)})}),o.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:M=>{if(!u||c||!h)return;const U=M.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<=24&&h()},children:r.map((M,U)=>{const I=M.value===t;return o.jsxs("button",{ref:H=>{S.current[U]=H},type:"button",role:"option","aria-selected":I,tabIndex:U===N?0:-1,className:`pp-deployment-select-option${I?" is-selected":""}`,title:M.description,onFocus:()=>_(U),onClick:()=>L(M),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[M.label,M.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:M.badge})]}),M.description&&o.jsx("small",{children:M.description})]}),I&&o.jsx(P3t,{})]},M.value)})}),c&&o.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&o.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function D3t(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 Rje={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function $f(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,a]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,x]=p.useState(""),[O,w]=p.useState(""),[k,S]=p.useState(0),E=p.useRef(!1),C=p.useRef(null),N=e?JSON.stringify(e):"",_=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const P=window.setTimeout(()=>{x(b.trim())},250);return()=>window.clearTimeout(P)},[b]),p.useEffect(()=>{v(""),x("")},[N]);const j=p.useCallback((P,R)=>{var U;if(!_)return;(U=C.current)==null||U.abort();const L=new AbortController;C.current=L;const M=JSON.parse(_);R&&n([]),E.current=!0,h(!0),g(null),l0e({...M,pageNumber:P,pageSize:100},L.signal).then(I=>{n(H=>{if(R)return I.items;const K=new Set(H.map(Q=>`${Q.id}\0${Q.name}`));return[...H,...I.items.filter(Q=>!K.has(`${Q.id}\0${Q.name}`))]}),r(I.serviceRegion),a(I.pageNumber),c(I.totalCount),d(I.hasMore),w(_)}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(w(_),g(I instanceof Error?I.message:String(I)))}).finally(()=>{C.current===L&&(C.current=null,E.current=!1,h(!1))})},[_]);p.useEffect(()=>{var P;if(!_){(P=C.current)==null||P.abort(),C.current=null,E.current=!1,n([]),r(""),a(1),c(0),d(!1),w(""),h(!1),g(null);return}return j(1,!0),()=>{var R;return(R=C.current)==null?void 0:R.abort()}},[j,_,k]);const A=!!_&&O===_&&b.trim()===y,F=p.useCallback(()=>{w(""),S(P=>P+1)},[]),T=p.useCallback(()=>{!A||E.current||!u||j(s+1,!1)},[u,j,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!_&&(!A||f),error:m,search:b,setSearch:v,reload:F,loadMore:T}}function M3t(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Ff({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>M3t(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(VE,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[a]===d);f&&l(f)}}),s?o.jsx("span",{className:"pp-resource-status",children:s}):i.error?o.jsxs("div",{className:"pp-resource-error",role:"alert",children:[o.jsx("span",{children:i.error}),o.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?o.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?o.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?o.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function Ije({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=$f(e?{kind:"cr-registry",region:e}:null),a=$f(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=$f(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.registryInstance")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:a,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function lL({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(VE,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:D3t(r),disabled:n,onChange:s=>i(s)})]})}function z0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:e}),o.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function cL({items:e,note:t}){const{t:n}=Te("ui");return o.jsxs("div",{className:"pp-resource-auto-names",children:[o.jsx("span",{children:n("deploymentResources.automaticNames")}),o.jsx("dl",{children:e.map(i=>o.jsxs("div",{children:[o.jsx("dt",{children:i.label}),o.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&o.jsx("small",{children:t})]})}function Pje(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?an.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()))?an.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?an.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?an.t("ui:deploymentResources.validation.existingCodePipeline"):null}function Dje({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){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=$f(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=$f(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=$f(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=$f(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=$f(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=$f(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=x=>a({...e,...x});return o.jsxs("div",{className:"pp-resource-list",children:[o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:x=>y({tos:{mode:x}})}),e.tos.mode==="create"&&o.jsx(z0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x.name}})})]}),e.tos.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:"CR",value:e.cr.mode,disabled:r,onChange:x=>y({cr:{mode:x}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(z0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:x=>y({cr:{...e.cr,instance:x}})}),o.jsx(z0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:x=>y({cr:{...e.cr,namespace:x}})}),o.jsx(z0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:x=>y({cr:{...e.cr,repository:x}})})]}),e.cr.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.crInstance")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:x=>y({cr:{mode:"existing",instance:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:x=>y({cr:{...e.cr,namespace:x.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:x=>y({cr:{...e.cr,repository:x.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:x=>y({codePipeline:{mode:x}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(z0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,workspaceName:x}})}),o.jsx(z0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineName:x}})})]}),e.codePipeline.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.workspace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:x=>y({codePipeline:{mode:"existing",workspaceId:x.id,workspaceName:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineId:x.id,pipelineName:x.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&o.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function L3t(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 $3t=wOe.map(e=>({value:e.id,label:e.label,description:e.description}));function F3t(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 B3t(e){const t=A3t(e,"");return t===TB?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const U3t=oN.map(e=>({value:e.id,label:e.label})),$te=SOe.map(e=>({value:e.id,label:e.label}));function Q3t(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const S8=20,Fte=new Set;async function z3t(){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 V3t={opencli:XLt,uv:YLt,playwright:ZLt,chromium:JLt,git:e3t,curl:t3t,ffmpeg:n3t,imagemagick:i3t};function H3t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Eu(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function q3t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),o.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function k8(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 Bte(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function Mje(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 W3t(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function G3t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),o.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function K3t({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function X3t({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:QI,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:KLt,alt:""});if(e.id==="github-cli")return o.jsx(YQ,{});const t=V3t[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(K3t,{label:e.label})}function Y3t(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===_B(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...gM,optionIds:[...gM.optionIds],selectedSkills:[...gM.selectedSkills]}}const Hg=new Set(["preparing","queued","building","scanning"]),Ute=3e3,uL={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 Lje(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(uL[n]),color:"success"}:n==="failed"?{label:t(uL[n]),color:"danger"}:{label:t(uL[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function Z3t(e,t){return KQ(e,Date.now(),t)}function J3t(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function e4t(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Hg.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const a=Math.max(0,Math.floor((s-i)/1e3));if(a<60)return t("environmentCenter.duration.seconds",{count:a});const l=Math.floor(a/60),c=a%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function t4t({environment:e,onClose:t}){var O;const{t:n}=Te("ui"),i=((O=e.latestVersion)==null?void 0:O.versionId)??"",r=p.useId(),s=p.useRef(null),a=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?R3t(l):"",[l]);a.current=t,p.useEffect(()=>{var E;const w=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(E=s.current)==null||E.focus();const S=C=>{if(C.key==="Escape"){C.preventDefault(),a.current();return}if(C.key!=="Tab"||!s.current)return;const N=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!N.length)return;const _=N[0],j=N[N.length-1];C.shiftKey&&document.activeElement===_?(C.preventDefault(),j.focus()):!C.shiftKey&&document.activeElement===j&&(C.preventDefault(),_.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const w=new AbortController;return d(!0),h(""),N0e(e.id,i,w.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{w.signal.aborted||d(!1)}),()=>w.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const w=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(w)},[b]);const x=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:w=>{w.target===w.currentTarget&&t()},children:o.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("div",{className:"environment-build-dialog__title-row",children:o.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),o.jsxs("p",{children:[e.name," / ",i]})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-manifest-dialog__body",children:u?o.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:o.jsx(xn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?o.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[o.jsx("p",{children:f}),o.jsx(Ht,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(w=>w+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(zE,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?o.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(Ht,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void x(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function n4t({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,E;const{t:r}=Te("ui"),s=e.latestVersion,[a,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),x=p.useRef(t),O=p.useRef(n);p.useEffect(()=>{x.current=t,O.current=n},[n,t]),p.useEffect(()=>{var j;const C=document.body.style.overflow,N=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus();const _=A=>{var R;if(A.key==="Escape"&&x.current(),A.key!=="Tab")return;const F=Array.from(((R=y.current)==null?void 0:R.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>L.getClientRects().length>0);if(!F.length)return;const T=F[0],P=F[F.length-1];A.shiftKey&&document.activeElement===T?(A.preventDefault(),P.focus()):!A.shiftKey&&document.activeElement===P&&(A.preventDefault(),T.focus())};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",_),N!=null&&N.isConnected&&N.focus()}},[]),p.useEffect(()=>{if(!s)return;let C=0;const N=new AbortController,_=async()=>{u(!0);try{const j=await _0e(e.id,s.versionId,{includeLogs:!0,signal:N.signal});l(j),f(""),O.current(j),Hg.has(j.status)&&(C=window.setTimeout(_,Ute))}catch(j){if((j==null?void 0:j.name)==="AbortError")return;f(j instanceof Error?j.message:String(j)),C=window.setTimeout(_,Ute)}finally{N.signal.aborted||u(!1)}};return _(),()=>{N.abort(),window.clearTimeout(C)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!a||!Hg.has(a.status))return;const C=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(C)},[a==null?void 0:a.status]);const w=a?Lje({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(E=(S=a==null?void 0:a.resources)==null?void 0:S.codePipeline)==null?void 0:E.consoleUrl;return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:C=>{C.target===C.currentTarget&&t()},children:o.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"environment-build-dialog__title-row",children:[o.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),o.jsx(ba,{color:w.color,size:"sm",children:w.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-build-dialog__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),o.jsx("strong",{children:(a==null?void 0:a.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),o.jsx("strong",{children:a?e4t(a,r,h):"-"})]}),a!=null&&a.sourceCommitSha?o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),o.jsx("strong",{title:a.sourceCommitSha,children:a.sourceCommitSha.slice(0,12)})]}):null,k?o.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(gb,{"aria-hidden":!0})]}):null]}),o.jsxs("div",{className:"environment-build-dialog__body",children:[d?o.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,a!=null&&a.progressError?o.jsx("p",{className:"environment-build-dialog__notice",children:a.progressError}):null,o.jsx(l3t,{steps:(a==null?void 0:a.steps)??[],log:(a==null?void 0:a.logTail)??"",logError:a==null?void 0:a.logError,logTruncated:a==null?void 0:a.logTruncated,logUpdatedAt:a==null?void 0:a.logUpdatedAt,loading:c&&!!(a&&Hg.has(a.status))}),(a==null?void 0:a.status)==="failed"&&a.error?o.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:a.error}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!Hg.has(a.status)?o.jsx(Ht,{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 $je({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=Iu(e).map(a=>({value:a.value,label:a.label}));return o.jsxs("label",{className:"environment-field environment-region-field",children:[o.jsxs("span",{children:[r("environmentCenter.region"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:a=>i(a.value)})]})}function i4t({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:a,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),x=`${e.trim()}\0${t.trim()}`,O=r===x;p.useEffect(()=>()=>{const E=v.current;v.current=null,E==null||E.abort()},[]);const w=()=>{var E;(E=v.current)==null||E.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var N;const E=k8(e,f);if(E){b(E);return}y.current=x,(N=v.current)==null||N.abort();const C=new AbortController;v.current=C,m(!0),b("");try{const _=await w0e({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},C.signal);if(v.current!==C)return;u(_),d(x),c(_.dockerfiles.length===1?_.dockerfiles[0]:"")}catch(_){if((_==null?void 0:_.name)==="AbortError")return;b(W3t(_)),u(null),d(""),c("")}finally{v.current===C&&(v.current=null,m(!1))}},[x,t,c,d,u,e,f]);p.useEffect(()=>{if(s||O||y.current===x||k8(e,f))return;const E=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(E)},[x,s,k,O,e,f]);const S=O?(i==null?void 0:i.dockerfiles)??[]:[];return o.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[o.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[f("environmentCenter.git.address"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:E=>{w(),a(E.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(qr,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:E=>{w(),l(E.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(xn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:g}),o.jsxs(Ht,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[o.jsx(Kj,{}),f("common.retry")]})]}):null,!h&&!g&&O&&i?S.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),o.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsx(VE,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(E=>({value:E,label:E})),disabled:s||h,onChange:c})]}):null]})}function r4t({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=Te("ui");return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[c("environmentCenter.repository.type"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-repository-mode",value:t,options:Q3t(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),o.jsx($je,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(Ije,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function s4t({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=Te("ui"),u=Mje(i,c);return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsx($je,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(Ije,{region:t,value:n,disabled:r,onChange:a}),o.jsxs("label",{className:"environment-field environment-image-reference",children:[o.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?o.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):o.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function Fje(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const a=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=a,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function a4t({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),a=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";Fje(s,a,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await O0e(e.id,v)).shareCode;c(y),await d0e(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]),Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),o.jsx("p",{id:r,children:e.name})]}),o.jsx(Ht,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(xn,{as:"p",children:n("environmentCenter.share.generating")}):o.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?o.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):o.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[o.jsx("strong",{children:n("environmentCenter.share.failed")}),o.jsx("span",{children:f})]}),l?o.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[o.jsx("span",{children:n("environmentCenter.share.code")}),o.jsx(Rm,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),o.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,o.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?o.jsx(Ht,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(Ht,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function o4t({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),a=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,x]=p.useState(""),[O,w]=p.useState([]),k=p.useMemo(()=>ZF(f),[f]),S=k.length>S8,E=m==="inspecting"||m==="importing",C=b.filter(T=>T.status==="valid"),N=b.filter(T=>T.status==="invalid"),_=m==="ready"&&C.length>0;Fje(c,u,n,E);const j=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),x(""),w([]);try{const T=await S0e(k);v([...T].sort((P,R)=>P.index-R.index)),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,j())},[t,j]);const A=async()=>{if(_){g("importing"),x(""),w([]);try{const T=C.map(Q=>({code:k[Q.index],name:Q.name})).filter(Q=>!!Q.code),P=await k0e(T.map(Q=>Q.code)),R=P.filter(Q=>Q.status==="created").length,L=P.filter(Q=>Q.status==="duplicate").length,M=new Map(P.map(Q=>[Q.index,Q])),U=T.flatMap(({code:Q,name:q},B)=>{const ee=M.get(B);return!ee||ee.status==="failed"?[{code:Q,name:q,status:"valid",error:(ee==null?void 0:ee.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...N.flatMap(Q=>{const q=k[Q.index];return q?[{code:q,name:"",status:"invalid",error:Q.error||r("environmentCenter.import.invalidCode")}]:[]}),...U],K=new Map;if(P.forEach(Q=>{Q.environment&&K.set(Q.environment.id,Q.environment)}),i([...K.values()],R,L,H.length),!H.length){n();return}h(H.map(Q=>Q.code).join(` -`)),w(U),v(H.map((Q,q)=>({index:q,status:Q.status,name:Q.name,error:Q.status==="invalid"?Q.error:""}))),x(r("environmentCenter.import.partial",{created:R,remaining:H.length})),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("ready")}}},F=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):_?O.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:T=>{T.target===T.currentTarget&&!E&&n()},children:o.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":a,"aria-busy":E||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),o.jsx("p",{id:a,children:r("environmentCenter.import.description")})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:E,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-share-dialog__body",children:[o.jsxs("label",{className:"environment-share-dialog__field",children:[o.jsx("span",{children:r("environmentCenter.import.code")}),o.jsx(Rm,{ref:u,size:"lg",rows:6,value:f,disabled:E,"aria-invalid":S||N.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:T=>{h(T.currentTarget.value),g("editing"),v([]),x(""),w([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:S8,count:k.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?o.jsx(xn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):C.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:C.length,names:C.map(T=>T.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,N.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:N.map(T=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:T.index+1,error:T.error||r("environmentCenter.import.invalidCode")})},T.index))}):null,O.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:O.map((T,P)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:P+1,error:T.error})},`${T.code}:${P}`))}):null,y?o.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:E,onClick:n,children:r("common.cancel")}),o.jsx(Ht,{type:"button",color:"info",size:"sm",loading:E,disabled:E||!k.length||S||m==="ready"&&!_,onClick:()=>_?void A():void j(),children:F})]})]})}),document.body)}function l4t({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Je,Ce,Wt,ln,cn,Ot,jt;const{t:a,i18n:l}=Te("ui"),c=L3t(a),u=Y3t(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,x]=p.useState(""),O=p.useRef(null),[w,k]=p.useState(()=>d?B3t((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,E]=p.useState(((Je=u.gitSource)==null?void 0:Je.repositoryUrl)??""),[C,N]=p.useState(((Ce=u.gitSource)==null?void 0:Ce.ref)??""),[_,j]=p.useState(((Wt=u.gitSource)==null?void 0:Wt.dockerfilePath)??""),[A,F]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[T,P]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[R,L]=p.useState(u.containerRepository?"existing":"managed"),[M,U]=p.useState(((ln=u.containerRepository)==null?void 0:ln.region)??Ji(t)),[I,H]=p.useState(u.containerRepository??void 0),[K,Q]=p.useState(((cn=u.imageSource)==null?void 0:cn.region)??Ji(t)),[q,B]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[ee,le]=p.useState(((Ot=u.imageSource)==null?void 0:Ot.reference)??""),[se,re]=p.useState(!1),ge=p.useMemo(()=>_B(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),W=f.dockerfile??ge,X=w!=="none",ae=w==="aio-sandbox"?TB:w==="codex-sandbox"?OOe[t]:"",ue=X?_3t(b):b,Oe=X?QA(ae,""):"",ke=X?QA(ae,ue):b,st=y||(X?N3t(ue,ae,a):JQ(b,void 0,a)),Le=!!e,Me="environment-editor-form",[Ie,qe]=p.useState(!1),[Ae,ze]=p.useState(""),Ee=!!ke.trim()&&!st,De=`${S.trim()}\0${C.trim()}`,J=!k8(S,a)&&T===De&&!!_&&(R==="managed"||Bte(I)),he=Bte(q)&&!!ee.trim()&&!Mje(ee,a),_e=!!f.name.trim()&&!Ie&&(m==="custom"||m==="dockerfile"&&Ee||m==="git"&&J||m==="image"&&he),Ze=(ot,gt)=>{h(Pe=>({...Pe,optionIds:gt?[...Pe.optionIds,ot]:Pe.optionIds.filter(Et=>Et!==ot)}))},at=ot=>{x(""),v(X?QA(ae,ot):ot)},wt=async ot=>{if(!ot)return;const gt=await j3t(ot,a);x(gt.error),gt.content&&v(gt.content)},Se=()=>{x(""),v(Oe)},ve=async ot=>{if(ot.preventDefault(),!!_e){qe(!0),ze("");try{const gt=sat(ke);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?ke:m==="custom"?W:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...C.trim()?{ref:C.trim()}:{},dockerfilePath:_}:null,containerRepository:m==="git"&&R==="existing"?I:null,imageSource:m==="image"&&q?{...q,reference:ee.trim()}:null,...m==="dockerfile"?gt:{}})}catch(gt){ze(gt instanceof Error?gt.message:String(gt)),qe(!1)}}},He=f.name.trim()||(Le?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Th,{className:"environment-editor","aria-label":a(Le?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(uE,{title:He,description:a("environmentCenter.editorDescription"),identitySeed:He,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(Ht,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Ie,children:a("common.delete")}):null,r?o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Ie,children:a("environmentCenter.share.action")}):null,o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Ie,children:a("common.cancel")}),o.jsx(Ht,{color:"info",size:"sm",type:"submit",form:Me,disabled:!_e,children:a(Ie?"common.saving":m==="image"?Le?"environmentCenter.save":"environmentCenter.create":Le?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:Me,className:"environment-form",onSubmit:ve,children:[o.jsxs("div",{className:"environment-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.name"),o.jsx(Eu,{})]}),o.jsx(qr,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:ot=>h(gt=>({...gt,name:ot.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Rm,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:ot=>h(gt=>({...gt,description:ot.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{const gt=ot.value;g(gt),gt==="dockerfile"&&!b.trim()&&v(Oe),ze("")}}),o.jsx("small",{children:(jt=c.find(ot=>ot.value===m))==null?void 0:jt.description})]}),Ae?o.jsx("p",{className:"environment-form-error",role:"alert",children:Ae}):null,m==="custom"?o.jsxs("div",{className:"environment-configuration",children:[o.jsx("section",{className:"environment-section environment-form-section","aria-label":a("environmentCenter.baseConfiguration"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.baseEnvironment"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-base-environment",value:f.baseEnvironment,options:$3t.map(ot=>({...ot,description:a(`environmentCenter.baseDescriptions.${ot.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{const gt=ot.value,Pe=gt==="aio-sandbox"||gt==="codex-sandbox";h(Et=>({...Et,baseEnvironment:gt,operatingSystem:Pe?"ubuntu-22.04":Et.operatingSystem,language:Pe?"python-3.12":Et.language}))}}),o.jsx("small",{children:a(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.operatingSystem"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-operating-system",value:f.operatingSystem,options:U3t,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ot=>h(gt=>({...gt,operatingSystem:ot.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:S6(f.baseEnvironment),value:"Ubuntu 22.04"}):a("environmentCenter.selectUbuntuVersion")})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.pythonVersion"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?$te.filter(ot=>ot.value==="python-3.12"):$te,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ot=>h(gt=>({...gt,language:ot.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:S6(f.baseEnvironment),value:"Python 3.12"}):a("environmentCenter.selectPythonVersion")})]})]})}),o.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[o.jsx("h2",{id:"environment-skills-title",children:a("environmentCenter.skills")}),o.jsxs("div",{className:"environment-skill-grid",children:[o.jsx(Lte,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:se,disabled:Ie,onChange:re,icon:o.jsx("img",{src:ER,alt:""})}),o.jsx(ZQ,{selected:f.selectedSkills,onChange:ot=>h(gt=>({...gt,selectedSkills:ot})),cloudProvider:t,disabled:Ie,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),AB.map(ot=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${ot.id}-title`,children:[o.jsx("h2",{id:`environment-${ot.id}-title`,children:a(`environmentCenter.categories.${ot.id}`)}),o.jsx("div",{className:"environment-option-grid",children:ot.options.map(gt=>{const Pe=f.optionIds.includes(gt.id);return o.jsx(Lte,{name:gt.label,description:a(`environmentCenter.options.${gt.id}`,{defaultValue:gt.description}),selected:Pe,onChange:Et=>Ze(gt.id,Et),icon:o.jsx(X3t,{option:gt})},gt.id)})})]},ot.id))]}):m==="dockerfile"?o.jsxs("section",{className:"environment-upload","aria-label":a("environmentCenter.customDockerfile"),children:[o.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("environmentCenter.presetEnvironment")}),o.jsx(Ls,{id:"environment-dockerfile-base-environment",value:w,options:F3t(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{x(""),k(ot.value)}}),o.jsx("small",{children:a("environmentCenter.presetHint")})]})}),o.jsxs("div",{className:"environment-upload__preview",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:jje(ke).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:O,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:ot=>{var Pe;const gt=ot.currentTarget;wt((Pe=gt.files)==null?void 0:Pe[0]).finally(()=>{gt.value=""})}}),o.jsx(Ht,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Ie,onClick:()=>{var ot;return(ot=O.current)==null?void 0:ot.click()},children:a("environmentCenter.upload")}),o.jsx(Ht,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Ie||!ue,onClick:Se,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${X?" has-fixed-base":""}${st?" is-invalid":""}`,children:[X?o.jsxs("div",{className:"environment-dockerfile-from","aria-label":a("environmentCenter.dockerfileBaseImage"),children:[o.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),o.jsxs("code",{children:[o.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),o.jsx("span",{title:ae,children:ae})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(zE,{value:ue,path:"Dockerfile",lineNumberStart:X?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:at})})]})]}),st?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:st}):null]}):m==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(i4t,{repositoryUrl:S,gitRef:C,dockerfilePath:_,inspection:A,inspectedKey:T,disabled:Ie,onRepositoryUrlChange:E,onGitRefChange:N,onDockerfilePathChange:j,onInspectionChange:F,onInspectedKeyChange:P}),o.jsx(r4t,{cloudProvider:t,mode:R,region:M,value:I,disabled:Ie,onModeChange:ot=>{L(ot),ze("")},onRegionChange:ot=>{U(ot),H(void 0),ze("")},onChange:H})]}):o.jsx(s4t,{cloudProvider:t,region:K,repository:q,reference:ee,disabled:Ie,onRegionChange:ot=>{Q(ot),B(void 0),ze("")},onRepositoryChange:B,onReferenceChange:le})]})})})}function Bje({cloudProvider:e="volcengine",onWorkspace:t,clipboardImport:n=null,clipboardReadError:i=""}){const{t:r,i18n:s}=Te("ui"),[a,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(null),[g,b]=p.useState(null),[v,y]=p.useState(null),[x,O]=p.useState(null),[w,k]=p.useState(null),S=p.useRef(0),[E,C]=p.useState(""),[N,_]=p.useState(!1),[j,A]=p.useState(i),[F,T]=p.useState(!0),[P,R]=p.useState(""),[L,M]=p.useState(0),[U,I]=p.useState(()=>new Set),H=p.useDeferredValue(d),K=p.useMemo(()=>{const W=H.trim().toLocaleLowerCase();return W?a.filter(X=>`${X.name} ${X.description} ${O6(X.operatingSystem)} ${oh(X.language)} ${S6(X.baseEnvironment)}`.toLocaleLowerCase().includes(W)):a},[H,a]),Q=p.useCallback((W="",X=!1)=>{S.current+=1,k({key:S.current,initialValue:W,autoInspect:X})},[]),q=p.useCallback((W,X=!1)=>{const ae=W.trim();if(!ae.startsWith("akenv://")||!X&&Fte.has(ae))return!1;const ue=ZF(ae);return!ue.length||ue.length>S8?!1:(Fte.add(ae),A(""),Q(ae,!0),!0)},[Q]),B=p.useCallback(async()=>{var W;if(!(c.kind!=="list"||w)){if(typeof navigator>"u"||!((W=navigator.clipboard)!=null&&W.readText)){A(r("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!q(X)&&!X.trim()&&await z3t()&&A(r("environmentCenter.clipboardReadError"))}catch{A(r("environmentCenter.clipboardReadError"))}}},[w,q,r,c.kind]);p.useEffect(()=>{const W=new AbortController;return a.length===0&&T(!0),R(""),Vk(W.signal).then(X=>{l(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&R(X instanceof Error?X.message:String(X))}).finally(()=>{W.signal.aborted||T(!1)}),()=>W.abort()},[L]),p.useEffect(()=>{if(!a.some(X=>X.latestVersion&&Hg.has(X.latestVersion.status)))return;const W=window.setTimeout(()=>M(X=>X+1),2500);return()=>window.clearTimeout(W)},[a]),p.useEffect(()=>{if(!E||N)return;const W=window.setTimeout(()=>C(""),2800);return()=>window.clearTimeout(W)},[N,E]),p.useEffect(()=>{i&&A(i)},[i]),p.useEffect(()=>{n&&q(n.text)},[n,q]),p.useEffect(()=>{if(c.kind!=="list")return;const W=()=>void B(),X=()=>{document.visibilityState==="visible"&&B()},ae=ue=>{var st;const Oe=ue.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const ke=((st=ue.clipboardData)==null?void 0:st.getData("text/plain"))??"";q(ke,!0)&&ue.preventDefault()};return window.addEventListener("focus",W),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ae),()=>{window.removeEventListener("focus",W),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ae)}},[q,B,c.kind]);const ee=c.kind==="editor"&&c.environmentId?a.find(W=>W.id===c.environmentId):void 0,le=async W=>{const X={...W,dockerfile:W.dockerfile??_B(W,e)},ae=ee?await T0e(ee.id,X):await C0e(X);if(l(ue=>[ae,...ue.filter(Oe=>Oe.id!==ae.id)]),u({kind:"list"}),_(!1),X.imageSource){C(r("environmentCenter.status.boundImage",{name:ae.name}));return}try{const ue=await S4(ae.id);l(Oe=>Oe.map(ke=>ke.id===ae.id?{...ke,latestVersion:ue}:ke)),C(r("environmentCenter.status.queued",{name:ae.name}))}catch(ue){_(!0),C(r("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},se=async W=>{if(!U.has(W.id)){I(X=>new Set(X).add(W.id)),_(!1);try{const X=await S4(W.id);l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue)),C(r("environmentCenter.status.queued",{name:W.name}))}catch(X){_(!0),C(X instanceof Error?X.message:String(X))}finally{I(X=>{const ae=new Set(X);return ae.delete(W.id),ae})}}},re=(W,X,ae,ue)=>{W.length&&l(Oe=>{const ke=new Set(W.map(st=>st.id));return[...W,...Oe.filter(st=>!ke.has(st.id))]}),_(ue>0),C(ue>0?r("environmentCenter.status.importedFailed",{created:X,failed:ue}):ae>0?r("environmentCenter.status.importedDuplicate",{created:X,duplicate:ae}):r("environmentCenter.status.imported",{count:X}))},ge=h?o.jsx(pc,{title:r("environmentCenter.deleteTitle"),description:r("environmentCenter.deleteDescription",{name:h.name}),confirmLabel:r("common.delete"),variant:"danger",onCancel:()=>m(null),onConfirm:()=>{const W=h;m(null),u({kind:"list"}),A0e(W.id).then(()=>{l(X=>X.filter(ae=>ae.id!==W.id)),_(!1),C(r("environmentCenter.status.deleted",{name:W.name}))}).catch(X=>{_(!0),C(X instanceof Error?X.message:String(X))})}}):null;return c.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(l4t,{environment:ee,cloudProvider:e,onCancel:()=>u({kind:"list"}),onDelete:ee?()=>m(ee):void 0,onShare:ee?()=>O(ee):void 0,onSave:le},c.environmentId??"new"),x?o.jsx(a4t,{environment:x,onClose:()=>O(null)}):null,ge]}):o.jsxs(Th,{className:"environment-center","aria-label":r("environmentCenter.title"),children:[o.jsx(zx,{title:r("environmentCenter.title")}),o.jsxs(Zb,{className:"environment-toolbar",children:[t?o.jsx(dE,{items:[{id:"workspaces",label:r("workspace.title")},{id:"environments",label:r("environmentCenter.title")}],value:"environments",onChange:W=>{W==="workspaces"&&t()},ariaLabel:r("workspace.resourceType"),idPrefix:"environment-center"}):null,o.jsxs("div",{className:"resource-toolbar__actions",children:[E?o.jsx("span",{className:`environment-status${N?" is-error":""}`,role:N?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(wm,{"aria-label":r("environmentCenter.search"),value:d,onChange:W=>f(W.target.value),placeholder:r("environmentCenter.search")})]})]}),j?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:j}),o.jsx(Ht,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{A(""),Q()},children:r("environmentCenter.manualImport")})]}):null,o.jsx(Jb,{"aria-live":"polite",children:F?o.jsx(Ud,{}):P?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:jd(P,s.resolvedLanguage||s.language)||r("environmentCenter.loadFailed")}),o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:()=>M(W=>W+1),children:r("common.reload")})]}):K.length===0&&d.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(G3t,{})}),o.jsx(Cn.Title,{children:r("environmentCenter.noMatches")}),o.jsx(Cn.Description,{children:r("environmentCenter.tryAnotherName")})]})}):o.jsxs(Vx,{children:[d.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(Cb,{"aria-label":r("environmentCenter.create"),icon:o.jsx(H3t,{}),onClick:()=>u({kind:"editor",environmentId:null}),children:r("environmentCenter.create")}),o.jsx(Cb,{"aria-label":r("environmentCenter.import.title"),icon:o.jsx(q3t,{}),onClick:()=>Q(),children:r("environmentCenter.import.title")})]}),K.map(W=>{var Oe,ke;const X=Lje(W,r),ae=!!(W.latestVersion&&Hg.has(W.latestVersion.status)),ue=U.has(W.id);return o.jsx(pE,{className:"environment-card",title:W.name,status:o.jsx(ba,{color:X.color,size:"sm",children:X.label}),description:((Oe=W.latestVersion)==null?void 0:Oe.error)||(ae?(ke=W.latestVersion)==null?void 0:ke.currentStep:"")||W.description||r("common.noDescription"),metadata:[{label:r("workspace.updated"),value:Z3t(W.updatedAt,s.resolvedLanguage??s.language),title:J3t(W.updatedAt,s.resolvedLanguage??s.language)}],action:{label:W.latestVersion?r("environmentCenter.buildDetails.title"):r(ue?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:r("environmentCenter.build"),disabled:ue,onClick:()=>W.latestVersion?b(W.id):void se(W)},auxiliaryAction:{label:r("environmentCenter.manifest.view"),icon:o.jsx(zFe,{}),title:W.latestVersion?r("environmentCenter.manifest.viewShort"):r("environmentCenter.manifest.unavailable"),disabled:!W.latestVersion,onClick:()=>y(W)},detailAction:{label:r("environmentCenter.configure"),onClick:()=>u({kind:"editor",environmentId:W.id})}},W.id)})]})}),g?(()=>{const W=a.find(X=>X.id===g);return W?o.jsx(n4t,{environment:W,onClose:()=>b(null),onBuildUpdate:X=>{l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue))},onRebuild:()=>se(W)}):null})():null,v!=null&&v.latestVersion?o.jsx(t4t,{environment:v,onClose:()=>y(null)}):null,ge,w?o.jsx(o4t,{initialValue:w.initialValue,autoInspect:w.autoInspect,onClose:()=>k(null),onImported:re},w.key):null]})}function c4t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function u4t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),o.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function E8(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 d4t(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 f4t({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=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,x]=p.useState(""),O=m.trim().toLocaleLowerCase(),w=t.filter(S=>`${S.name} ${S.description} ${oh(S.language)}`.toLocaleLowerCase().includes(O)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),x("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(E){x(E instanceof Error?E.message:String(E)),v(!1)}}};return o.jsx(Th,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(uE,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[r?o.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,o.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?o.jsxs(jB,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("common.environment")}),o.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.createdAt")}),o.jsx("dd",{children:E8(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:E8(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[o.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[o.jsxs("label",{children:[o.jsx("span",{children:s("common.name")}),o.jsx(qr,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Rm,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(BOe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(wm,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noAvailableEnvironments")}),o.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):w.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noMatchingEnvironments")}),o.jsx("span",{children:s("workspace.tryAnotherName")})]}):o.jsx("div",{className:"workspace-environment-list",children:w.map(S=>{var N;const E=f.includes(S.id),C=((N=S.latestVersion)==null?void 0:N.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${E?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:E,onChange:()=>h(_=>E?_.filter(j=>j!==S.id):[..._,S.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:S.name,children:S.name}),o.jsxs("span",{children:[oh(S.language)," · ",C]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(E?"workspace.added":"common.add")})]},S.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function h4t({onEnvironment:e}){const{t,i18n:n}=Te("ui"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState({kind:"list"}),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(""),[y,x]=p.useState(!1),[O,w]=p.useState(null),[k,S]=p.useState(0),E=p.useDeferredValue(u);p.useEffect(()=>{const j=new AbortController;return h(!0),g(""),Promise.all([t7(j.signal),Vk(j.signal)]).then(([A,F])=>{r(A),a(F)}).catch(A=>{(A==null?void 0:A.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",A),g(t("workspace.loadFailed")))}).finally(()=>{j.signal.aborted||h(!1)}),()=>j.abort()},[k,t]),p.useEffect(()=>{if(!b||y)return;const j=window.setTimeout(()=>v(""),2800);return()=>window.clearTimeout(j)},[y,b]);const C=p.useMemo(()=>new Map(s.map(j=>[j.id,j])),[s]),N=p.useMemo(()=>{const j=E.trim().toLocaleLowerCase();return j?i.filter(A=>{const F=A.environmentIds.map(T=>{var P;return((P=C.get(T))==null?void 0:P.name)??""}).join(" ");return`${A.name} ${A.description} ${F}`.toLocaleLowerCase().includes(j)}):i},[E,C,i]),_=l.kind==="detail"&&l.workspaceId?i.find(j=>j.id===l.workspaceId):void 0;return l.kind==="detail"?o.jsx(f4t,{workspace:_,environments:s,onBack:()=>c({kind:"list"}),onDelete:_?()=>w(_):null,onSave:async j=>{const A=_?await v0e(_.id,j):await y0e(j);r(F=>[A,...F.filter(T=>T.id!==A.id)]),x(!1),v(t("workspace.saved",{name:A.name})),c({kind:"list"})}},l.workspaceId??"new"):o.jsxs(Th,{className:"workspace-center","aria-label":t("workspace.title"),children:[o.jsx(zx,{title:t("workspace.title")}),o.jsxs(Zb,{children:[o.jsx(dE,{items:[{id:"workspaces",label:t("workspace.title")},{id:"environments",label:t("common.environment")}],value:"workspaces",onChange:j=>{j==="environments"&&e()},ariaLabel:t("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsxs("div",{className:"resource-toolbar__actions",children:[b?o.jsx("span",{className:`workspace-status${y?" is-error":""}`,role:y?"alert":"status","aria-live":"polite",children:b}):null,o.jsx(wm,{"aria-label":t("workspace.searchWorkspaces"),value:u,onChange:j=>d(j.target.value),placeholder:t("workspace.searchWorkspaces")})]})]}),o.jsx(Jb,{"aria-live":"polite",children:f?o.jsx(Ud,{}):m?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:m}),o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:()=>S(j=>j+1),children:t("common.reload")})]}):N.length===0&&u.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(u4t,{})}),o.jsx(Cn.Title,{children:t("workspace.noMatchingWorkspaces")}),o.jsx(Cn.Description,{children:t("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(Vx,{children:[u.trim()?null:o.jsx(Cb,{"aria-label":t("workspace.create"),icon:o.jsx(c4t,{}),onClick:()=>c({kind:"detail",workspaceId:null}),children:t("workspace.create")}),N.map(j=>{const A=d4t(j,C),F=j.environmentIds.filter(T=>!C.has(T)).length;return o.jsx(pE,{className:"workspace-card",title:j.name,status:o.jsx(ba,{color:F?"danger":A===j.environmentIds.length&&A>0?"success":"secondary",size:"sm",children:j.environmentIds.length===0?t("workspace.noEnvironmentAdded"):F?t("workspace.environmentMissing"):t("workspace.availableFraction",{available:A,total:j.environmentIds.length})}),description:j.description||t("common.noDescription"),metadata:[{label:t("common.environment"),value:t("workspace.environmentCount",{count:j.environmentIds.length})},{label:t("workspace.available"),value:t("workspace.availableCount",{count:A})},{label:t("workspace.updated"),value:E8(j.updatedAt,n.resolvedLanguage??n.language)}],detailAction:{label:t("common.manage"),onClick:()=>c({kind:"detail",workspaceId:j.id})},action:{label:t("workspace.addEnvironment"),icon:"plus",onClick:()=>c({kind:"detail",workspaceId:j.id})}},j.id)})]})}),O?o.jsx(pc,{title:t("workspace.deleteTitle"),description:t("workspace.deleteDescription",{name:O.name}),confirmLabel:t("common.delete"),variant:"danger",onCancel:()=>w(null),onConfirm:()=>{const j=O;w(null),x0e(j.id).then(()=>{r(A=>A.filter(F=>F.id!==j.id)),x(!1),v(t("workspace.deleted",{name:j.name})),c({kind:"list"})}).catch(A=>{x(!0),v(A instanceof Error?A.message:String(A))})}}):null]})}function p4t({cloudProvider:e}){const{t}=Te("ui"),[n,i]=p.useState("workspaces"),[r,s]=p.useState(null),[a,l]=p.useState(""),c=p.useRef(0),u=()=>{var h;c.current+=1;const d=c.current;l("");let f=null;if(typeof navigator<"u"&&((h=navigator.clipboard)!=null&&h.readText))try{f=navigator.clipboard.readText()}catch{l(t("workspace.clipboardPermissionError"))}else l(t("workspace.clipboardUnsupported"));i("environments"),f&&f.then(async m=>{var g;if(c.current===d){if(m.trim()){s({key:d,text:m});return}try{const b=await((g=navigator.permissions)==null?void 0:g.query({name:"clipboard-read"}));c.current===d&&(b==null?void 0:b.state)==="denied"&&l(t("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{c.current===d&&l(t("workspace.clipboardPermissionError"))})};return n==="environments"?o.jsx(Bje,{cloudProvider:e,onWorkspace:()=>i("workspaces"),clipboardImport:r,clipboardReadError:a}):o.jsx(h4t,{onEnvironment:u})}function m4t(e){return e==="127.0.0.1"}const g4t={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."},b4t={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."};an.hasResourceBundle("en-US","automations")||an.addResourceBundle("en-US","automations",Qre,!0,!0);an.hasResourceBundle("zh-CN","automations")||an.addResourceBundle("zh-CN","automations",sce,!0,!0);function Vd(e,t={}){return an.t(e,{...t,ns:"automations"})}const Uje={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},Qje={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},zje={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},Vje={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},y4t="https://ark.cn-beijing.volces.com/api/coding/v3";function v4t(e){return e==="byteplus"?xl(e):y4t}function ez(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 Hje(e){const t=ez(e);return[Vd("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Vd("github.sessionToken",{sessionToken:t.sessionToken})]}function tz(e){return e==="byteplus"?"BytePlus":"Volcengine"}function nz(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:v4t(e),region:Ji(e),token:"",...t}}function qje(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const x4t={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})=>nz(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},w4t="https://api.github.com",O4t=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Qte=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,S4t=/^[A-Za-z0-9._/-]+$/;function k4t(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?V("github.invalidToken"):e===404?V("github.notFound"):e===422?V("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||V("github.requestFailed",{status:e})}async function ug(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${w4t}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(V("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(k4t(i.status,r,t.token));return{status:i.status,payload:r}}function dL(e){return e.split("/").map(encodeURIComponent).join("/")}function E4t(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:rz(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await ug(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ug(`${a}/git/ref/heads/${dL(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(V("github.missingBaseSha"));const u=C4t(e.branchPrefix);await ug(`${a}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=dL(m.path),b=await ug(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:m.path}));await ug(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:E4t(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ug(`${a}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(V("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ug(`${a}/git/refs/heads/${dL(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function T4t(e,t){const n=await An("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function A4t(e){const t=await An("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await HE(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function _4t(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 An(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(a=>typeof a!="object"||a===null||typeof a.installationId!="number"||typeof a.account!="string"||typeof a.fullName!="string"||typeof a.htmlUrl!="string"||typeof a.private!="boolean"||typeof a.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function N4t(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await An(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function j4t(e,t){const n=await An("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function HE(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const R4t=/^[A-Za-z0-9_-]+$/,Gje=4,cj=64,uj=6,Vte="agent-runtime";function Kje(e){const t=e.trim();if(!t)return Vte;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,cj);return n?(n.length$t(`validation.runtimeName.${n}`)){return e?R4t.test(e)?e.lengthcj?t("length"):null:t("characters"):t("required")}const D4t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,M4t="cn-hongkong";function L4t(e){const t=qE(e.runtimeName,n=>Vd(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!D4t.test(e.runtimeId))throw new Error(Vd("github.validation.runtimeId"))}function Yje(e){L4t(e);const t=e.cloudProvider??"volcengine",n=ez(t),i=t==="byteplus"?` +${i}`:n}function j3t(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?vv("duplicateFrom",n):JQ(QA(t,e),void 0,n):vv("baseImageRequired",n)}function JQ(e,t=Rje(e),n){return t>jje?vv("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":vv("missingFrom",n):vv("empty",n)}async function R3t(e,t){if(e.size>jje)return{content:"",error:vv("tooLarge",t)};const n=zI(await e.text());return{content:n,error:JQ(n,e.size,t)}}function I3t(e){return FU(e,{lineWidth:0})}function P3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function D3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function VE({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:a,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),x=p.useRef(null),O=p.useRef(null),w=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[E,C]=p.useState(!1),[N,_]=p.useState(0),j=r.find(M=>M.value===t),A=(j==null?void 0:j.label)??(t?n:void 0),F=a!==void 0&&!!f,T=()=>{C(!1),F&&a&&(f==null||f(""))};p.useEffect(()=>{if(!E)return;const M=U=>{U.target instanceof Node&&x.current&&!x.current.contains(U.target)&&T()};return window.addEventListener("pointerdown",M),()=>window.removeEventListener("pointerdown",M)},[E,f,a,F]),p.useEffect(()=>{var M,U;if(E){if(F){(M=w.current)==null||M.focus();return}(U=S.current[N])==null||U.focus()}},[E,F]),p.useEffect(()=>{var M;!E||F&&document.activeElement===w.current||(M=S.current[N])==null||M.focus()},[N,E,F]),p.useEffect(()=>{_(M=>Math.min(M,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!E||!u||c||!h)return;const M=window.requestAnimationFrame(()=>{const U=k.current;U&&U.scrollHeight<=U.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(M)},[u,c,h,E,r.length]);const P=(M=1)=>{const U=r.findIndex(H=>H.value===t),I=U>=0?U:M===1?0:Math.max(0,r.length-1);_(I),C(!0)},R=M=>{r.length!==0&&_((M+r.length)%r.length)},L=M=>{var U;m(M.value),T(),(U=O.current)==null||U.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:x,onKeyDown:M=>{var I,H;const U=M.target===w.current;if(M.key==="Escape"&&E){M.preventDefault(),T(),(I=O.current)==null||I.focus();return}if(M.key==="Tab"){T();return}if(U){M.key==="ArrowDown"&&r.length>0&&(M.preventDefault(),_(0),(H=S.current[0])==null||H.focus());return}M.key==="ArrowDown"?(M.preventDefault(),E?R(N+1):P(1)):M.key==="ArrowUp"?(M.preventDefault(),E?R(N-1):P(-1)):E&&M.key==="Home"?(M.preventDefault(),_(0)):E&&M.key==="End"&&(M.preventDefault(),_(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:O,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":E,"aria-controls":E?y:void 0,disabled:s,onClick:()=>{E?T():P()},children:[o.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),o.jsx(P3t,{className:`pp-deployment-select-chevron${E?" is-open":""}`})]}),E&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[F&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:w,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:M=>f==null?void 0:f(M.currentTarget.value)})}),o.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:M=>{if(!u||c||!h)return;const U=M.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<=24&&h()},children:r.map((M,U)=>{const I=M.value===t;return o.jsxs("button",{ref:H=>{S.current[U]=H},type:"button",role:"option","aria-selected":I,tabIndex:U===N?0:-1,className:`pp-deployment-select-option${I?" is-selected":""}`,title:M.description,onFocus:()=>_(U),onClick:()=>L(M),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[M.label,M.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:M.badge})]}),M.description&&o.jsx("small",{children:M.description})]}),I&&o.jsx(D3t,{})]},M.value)})}),c&&o.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&o.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function M3t(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 Ije={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function $f(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,a]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,x]=p.useState(""),[O,w]=p.useState(""),[k,S]=p.useState(0),E=p.useRef(!1),C=p.useRef(null),N=e?JSON.stringify(e):"",_=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const P=window.setTimeout(()=>{x(b.trim())},250);return()=>window.clearTimeout(P)},[b]),p.useEffect(()=>{v(""),x("")},[N]);const j=p.useCallback((P,R)=>{var U;if(!_)return;(U=C.current)==null||U.abort();const L=new AbortController;C.current=L;const M=JSON.parse(_);R&&n([]),E.current=!0,h(!0),g(null),c0e({...M,pageNumber:P,pageSize:100},L.signal).then(I=>{n(H=>{if(R)return I.items;const K=new Set(H.map(Q=>`${Q.id}\0${Q.name}`));return[...H,...I.items.filter(Q=>!K.has(`${Q.id}\0${Q.name}`))]}),r(I.serviceRegion),a(I.pageNumber),c(I.totalCount),d(I.hasMore),w(_)}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(w(_),g(I instanceof Error?I.message:String(I)))}).finally(()=>{C.current===L&&(C.current=null,E.current=!1,h(!1))})},[_]);p.useEffect(()=>{var P;if(!_){(P=C.current)==null||P.abort(),C.current=null,E.current=!1,n([]),r(""),a(1),c(0),d(!1),w(""),h(!1),g(null);return}return j(1,!0),()=>{var R;return(R=C.current)==null?void 0:R.abort()}},[j,_,k]);const A=!!_&&O===_&&b.trim()===y,F=p.useCallback(()=>{w(""),S(P=>P+1)},[]),T=p.useCallback(()=>{!A||E.current||!u||j(s+1,!1)},[u,j,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!_&&(!A||f),error:m,search:b,setSearch:v,reload:F,loadMore:T}}function L3t(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Ff({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>L3t(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(VE,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[a]===d);f&&l(f)}}),s?o.jsx("span",{className:"pp-resource-status",children:s}):i.error?o.jsxs("div",{className:"pp-resource-error",role:"alert",children:[o.jsx("span",{children:i.error}),o.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?o.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?o.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?o.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function Pje({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=$f(e?{kind:"cr-registry",region:e}:null),a=$f(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=$f(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.registryInstance")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:a,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function lL({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(VE,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:M3t(r),disabled:n,onChange:s=>i(s)})]})}function z0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:e}),o.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function cL({items:e,note:t}){const{t:n}=Te("ui");return o.jsxs("div",{className:"pp-resource-auto-names",children:[o.jsx("span",{children:n("deploymentResources.automaticNames")}),o.jsx("dl",{children:e.map(i=>o.jsxs("div",{children:[o.jsx("dt",{children:i.label}),o.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&o.jsx("small",{children:t})]})}function Dje(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?an.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()))?an.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?an.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?an.t("ui:deploymentResources.validation.existingCodePipeline"):null}function Mje({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){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=$f(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=$f(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=$f(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=$f(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=$f(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=$f(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=x=>a({...e,...x});return o.jsxs("div",{className:"pp-resource-list",children:[o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:x=>y({tos:{mode:x}})}),e.tos.mode==="create"&&o.jsx(z0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x.name}})})]}),e.tos.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:"CR",value:e.cr.mode,disabled:r,onChange:x=>y({cr:{mode:x}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(z0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:x=>y({cr:{...e.cr,instance:x}})}),o.jsx(z0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:x=>y({cr:{...e.cr,namespace:x}})}),o.jsx(z0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:x=>y({cr:{...e.cr,repository:x}})})]}),e.cr.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.crInstance")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:x=>y({cr:{mode:"existing",instance:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:x=>y({cr:{...e.cr,namespace:x.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:x=>y({cr:{...e.cr,repository:x.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(lL,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:x=>y({codePipeline:{mode:x}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(z0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,workspaceName:x}})}),o.jsx(z0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineName:x}})})]}),e.codePipeline.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.workspace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:x=>y({codePipeline:{mode:"existing",workspaceId:x.id,workspaceName:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineId:x.id,pipelineName:x.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(cL,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&o.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function $3t(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 F3t=OOe.map(e=>({value:e.id,label:e.label,description:e.description}));function B3t(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 U3t(e){const t=_3t(e,"");return t===TB?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const Q3t=oN.map(e=>({value:e.id,label:e.label})),$te=kOe.map(e=>({value:e.id,label:e.label}));function z3t(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const S8=20,Fte=new Set;async function V3t(){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 H3t={opencli:YLt,uv:ZLt,playwright:JLt,chromium:e3t,git:t3t,curl:n3t,ffmpeg:i3t,imagemagick:r3t};function q3t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Eu(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function W3t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),o.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function k8(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 Bte(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function Lje(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 G3t(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function K3t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),o.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function X3t({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function Y3t({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:QI,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:XLt,alt:""});if(e.id==="github-cli")return o.jsx(YQ,{});const t=H3t[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(X3t,{label:e.label})}function Z3t(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===_B(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...gM,optionIds:[...gM.optionIds],selectedSkills:[...gM.selectedSkills]}}const Hg=new Set(["preparing","queued","building","scanning"]),Ute=3e3,uL={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 $je(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(uL[n]),color:"success"}:n==="failed"?{label:t(uL[n]),color:"danger"}:{label:t(uL[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function J3t(e,t){return KQ(e,Date.now(),t)}function e4t(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function t4t(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Hg.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const a=Math.max(0,Math.floor((s-i)/1e3));if(a<60)return t("environmentCenter.duration.seconds",{count:a});const l=Math.floor(a/60),c=a%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function n4t({environment:e,onClose:t}){var O;const{t:n}=Te("ui"),i=((O=e.latestVersion)==null?void 0:O.versionId)??"",r=p.useId(),s=p.useRef(null),a=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?I3t(l):"",[l]);a.current=t,p.useEffect(()=>{var E;const w=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(E=s.current)==null||E.focus();const S=C=>{if(C.key==="Escape"){C.preventDefault(),a.current();return}if(C.key!=="Tab"||!s.current)return;const N=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!N.length)return;const _=N[0],j=N[N.length-1];C.shiftKey&&document.activeElement===_?(C.preventDefault(),j.focus()):!C.shiftKey&&document.activeElement===j&&(C.preventDefault(),_.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const w=new AbortController;return d(!0),h(""),j0e(e.id,i,w.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{w.signal.aborted||d(!1)}),()=>w.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const w=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(w)},[b]);const x=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:w=>{w.target===w.currentTarget&&t()},children:o.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("div",{className:"environment-build-dialog__title-row",children:o.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),o.jsxs("p",{children:[e.name," / ",i]})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-manifest-dialog__body",children:u?o.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:o.jsx(xn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?o.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[o.jsx("p",{children:f}),o.jsx(Ht,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(w=>w+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(zE,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?o.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(Ht,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void x(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function i4t({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,E;const{t:r}=Te("ui"),s=e.latestVersion,[a,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),x=p.useRef(t),O=p.useRef(n);p.useEffect(()=>{x.current=t,O.current=n},[n,t]),p.useEffect(()=>{var j;const C=document.body.style.overflow,N=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus();const _=A=>{var R;if(A.key==="Escape"&&x.current(),A.key!=="Tab")return;const F=Array.from(((R=y.current)==null?void 0:R.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>L.getClientRects().length>0);if(!F.length)return;const T=F[0],P=F[F.length-1];A.shiftKey&&document.activeElement===T?(A.preventDefault(),P.focus()):!A.shiftKey&&document.activeElement===P&&(A.preventDefault(),T.focus())};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",_),N!=null&&N.isConnected&&N.focus()}},[]),p.useEffect(()=>{if(!s)return;let C=0;const N=new AbortController,_=async()=>{u(!0);try{const j=await N0e(e.id,s.versionId,{includeLogs:!0,signal:N.signal});l(j),f(""),O.current(j),Hg.has(j.status)&&(C=window.setTimeout(_,Ute))}catch(j){if((j==null?void 0:j.name)==="AbortError")return;f(j instanceof Error?j.message:String(j)),C=window.setTimeout(_,Ute)}finally{N.signal.aborted||u(!1)}};return _(),()=>{N.abort(),window.clearTimeout(C)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!a||!Hg.has(a.status))return;const C=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(C)},[a==null?void 0:a.status]);const w=a?$je({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(E=(S=a==null?void 0:a.resources)==null?void 0:S.codePipeline)==null?void 0:E.consoleUrl;return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:C=>{C.target===C.currentTarget&&t()},children:o.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"environment-build-dialog__title-row",children:[o.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),o.jsx(ba,{color:w.color,size:"sm",children:w.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-build-dialog__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),o.jsx("strong",{children:(a==null?void 0:a.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),o.jsx("strong",{children:a?t4t(a,r,h):"-"})]}),a!=null&&a.sourceCommitSha?o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),o.jsx("strong",{title:a.sourceCommitSha,children:a.sourceCommitSha.slice(0,12)})]}):null,k?o.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(gb,{"aria-hidden":!0})]}):null]}),o.jsxs("div",{className:"environment-build-dialog__body",children:[d?o.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,a!=null&&a.progressError?o.jsx("p",{className:"environment-build-dialog__notice",children:a.progressError}):null,o.jsx(c3t,{steps:(a==null?void 0:a.steps)??[],log:(a==null?void 0:a.logTail)??"",logError:a==null?void 0:a.logError,logTruncated:a==null?void 0:a.logTruncated,logUpdatedAt:a==null?void 0:a.logUpdatedAt,loading:c&&!!(a&&Hg.has(a.status))}),(a==null?void 0:a.status)==="failed"&&a.error?o.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:a.error}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!Hg.has(a.status)?o.jsx(Ht,{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 Fje({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=Iu(e).map(a=>({value:a.value,label:a.label}));return o.jsxs("label",{className:"environment-field environment-region-field",children:[o.jsxs("span",{children:[r("environmentCenter.region"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:a=>i(a.value)})]})}function r4t({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:a,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),x=`${e.trim()}\0${t.trim()}`,O=r===x;p.useEffect(()=>()=>{const E=v.current;v.current=null,E==null||E.abort()},[]);const w=()=>{var E;(E=v.current)==null||E.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var N;const E=k8(e,f);if(E){b(E);return}y.current=x,(N=v.current)==null||N.abort();const C=new AbortController;v.current=C,m(!0),b("");try{const _=await O0e({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},C.signal);if(v.current!==C)return;u(_),d(x),c(_.dockerfiles.length===1?_.dockerfiles[0]:"")}catch(_){if((_==null?void 0:_.name)==="AbortError")return;b(G3t(_)),u(null),d(""),c("")}finally{v.current===C&&(v.current=null,m(!1))}},[x,t,c,d,u,e,f]);p.useEffect(()=>{if(s||O||y.current===x||k8(e,f))return;const E=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(E)},[x,s,k,O,e,f]);const S=O?(i==null?void 0:i.dockerfiles)??[]:[];return o.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[o.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[f("environmentCenter.git.address"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:E=>{w(),a(E.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(qr,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:E=>{w(),l(E.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(xn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:g}),o.jsxs(Ht,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[o.jsx(Kj,{}),f("common.retry")]})]}):null,!h&&!g&&O&&i?S.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),o.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsx(VE,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(E=>({value:E,label:E})),disabled:s||h,onChange:c})]}):null]})}function s4t({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=Te("ui");return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[c("environmentCenter.repository.type"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-repository-mode",value:t,options:z3t(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),o.jsx(Fje,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(Pje,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function a4t({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=Te("ui"),u=Lje(i,c);return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsx(Fje,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(Pje,{region:t,value:n,disabled:r,onChange:a}),o.jsxs("label",{className:"environment-field environment-image-reference",children:[o.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?o.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):o.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function Bje(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const a=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=a,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function o4t({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),a=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";Bje(s,a,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await S0e(e.id,v)).shareCode;c(y),await f0e(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]),Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),o.jsx("p",{id:r,children:e.name})]}),o.jsx(Ht,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(xn,{as:"p",children:n("environmentCenter.share.generating")}):o.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?o.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):o.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[o.jsx("strong",{children:n("environmentCenter.share.failed")}),o.jsx("span",{children:f})]}),l?o.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[o.jsx("span",{children:n("environmentCenter.share.code")}),o.jsx(Rm,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),o.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,o.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?o.jsx(Ht,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(Ht,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function l4t({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),a=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,x]=p.useState(""),[O,w]=p.useState([]),k=p.useMemo(()=>ZF(f),[f]),S=k.length>S8,E=m==="inspecting"||m==="importing",C=b.filter(T=>T.status==="valid"),N=b.filter(T=>T.status==="invalid"),_=m==="ready"&&C.length>0;Bje(c,u,n,E);const j=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),x(""),w([]);try{const T=await k0e(k);v([...T].sort((P,R)=>P.index-R.index)),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,j())},[t,j]);const A=async()=>{if(_){g("importing"),x(""),w([]);try{const T=C.map(Q=>({code:k[Q.index],name:Q.name})).filter(Q=>!!Q.code),P=await E0e(T.map(Q=>Q.code)),R=P.filter(Q=>Q.status==="created").length,L=P.filter(Q=>Q.status==="duplicate").length,M=new Map(P.map(Q=>[Q.index,Q])),U=T.flatMap(({code:Q,name:q},B)=>{const ee=M.get(B);return!ee||ee.status==="failed"?[{code:Q,name:q,status:"valid",error:(ee==null?void 0:ee.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...N.flatMap(Q=>{const q=k[Q.index];return q?[{code:q,name:"",status:"invalid",error:Q.error||r("environmentCenter.import.invalidCode")}]:[]}),...U],K=new Map;if(P.forEach(Q=>{Q.environment&&K.set(Q.environment.id,Q.environment)}),i([...K.values()],R,L,H.length),!H.length){n();return}h(H.map(Q=>Q.code).join(` +`)),w(U),v(H.map((Q,q)=>({index:q,status:Q.status,name:Q.name,error:Q.status==="invalid"?Q.error:""}))),x(r("environmentCenter.import.partial",{created:R,remaining:H.length})),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("ready")}}},F=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):_?O.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:T=>{T.target===T.currentTarget&&!E&&n()},children:o.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":a,"aria-busy":E||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),o.jsx("p",{id:a,children:r("environmentCenter.import.description")})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:E,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-share-dialog__body",children:[o.jsxs("label",{className:"environment-share-dialog__field",children:[o.jsx("span",{children:r("environmentCenter.import.code")}),o.jsx(Rm,{ref:u,size:"lg",rows:6,value:f,disabled:E,"aria-invalid":S||N.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:T=>{h(T.currentTarget.value),g("editing"),v([]),x(""),w([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:S8,count:k.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?o.jsx(xn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):C.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:C.length,names:C.map(T=>T.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,N.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:N.map(T=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:T.index+1,error:T.error||r("environmentCenter.import.invalidCode")})},T.index))}):null,O.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:O.map((T,P)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:P+1,error:T.error})},`${T.code}:${P}`))}):null,y?o.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:E,onClick:n,children:r("common.cancel")}),o.jsx(Ht,{type:"button",color:"info",size:"sm",loading:E,disabled:E||!k.length||S||m==="ready"&&!_,onClick:()=>_?void A():void j(),children:F})]})]})}),document.body)}function c4t({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Je,Ce,Wt,ln,cn,Ot,jt;const{t:a,i18n:l}=Te("ui"),c=$3t(a),u=Z3t(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,x]=p.useState(""),O=p.useRef(null),[w,k]=p.useState(()=>d?U3t((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,E]=p.useState(((Je=u.gitSource)==null?void 0:Je.repositoryUrl)??""),[C,N]=p.useState(((Ce=u.gitSource)==null?void 0:Ce.ref)??""),[_,j]=p.useState(((Wt=u.gitSource)==null?void 0:Wt.dockerfilePath)??""),[A,F]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[T,P]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[R,L]=p.useState(u.containerRepository?"existing":"managed"),[M,U]=p.useState(((ln=u.containerRepository)==null?void 0:ln.region)??Ji(t)),[I,H]=p.useState(u.containerRepository??void 0),[K,Q]=p.useState(((cn=u.imageSource)==null?void 0:cn.region)??Ji(t)),[q,B]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[ee,le]=p.useState(((Ot=u.imageSource)==null?void 0:Ot.reference)??""),[se,re]=p.useState(!1),ge=p.useMemo(()=>_B(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),W=f.dockerfile??ge,X=w!=="none",ae=w==="aio-sandbox"?TB:w==="codex-sandbox"?SOe[t]:"",ue=X?N3t(b):b,Oe=X?QA(ae,""):"",ke=X?QA(ae,ue):b,st=y||(X?j3t(ue,ae,a):JQ(b,void 0,a)),Le=!!e,Me="environment-editor-form",[Ie,qe]=p.useState(!1),[Ae,ze]=p.useState(""),Ee=!!ke.trim()&&!st,De=`${S.trim()}\0${C.trim()}`,J=!k8(S,a)&&T===De&&!!_&&(R==="managed"||Bte(I)),he=Bte(q)&&!!ee.trim()&&!Lje(ee,a),_e=!!f.name.trim()&&!Ie&&(m==="custom"||m==="dockerfile"&&Ee||m==="git"&&J||m==="image"&&he),Ze=(ot,gt)=>{h(Pe=>({...Pe,optionIds:gt?[...Pe.optionIds,ot]:Pe.optionIds.filter(Et=>Et!==ot)}))},at=ot=>{x(""),v(X?QA(ae,ot):ot)},wt=async ot=>{if(!ot)return;const gt=await R3t(ot,a);x(gt.error),gt.content&&v(gt.content)},Se=()=>{x(""),v(Oe)},ve=async ot=>{if(ot.preventDefault(),!!_e){qe(!0),ze("");try{const gt=aat(ke);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?ke:m==="custom"?W:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...C.trim()?{ref:C.trim()}:{},dockerfilePath:_}:null,containerRepository:m==="git"&&R==="existing"?I:null,imageSource:m==="image"&&q?{...q,reference:ee.trim()}:null,...m==="dockerfile"?gt:{}})}catch(gt){ze(gt instanceof Error?gt.message:String(gt)),qe(!1)}}},He=f.name.trim()||(Le?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Th,{className:"environment-editor","aria-label":a(Le?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(uE,{title:He,description:a("environmentCenter.editorDescription"),identitySeed:He,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(Ht,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Ie,children:a("common.delete")}):null,r?o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Ie,children:a("environmentCenter.share.action")}):null,o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Ie,children:a("common.cancel")}),o.jsx(Ht,{color:"info",size:"sm",type:"submit",form:Me,disabled:!_e,children:a(Ie?"common.saving":m==="image"?Le?"environmentCenter.save":"environmentCenter.create":Le?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:Me,className:"environment-form",onSubmit:ve,children:[o.jsxs("div",{className:"environment-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.name"),o.jsx(Eu,{})]}),o.jsx(qr,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:ot=>h(gt=>({...gt,name:ot.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Rm,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:ot=>h(gt=>({...gt,description:ot.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{const gt=ot.value;g(gt),gt==="dockerfile"&&!b.trim()&&v(Oe),ze("")}}),o.jsx("small",{children:(jt=c.find(ot=>ot.value===m))==null?void 0:jt.description})]}),Ae?o.jsx("p",{className:"environment-form-error",role:"alert",children:Ae}):null,m==="custom"?o.jsxs("div",{className:"environment-configuration",children:[o.jsx("section",{className:"environment-section environment-form-section","aria-label":a("environmentCenter.baseConfiguration"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.baseEnvironment"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-base-environment",value:f.baseEnvironment,options:F3t.map(ot=>({...ot,description:a(`environmentCenter.baseDescriptions.${ot.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{const gt=ot.value,Pe=gt==="aio-sandbox"||gt==="codex-sandbox";h(Et=>({...Et,baseEnvironment:gt,operatingSystem:Pe?"ubuntu-22.04":Et.operatingSystem,language:Pe?"python-3.12":Et.language}))}}),o.jsx("small",{children:a(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.operatingSystem"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-operating-system",value:f.operatingSystem,options:Q3t,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ot=>h(gt=>({...gt,operatingSystem:ot.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:S6(f.baseEnvironment),value:"Ubuntu 22.04"}):a("environmentCenter.selectUbuntuVersion")})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.pythonVersion"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?$te.filter(ot=>ot.value==="python-3.12"):$te,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ot=>h(gt=>({...gt,language:ot.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:S6(f.baseEnvironment),value:"Python 3.12"}):a("environmentCenter.selectPythonVersion")})]})]})}),o.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[o.jsx("h2",{id:"environment-skills-title",children:a("environmentCenter.skills")}),o.jsxs("div",{className:"environment-skill-grid",children:[o.jsx(Lte,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:se,disabled:Ie,onChange:re,icon:o.jsx("img",{src:ER,alt:""})}),o.jsx(ZQ,{selected:f.selectedSkills,onChange:ot=>h(gt=>({...gt,selectedSkills:ot})),cloudProvider:t,disabled:Ie,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),AB.map(ot=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${ot.id}-title`,children:[o.jsx("h2",{id:`environment-${ot.id}-title`,children:a(`environmentCenter.categories.${ot.id}`)}),o.jsx("div",{className:"environment-option-grid",children:ot.options.map(gt=>{const Pe=f.optionIds.includes(gt.id);return o.jsx(Lte,{name:gt.label,description:a(`environmentCenter.options.${gt.id}`,{defaultValue:gt.description}),selected:Pe,onChange:Et=>Ze(gt.id,Et),icon:o.jsx(Y3t,{option:gt})},gt.id)})})]},ot.id))]}):m==="dockerfile"?o.jsxs("section",{className:"environment-upload","aria-label":a("environmentCenter.customDockerfile"),children:[o.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("environmentCenter.presetEnvironment")}),o.jsx(Ls,{id:"environment-dockerfile-base-environment",value:w,options:B3t(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ot=>{x(""),k(ot.value)}}),o.jsx("small",{children:a("environmentCenter.presetHint")})]})}),o.jsxs("div",{className:"environment-upload__preview",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:Rje(ke).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:O,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:ot=>{var Pe;const gt=ot.currentTarget;wt((Pe=gt.files)==null?void 0:Pe[0]).finally(()=>{gt.value=""})}}),o.jsx(Ht,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Ie,onClick:()=>{var ot;return(ot=O.current)==null?void 0:ot.click()},children:a("environmentCenter.upload")}),o.jsx(Ht,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Ie||!ue,onClick:Se,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${X?" has-fixed-base":""}${st?" is-invalid":""}`,children:[X?o.jsxs("div",{className:"environment-dockerfile-from","aria-label":a("environmentCenter.dockerfileBaseImage"),children:[o.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),o.jsxs("code",{children:[o.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),o.jsx("span",{title:ae,children:ae})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(zE,{value:ue,path:"Dockerfile",lineNumberStart:X?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:at})})]})]}),st?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:st}):null]}):m==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(r4t,{repositoryUrl:S,gitRef:C,dockerfilePath:_,inspection:A,inspectedKey:T,disabled:Ie,onRepositoryUrlChange:E,onGitRefChange:N,onDockerfilePathChange:j,onInspectionChange:F,onInspectedKeyChange:P}),o.jsx(s4t,{cloudProvider:t,mode:R,region:M,value:I,disabled:Ie,onModeChange:ot=>{L(ot),ze("")},onRegionChange:ot=>{U(ot),H(void 0),ze("")},onChange:H})]}):o.jsx(a4t,{cloudProvider:t,region:K,repository:q,reference:ee,disabled:Ie,onRegionChange:ot=>{Q(ot),B(void 0),ze("")},onRepositoryChange:B,onReferenceChange:le})]})})})}function Uje({cloudProvider:e="volcengine",onWorkspace:t,clipboardImport:n=null,clipboardReadError:i=""}){const{t:r,i18n:s}=Te("ui"),[a,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(null),[g,b]=p.useState(null),[v,y]=p.useState(null),[x,O]=p.useState(null),[w,k]=p.useState(null),S=p.useRef(0),[E,C]=p.useState(""),[N,_]=p.useState(!1),[j,A]=p.useState(i),[F,T]=p.useState(!0),[P,R]=p.useState(""),[L,M]=p.useState(0),[U,I]=p.useState(()=>new Set),H=p.useDeferredValue(d),K=p.useMemo(()=>{const W=H.trim().toLocaleLowerCase();return W?a.filter(X=>`${X.name} ${X.description} ${O6(X.operatingSystem)} ${oh(X.language)} ${S6(X.baseEnvironment)}`.toLocaleLowerCase().includes(W)):a},[H,a]),Q=p.useCallback((W="",X=!1)=>{S.current+=1,k({key:S.current,initialValue:W,autoInspect:X})},[]),q=p.useCallback((W,X=!1)=>{const ae=W.trim();if(!ae.startsWith("akenv://")||!X&&Fte.has(ae))return!1;const ue=ZF(ae);return!ue.length||ue.length>S8?!1:(Fte.add(ae),A(""),Q(ae,!0),!0)},[Q]),B=p.useCallback(async()=>{var W;if(!(c.kind!=="list"||w)){if(typeof navigator>"u"||!((W=navigator.clipboard)!=null&&W.readText)){A(r("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!q(X)&&!X.trim()&&await V3t()&&A(r("environmentCenter.clipboardReadError"))}catch{A(r("environmentCenter.clipboardReadError"))}}},[w,q,r,c.kind]);p.useEffect(()=>{const W=new AbortController;return a.length===0&&T(!0),R(""),Vk(W.signal).then(X=>{l(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&R(X instanceof Error?X.message:String(X))}).finally(()=>{W.signal.aborted||T(!1)}),()=>W.abort()},[L]),p.useEffect(()=>{if(!a.some(X=>X.latestVersion&&Hg.has(X.latestVersion.status)))return;const W=window.setTimeout(()=>M(X=>X+1),2500);return()=>window.clearTimeout(W)},[a]),p.useEffect(()=>{if(!E||N)return;const W=window.setTimeout(()=>C(""),2800);return()=>window.clearTimeout(W)},[N,E]),p.useEffect(()=>{i&&A(i)},[i]),p.useEffect(()=>{n&&q(n.text)},[n,q]),p.useEffect(()=>{if(c.kind!=="list")return;const W=()=>void B(),X=()=>{document.visibilityState==="visible"&&B()},ae=ue=>{var st;const Oe=ue.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const ke=((st=ue.clipboardData)==null?void 0:st.getData("text/plain"))??"";q(ke,!0)&&ue.preventDefault()};return window.addEventListener("focus",W),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ae),()=>{window.removeEventListener("focus",W),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ae)}},[q,B,c.kind]);const ee=c.kind==="editor"&&c.environmentId?a.find(W=>W.id===c.environmentId):void 0,le=async W=>{const X={...W,dockerfile:W.dockerfile??_B(W,e)},ae=ee?await A0e(ee.id,X):await T0e(X);if(l(ue=>[ae,...ue.filter(Oe=>Oe.id!==ae.id)]),u({kind:"list"}),_(!1),X.imageSource){C(r("environmentCenter.status.boundImage",{name:ae.name}));return}try{const ue=await S4(ae.id);l(Oe=>Oe.map(ke=>ke.id===ae.id?{...ke,latestVersion:ue}:ke)),C(r("environmentCenter.status.queued",{name:ae.name}))}catch(ue){_(!0),C(r("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},se=async W=>{if(!U.has(W.id)){I(X=>new Set(X).add(W.id)),_(!1);try{const X=await S4(W.id);l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue)),C(r("environmentCenter.status.queued",{name:W.name}))}catch(X){_(!0),C(X instanceof Error?X.message:String(X))}finally{I(X=>{const ae=new Set(X);return ae.delete(W.id),ae})}}},re=(W,X,ae,ue)=>{W.length&&l(Oe=>{const ke=new Set(W.map(st=>st.id));return[...W,...Oe.filter(st=>!ke.has(st.id))]}),_(ue>0),C(ue>0?r("environmentCenter.status.importedFailed",{created:X,failed:ue}):ae>0?r("environmentCenter.status.importedDuplicate",{created:X,duplicate:ae}):r("environmentCenter.status.imported",{count:X}))},ge=h?o.jsx(pc,{title:r("environmentCenter.deleteTitle"),description:r("environmentCenter.deleteDescription",{name:h.name}),confirmLabel:r("common.delete"),variant:"danger",onCancel:()=>m(null),onConfirm:()=>{const W=h;m(null),u({kind:"list"}),_0e(W.id).then(()=>{l(X=>X.filter(ae=>ae.id!==W.id)),_(!1),C(r("environmentCenter.status.deleted",{name:W.name}))}).catch(X=>{_(!0),C(X instanceof Error?X.message:String(X))})}}):null;return c.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(c4t,{environment:ee,cloudProvider:e,onCancel:()=>u({kind:"list"}),onDelete:ee?()=>m(ee):void 0,onShare:ee?()=>O(ee):void 0,onSave:le},c.environmentId??"new"),x?o.jsx(o4t,{environment:x,onClose:()=>O(null)}):null,ge]}):o.jsxs(Th,{className:"environment-center","aria-label":r("environmentCenter.title"),children:[o.jsx(zx,{title:r("environmentCenter.title")}),o.jsxs(Zb,{className:"environment-toolbar",children:[t?o.jsx(dE,{items:[{id:"workspaces",label:r("workspace.title")},{id:"environments",label:r("environmentCenter.title")}],value:"environments",onChange:W=>{W==="workspaces"&&t()},ariaLabel:r("workspace.resourceType"),idPrefix:"environment-center"}):null,o.jsxs("div",{className:"resource-toolbar__actions",children:[E?o.jsx("span",{className:`environment-status${N?" is-error":""}`,role:N?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(wm,{"aria-label":r("environmentCenter.search"),value:d,onChange:W=>f(W.target.value),placeholder:r("environmentCenter.search")})]})]}),j?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:j}),o.jsx(Ht,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{A(""),Q()},children:r("environmentCenter.manualImport")})]}):null,o.jsx(Jb,{"aria-live":"polite",children:F?o.jsx(Ud,{}):P?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:jd(P,s.resolvedLanguage||s.language)||r("environmentCenter.loadFailed")}),o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:()=>M(W=>W+1),children:r("common.reload")})]}):K.length===0&&d.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(K3t,{})}),o.jsx(Cn.Title,{children:r("environmentCenter.noMatches")}),o.jsx(Cn.Description,{children:r("environmentCenter.tryAnotherName")})]})}):o.jsxs(Vx,{children:[d.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(Cb,{"aria-label":r("environmentCenter.create"),icon:o.jsx(q3t,{}),onClick:()=>u({kind:"editor",environmentId:null}),children:r("environmentCenter.create")}),o.jsx(Cb,{"aria-label":r("environmentCenter.import.title"),icon:o.jsx(W3t,{}),onClick:()=>Q(),children:r("environmentCenter.import.title")})]}),K.map(W=>{var Oe,ke;const X=$je(W,r),ae=!!(W.latestVersion&&Hg.has(W.latestVersion.status)),ue=U.has(W.id);return o.jsx(pE,{className:"environment-card",title:W.name,status:o.jsx(ba,{color:X.color,size:"sm",children:X.label}),description:((Oe=W.latestVersion)==null?void 0:Oe.error)||(ae?(ke=W.latestVersion)==null?void 0:ke.currentStep:"")||W.description||r("common.noDescription"),metadata:[{label:r("workspace.updated"),value:J3t(W.updatedAt,s.resolvedLanguage??s.language),title:e4t(W.updatedAt,s.resolvedLanguage??s.language)}],action:{label:W.latestVersion?r("environmentCenter.buildDetails.title"):r(ue?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:r("environmentCenter.build"),disabled:ue,onClick:()=>W.latestVersion?b(W.id):void se(W)},auxiliaryAction:{label:r("environmentCenter.manifest.view"),icon:o.jsx(VFe,{}),title:W.latestVersion?r("environmentCenter.manifest.viewShort"):r("environmentCenter.manifest.unavailable"),disabled:!W.latestVersion,onClick:()=>y(W)},detailAction:{label:r("environmentCenter.configure"),onClick:()=>u({kind:"editor",environmentId:W.id})}},W.id)})]})}),g?(()=>{const W=a.find(X=>X.id===g);return W?o.jsx(i4t,{environment:W,onClose:()=>b(null),onBuildUpdate:X=>{l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue))},onRebuild:()=>se(W)}):null})():null,v!=null&&v.latestVersion?o.jsx(n4t,{environment:v,onClose:()=>y(null)}):null,ge,w?o.jsx(l4t,{initialValue:w.initialValue,autoInspect:w.autoInspect,onClose:()=>k(null),onImported:re},w.key):null]})}function u4t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function d4t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),o.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function E8(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 f4t(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 h4t({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=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,x]=p.useState(""),O=m.trim().toLocaleLowerCase(),w=t.filter(S=>`${S.name} ${S.description} ${oh(S.language)}`.toLocaleLowerCase().includes(O)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),x("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(E){x(E instanceof Error?E.message:String(E)),v(!1)}}};return o.jsx(Th,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(uE,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[r?o.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,o.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?o.jsxs(jB,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("common.environment")}),o.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.createdAt")}),o.jsx("dd",{children:E8(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:E8(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[o.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[o.jsxs("label",{children:[o.jsx("span",{children:s("common.name")}),o.jsx(qr,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Rm,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(UOe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(wm,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noAvailableEnvironments")}),o.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):w.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noMatchingEnvironments")}),o.jsx("span",{children:s("workspace.tryAnotherName")})]}):o.jsx("div",{className:"workspace-environment-list",children:w.map(S=>{var N;const E=f.includes(S.id),C=((N=S.latestVersion)==null?void 0:N.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${E?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:E,onChange:()=>h(_=>E?_.filter(j=>j!==S.id):[..._,S.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:S.name,children:S.name}),o.jsxs("span",{children:[oh(S.language)," · ",C]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(E?"workspace.added":"common.add")})]},S.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function p4t({onEnvironment:e}){const{t,i18n:n}=Te("ui"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState({kind:"list"}),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(""),[y,x]=p.useState(!1),[O,w]=p.useState(null),[k,S]=p.useState(0),E=p.useDeferredValue(u);p.useEffect(()=>{const j=new AbortController;return h(!0),g(""),Promise.all([t7(j.signal),Vk(j.signal)]).then(([A,F])=>{r(A),a(F)}).catch(A=>{(A==null?void 0:A.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",A),g(t("workspace.loadFailed")))}).finally(()=>{j.signal.aborted||h(!1)}),()=>j.abort()},[k,t]),p.useEffect(()=>{if(!b||y)return;const j=window.setTimeout(()=>v(""),2800);return()=>window.clearTimeout(j)},[y,b]);const C=p.useMemo(()=>new Map(s.map(j=>[j.id,j])),[s]),N=p.useMemo(()=>{const j=E.trim().toLocaleLowerCase();return j?i.filter(A=>{const F=A.environmentIds.map(T=>{var P;return((P=C.get(T))==null?void 0:P.name)??""}).join(" ");return`${A.name} ${A.description} ${F}`.toLocaleLowerCase().includes(j)}):i},[E,C,i]),_=l.kind==="detail"&&l.workspaceId?i.find(j=>j.id===l.workspaceId):void 0;return l.kind==="detail"?o.jsx(h4t,{workspace:_,environments:s,onBack:()=>c({kind:"list"}),onDelete:_?()=>w(_):null,onSave:async j=>{const A=_?await x0e(_.id,j):await v0e(j);r(F=>[A,...F.filter(T=>T.id!==A.id)]),x(!1),v(t("workspace.saved",{name:A.name})),c({kind:"list"})}},l.workspaceId??"new"):o.jsxs(Th,{className:"workspace-center","aria-label":t("workspace.title"),children:[o.jsx(zx,{title:t("workspace.title")}),o.jsxs(Zb,{children:[o.jsx(dE,{items:[{id:"workspaces",label:t("workspace.title")},{id:"environments",label:t("common.environment")}],value:"workspaces",onChange:j=>{j==="environments"&&e()},ariaLabel:t("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsxs("div",{className:"resource-toolbar__actions",children:[b?o.jsx("span",{className:`workspace-status${y?" is-error":""}`,role:y?"alert":"status","aria-live":"polite",children:b}):null,o.jsx(wm,{"aria-label":t("workspace.searchWorkspaces"),value:u,onChange:j=>d(j.target.value),placeholder:t("workspace.searchWorkspaces")})]})]}),o.jsx(Jb,{"aria-live":"polite",children:f?o.jsx(Ud,{}):m?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:m}),o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:()=>S(j=>j+1),children:t("common.reload")})]}):N.length===0&&u.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(Cn,{fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(d4t,{})}),o.jsx(Cn.Title,{children:t("workspace.noMatchingWorkspaces")}),o.jsx(Cn.Description,{children:t("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(Vx,{children:[u.trim()?null:o.jsx(Cb,{"aria-label":t("workspace.create"),icon:o.jsx(u4t,{}),onClick:()=>c({kind:"detail",workspaceId:null}),children:t("workspace.create")}),N.map(j=>{const A=f4t(j,C),F=j.environmentIds.filter(T=>!C.has(T)).length;return o.jsx(pE,{className:"workspace-card",title:j.name,status:o.jsx(ba,{color:F?"danger":A===j.environmentIds.length&&A>0?"success":"secondary",size:"sm",children:j.environmentIds.length===0?t("workspace.noEnvironmentAdded"):F?t("workspace.environmentMissing"):t("workspace.availableFraction",{available:A,total:j.environmentIds.length})}),description:j.description||t("common.noDescription"),metadata:[{label:t("common.environment"),value:t("workspace.environmentCount",{count:j.environmentIds.length})},{label:t("workspace.available"),value:t("workspace.availableCount",{count:A})},{label:t("workspace.updated"),value:E8(j.updatedAt,n.resolvedLanguage??n.language)}],detailAction:{label:t("common.manage"),onClick:()=>c({kind:"detail",workspaceId:j.id})},action:{label:t("workspace.addEnvironment"),icon:"plus",onClick:()=>c({kind:"detail",workspaceId:j.id})}},j.id)})]})}),O?o.jsx(pc,{title:t("workspace.deleteTitle"),description:t("workspace.deleteDescription",{name:O.name}),confirmLabel:t("common.delete"),variant:"danger",onCancel:()=>w(null),onConfirm:()=>{const j=O;w(null),w0e(j.id).then(()=>{r(A=>A.filter(F=>F.id!==j.id)),x(!1),v(t("workspace.deleted",{name:j.name})),c({kind:"list"})}).catch(A=>{x(!0),v(A instanceof Error?A.message:String(A))})}}):null]})}function m4t({cloudProvider:e}){const{t}=Te("ui"),[n,i]=p.useState("workspaces"),[r,s]=p.useState(null),[a,l]=p.useState(""),c=p.useRef(0),u=()=>{var h;c.current+=1;const d=c.current;l("");let f=null;if(typeof navigator<"u"&&((h=navigator.clipboard)!=null&&h.readText))try{f=navigator.clipboard.readText()}catch{l(t("workspace.clipboardPermissionError"))}else l(t("workspace.clipboardUnsupported"));i("environments"),f&&f.then(async m=>{var g;if(c.current===d){if(m.trim()){s({key:d,text:m});return}try{const b=await((g=navigator.permissions)==null?void 0:g.query({name:"clipboard-read"}));c.current===d&&(b==null?void 0:b.state)==="denied"&&l(t("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{c.current===d&&l(t("workspace.clipboardPermissionError"))})};return n==="environments"?o.jsx(Uje,{cloudProvider:e,onWorkspace:()=>i("workspaces"),clipboardImport:r,clipboardReadError:a}):o.jsx(p4t,{onEnvironment:u})}function g4t(e){return e==="127.0.0.1"}const b4t={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."},y4t={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."};an.hasResourceBundle("en-US","automations")||an.addResourceBundle("en-US","automations",zre,!0,!0);an.hasResourceBundle("zh-CN","automations")||an.addResourceBundle("zh-CN","automations",ace,!0,!0);function Vd(e,t={}){return an.t(e,{...t,ns:"automations"})}const Qje={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},zje={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},Vje={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},Hje={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},v4t="https://ark.cn-beijing.volces.com/api/coding/v3";function x4t(e){return e==="byteplus"?xl(e):v4t}function ez(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 qje(e){const t=ez(e);return[Vd("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Vd("github.sessionToken",{sessionToken:t.sessionToken})]}function tz(e){return e==="byteplus"?"BytePlus":"Volcengine"}function nz(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:x4t(e),region:Ji(e),token:"",...t}}function Wje(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const w4t={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})=>nz(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},O4t="https://api.github.com",S4t=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Qte=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,k4t=/^[A-Za-z0-9._/-]+$/;function E4t(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?V("github.invalidToken"):e===404?V("github.notFound"):e===422?V("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||V("github.requestFailed",{status:e})}async function ug(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${O4t}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(V("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(E4t(i.status,r,t.token));return{status:i.status,payload:r}}function dL(e){return e.split("/").map(encodeURIComponent).join("/")}function C4t(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:rz(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await ug(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ug(`${a}/git/ref/heads/${dL(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(V("github.missingBaseSha"));const u=T4t(e.branchPrefix);await ug(`${a}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=dL(m.path),b=await ug(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:m.path}));await ug(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:C4t(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ug(`${a}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(V("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ug(`${a}/git/refs/heads/${dL(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function A4t(e,t){const n=await An("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function _4t(e){const t=await An("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await HE(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function N4t(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 An(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(a=>typeof a!="object"||a===null||typeof a.installationId!="number"||typeof a.account!="string"||typeof a.fullName!="string"||typeof a.htmlUrl!="string"||typeof a.private!="boolean"||typeof a.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function j4t(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await An(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function R4t(e,t){const n=await An("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function HE(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const I4t=/^[A-Za-z0-9_-]+$/,Kje=4,cj=64,uj=6,Vte="agent-runtime";function Xje(e){const t=e.trim();if(!t)return Vte;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,cj);return n?(n.length$t(`validation.runtimeName.${n}`)){return e?I4t.test(e)?e.lengthcj?t("length"):null:t("characters"):t("required")}const M4t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,L4t="cn-hongkong";function $4t(e){const t=qE(e.runtimeName,n=>Vd(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!M4t.test(e.runtimeId))throw new Error(Vd("github.validation.runtimeId"))}function Zje(e){$4t(e);const t=e.cloudProvider??"volcengine",n=ez(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(M4t)},`:"",s=`name: Publish to AgentKit Runtime + "DATABASE_VIKING_REGION": ${JSON.stringify(L4t)},`:"",s=`name: Publish to AgentKit Runtime on: push: @@ -934,8 +934,8 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,a={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(a).reduce((l,[c,u])=>l.split(c).join(u),s)}const $4t={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:[Uje,Qje,{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},zje,Vje],initialValues:({cloudProvider:e})=>nz(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Hje(e),submit(e,t,n){const i=qje(e),r=rz(e.projectPath,"."),s=tz(t.cloudProvider);return Wje({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:Yje({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:Vd("cards.delivery.pullRequest.title"),description:Vd("cards.delivery.pullRequest.description",{provider:s})},n)}};function F4t(e,t){return e==="."?t:`${e}/${t}`}function B4t(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const U4t={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"},Q4t="1.1.9",z4t=["https://repo.huaweicloud.com/repository/pypi/simple","https://mirrors.aliyun.com/pypi/simple/","https://pypi.org/simple"];function V4t(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${z4t.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ - `)}`}function H4t(e){const t=ez(e);return`# Local ${tz(e)} credentials. Never commit real values. +`,a={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(a).reduce((l,[c,u])=>l.split(c).join(u),s)}const F4t={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:[Qje,zje,{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},Vje,Hje],initialValues:({cloudProvider:e})=>nz(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>qje(e),submit(e,t,n){const i=Wje(e),r=rz(e.projectPath,"."),s=tz(t.cloudProvider);return Gje({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:Zje({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:Vd("cards.delivery.pullRequest.title"),description:Vd("cards.delivery.pullRequest.description",{provider:s})},n)}};function B4t(e,t){return e==="."?t:`${e}/${t}`}function U4t(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const Q4t={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"},z4t="1.1.9",V4t=["https://repo.huaweicloud.com/repository/pypi/simple","https://mirrors.aliyun.com/pypi/simple/","https://pypi.org/simple"];function H4t(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${V4t.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ + `)}`}function q4t(e){const t=ez(e);return`# Local ${tz(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= # ${t.sessionToken}= @@ -952,7 +952,7 @@ AGENTKIT_CLOUD_PROVIDER=${e} # Optional Feishu Channel credentials. Studio can create and bind these. FEISHU_APP_ID= FEISHU_APP_SECRET= -`}function q4t(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`}function W4t(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 @@ -996,19 +996,19 @@ root_agent = Agent( instruction="You are a helpful assistant. Use your tools when relevant.", tools=[get_city_weather], ) -`,"requirements.txt":`veadk-python==${Q4t} +`,"requirements.txt":`veadk-python==${z4t} 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 ${U4t[t]} +`,Dockerfile:`FROM ${Q4t[t]} ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1 PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt ./ -${V4t(t)} +${H4t(t)} COPY . . @@ -1033,7 +1033,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":H4t(t),".gitignore":`__pycache__/ +`,".env.example":q4t(t),".gitignore":`__pycache__/ *.pyc .venv/ .env @@ -1047,35 +1047,35 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const W4t={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:[Uje,Qje,{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},zje,Vje],initialValues:({cloudProvider:e})=>nz(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Hje(e),submit(e,t,n){const i=qje(e),r=iz(i.repository),s=rz(e.projectPath,"agentkit-basic-agent"),a=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(q4t(a,t.cloudProvider)).map(([c,u])=>({path:F4t(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:B4t(s),content:Yje({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}),Wje({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Vd("cards.template.pullRequest.title"),description:Vd("cards.template.pullRequest.description",{provider:tz(t.cloudProvider)})},n)}},G4t={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."},Hte=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],Zje=[g4t,W4t,$4t,x4t,b4t,G4t],K4t=new Map(Zje.map(e=>[e.id,e]));function X4t(e){const t=K4t.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function Y4t(e){const t=X4t(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function qte(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Z4t(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function J4t(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.jsx("path",{d:"M18 18.5c0-3 2.5-5.5 5.5-5.5h3c3 0 5.5 2.5 5.5 5.5v5c0 3-2.5 5.5-5.5 5.5H25l-4 3v-3.6a5.5 5.5 0 0 1-3-4.9v-5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function e6t({onOpen:e}){var d;const{t}=Te("automations"),[n,i]=p.useState("development"),[r,s]=p.useState(""),a=p.useDeferredValue(r),l=p.useMemo(()=>{const f=a.trim().toLocaleLowerCase();return Zje.filter(h=>h.category===n).filter(h=>!f||`${t(`cards.${h.id}.name`)} ${t(`cards.${h.id}.description`)}`.toLocaleLowerCase().includes(f))},[n,a,t]),c=(d=Hte.find(f=>f.id===n))==null?void 0:d.id,u=m4t(window.location.hostname);return o.jsxs("div",{className:"applications-page",children:[o.jsxs("header",{className:"applications-header",children:[o.jsxs("div",{children:[o.jsx("h1",{children:t("title")}),o.jsx("p",{children:t("description")})]}),o.jsxs("label",{className:"applications-search",children:[o.jsx(qte,{}),o.jsx("input",{type:"search","aria-label":t("search"),value:r,onChange:f=>s(f.target.value),placeholder:t("search")})]})]}),o.jsx("nav",{className:"applications-categories","aria-label":t("categoriesLabel"),children:Hte.map(f=>o.jsx("button",{type:"button",className:n===f.id?"is-active":"","aria-pressed":n===f.id,onClick:()=>i(f.id),children:t(`categories.${f.id}`)},f.id))}),o.jsx("section",{className:"applications-results","aria-label":t("resultsLabel",{category:t(`categories.${c}`)}),children:l.length?o.jsx("div",{className:"applications-grid",children:l.map(f=>{const h=f.id==="coding-agents"&&!u,m=h?"coding-agents-local-only-tooltip":void 0;return o.jsxs("div",{className:`application-card-wrap${h?" is-disabled":""}`,tabIndex:h?0:void 0,"aria-describedby":m,children:[o.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(f.id),"aria-label":t("open",{name:t(`cards.${f.id}.name`)}),disabled:h,children:[f.icon==="feishu"?o.jsx("img",{className:"application-card-icon application-card-brand-icon",src:QI,alt:"","aria-hidden":"true"}):f.icon==="coding-agents"?o.jsx(Z4t,{className:"application-card-icon"}):f.icon==="website-integration"?o.jsx(J4t,{className:"application-card-icon"}):o.jsx(YQ,{className:"application-card-icon"}),o.jsxs("div",{className:"application-card-copy",children:[o.jsxs("div",{className:"application-card-title",children:[o.jsx("h2",{children:t(`cards.${f.id}.name`)}),f.badge?o.jsx("span",{className:`application-card-badge is-${f.badgeTone||"default"}`,children:t(`cards.${f.id}.badge`,{defaultValue:f.badge})}):null]}),o.jsx("p",{children:t(`cards.${f.id}.description`)})]})]}),h?o.jsx("span",{id:m,className:"application-card-tooltip",role:"tooltip",children:t("localOnly")}):null]},f.id)})}):o.jsxs("div",{className:"applications-empty",role:"status",children:[o.jsx(qte,{}),o.jsx("h2",{children:t("emptyTitle")}),o.jsx("p",{children:t("emptyDescription")})]})})]})}const t6t="_Container_1bl61_1",n6t="_Track_1bl61_16",i6t="_Thumb_1bl61_56",r6t="_Label_1bl61_78",y2={Container:t6t,Track:n6t,Thumb:i6t,Label:r6t},C8=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const a=p.useId(),l=n??a;return o.jsxs("div",{className:pi(y2.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[o.jsx(mWe,{id:l,className:y2.Track,disabled:i,...s,children:o.jsx(bWe,{className:y2.Thumb})}),t&&o.jsx("label",{htmlFor:l,className:y2.Label,children:t})]})};function Lb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=Te("ui"),a=i??s("deploymentError.retryDeployment"),[l,c]=p.useState(r),[u,d]=p.useState(!1),f=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return o.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs(Ht,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&o.jsx(jFe,{}),u?s("deploymentError.retrying"):a]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s(l?"deploymentError.collapse":"deploymentError.expand"),"aria-label":s(l?"deploymentError.collapse":"deploymentError.expand"),onClick:()=>c(h=>!h),children:l?o.jsx(MFe,{}):o.jsx(UFe,{})}),o.jsx(X7,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy"),children:({copied:h})=>h?o.jsx(Lv,{}):o.jsx(PF,{})})]})]})}const s6t={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},Jje=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function T8(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(an.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function a6t(e){if(!e.startedAt)return"-";const t=Date.parse(e.startedAt),n=e.finishedAt?Date.parse(e.finishedAt):Date.now();if(!Number.isFinite(t)||!Number.isFinite(n)||n{const d=i.current;!d||r.current||c(d.scrollHeight>d.clientHeight+1)},[]);return p.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),p.useEffect(()=>{const d=i.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(u);return f.observe(d),()=>f.disconnect()},[u]),o.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[o.jsx("p",{id:n,ref:i,children:e}),l?o.jsx(Ht,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>a(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const _8="Asia/Shanghai",l6t=3e3,c6t=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function St(e,t){return an.t(e,{ns:"cronjobs",...t})}function u6t(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||_8}catch{return _8}}function d6t(){const e=u6t(),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 f6t(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||_8,enabled:e.enabled}}function h6t({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return o.jsx(ba,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:St(e?s6t[e.status]:"status.notRun")})}function Wte({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[a,l]=p.useState(()=>e?f6t(e):d6t()),[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),x=p.useMemo(()=>Array.from(new Set([a.timezone,...c6t])),[a.timezone]),O=p.useMemo(()=>t.map(E=>({value:E.runtimeId,label:E.name,description:xh(E.region,n)})),[n,t]),w=p.useMemo(()=>Jje.map((E,C)=>({value:String(C),label:St(E)})),[]),k=p.useMemo(()=>x.map(E=>({value:E,label:E})),[x]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var _;const E=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=m.current)==null||_.focus();const N=j=>{var R,L;if(j.key==="Escape"&&!v.current){y.current();return}if(j.key!=="Tab")return;const A=Array.from(((R=h.current)==null?void 0:R.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(M=>!M.hidden&&M.getClientRects().length>0);if(A.length===0){j.preventDefault();return}const F=A[0],T=A[A.length-1],P=document.activeElement;j.shiftKey&&(P===F||!((L=h.current)!=null&&L.contains(P)))?(j.preventDefault(),T.focus()):!j.shiftKey&&P===T&&(j.preventDefault(),F.focus())};return window.addEventListener("keydown",N),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",N),C!=null&&C.isConnected&&C.focus()}},[]);const S=async E=>{E.preventDefault();const C=a.name.trim(),N=a.prompt.trim(),_=t.find(A=>A.runtimeId===a.runtimeId);if(!C)return u(St("validation.nameRequired"));if(!_)return u(St("validation.runtimeRequired"));if(!N)return u(St("validation.promptRequired"));if(a.scheduleType==="once"&&!a.onceAt||(a.scheduleType==="daily"||a.scheduleType==="weekly")&&!a.time)return u(St("validation.timeRequired"));const j=a.cron.trim().split(/\s+/);if(a.scheduleType==="cron"&&j.length!==5)return u(St("validation.cronFields"));u(""),f(!0);try{let A=(e==null?void 0:e.runtimeId)===_.runtimeId?e.agentName.trim():"";if(!A){const[F]=await zk("","",{runtimeId:_.runtimeId,region:_.region});A=(F==null?void 0:F.trim())??""}if(!A)throw new Error(St("validation.runtimeAppMissing"));await s({name:C,runtimeId:_.runtimeId,runtimeName:_.name,agentName:A,region:_.region,prompt:N,enabled:a.enabled,schedule:{type:a.scheduleType,timezone:a.timezone,...a.scheduleType==="once"?{onceAt:a.onceAt}:{},...a.scheduleType==="daily"?{time:a.time}:{},...a.scheduleType==="weekly"?{time:a.time,weekday:a.weekday}:{},...a.scheduleType==="cron"?{cron:a.cron.trim()}:{}}})}catch(A){u(A instanceof Error?A.message:String(A)),window.requestAnimationFrame(()=>{var F;return(F=g.current)==null?void 0:F.focus()})}finally{f(!1)}};return o.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:E=>{E.target===E.currentTarget&&!b&&r()},children:o.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[o.jsxs("header",{className:"cronjobs-drawer-head",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"cronjobs-drawer-title",children:St(e?"drawer.editTitle":"drawer.createTitle")}),o.jsx("p",{children:St("drawer.description")})]}),o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":St("actions.closeDrawer"),children:o.jsx(DF,{})})]}),o.jsxs("form",{className:"cronjobs-form",onSubmit:E=>void S(E),children:[o.jsxs("div",{className:"cronjobs-form-scroll",children:[o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.name")}),o.jsx(qr,{ref:m,size:"lg",value:a.name,maxLength:80,invalid:!!c&&!a.name.trim(),onChange:E=>l({...a,name:E.target.value}),placeholder:St("fields.namePlaceholder")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.runtimeAgent")}),o.jsx(Ls,{value:a.runtimeId,options:O,size:"lg",disabled:t.length===0,placeholder:St(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:E=>l({...a,runtimeId:E.value})}),o.jsx("small",{children:St("fields.runtimeHelp")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.prompt")}),o.jsx(Rm,{value:a.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!a.prompt.trim(),onChange:E=>l({...a,prompt:E.target.value}),placeholder:St("fields.promptPlaceholder")}),o.jsxs("small",{className:"cronjobs-character-count",children:[a.prompt.length.toLocaleString()," / 20,000"]})]}),o.jsxs("fieldset",{className:"cronjobs-fieldset",children:[o.jsx("legend",{children:St("fields.schedule")}),o.jsxs(zc,{className:"cronjobs-schedule-types",value:a.scheduleType,size:"lg",block:!0,"aria-label":St("fields.scheduleType"),onChange:E=>l({...a,scheduleType:E}),children:[o.jsx(zc.Option,{value:"once",children:St("scheduleTypes.once")}),o.jsx(zc.Option,{value:"daily",children:St("scheduleTypes.daily")}),o.jsx(zc.Option,{value:"weekly",children:St("scheduleTypes.weekly")}),o.jsx(zc.Option,{value:"cron",children:"Cron"})]}),a.scheduleType==="once"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.runAt")}),o.jsx(qr,{size:"lg",type:"datetime-local",value:a.onceAt,onChange:E=>l({...a,onceAt:E.target.value})})]}):null,a.scheduleType==="daily"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.dailyTime")}),o.jsx(qr,{size:"lg",type:"time",value:a.time,onChange:E=>l({...a,time:E.target.value})})]}):null,a.scheduleType==="weekly"?o.jsxs("div",{className:"cronjobs-inline-fields",children:[o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.weekday")}),o.jsx(Ls,{value:String(a.weekday),options:w,size:"lg",onChange:E=>l({...a,weekday:Number(E.value)})})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.runAt")}),o.jsx(qr,{size:"lg",type:"time",value:a.time,onChange:E=>l({...a,time:E.target.value})})]})]}):null,a.scheduleType==="cron"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.cronExpression")}),o.jsx(qr,{size:"lg",value:a.cron,onChange:E=>l({...a,cron:E.target.value}),placeholder:"0 9 * * *"}),o.jsx("small",{children:St("fields.cronHelp")})]}):null,o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:St("fields.timezone")}),o.jsx(Ls,{value:a.timezone,options:k,size:"lg",onChange:E=>l({...a,timezone:E.value})})]})]}),o.jsxs("div",{className:"cronjobs-switch-row",children:[o.jsxs("span",{children:[o.jsx("strong",{children:St("fields.enableAfterCreate")}),o.jsx("small",{children:St("fields.enableHelp")})]}),o.jsx(C8,{checked:a.enabled,onCheckedChange:E=>l({...a,enabled:E}),"aria-label":St("fields.enableAfterCreate")})]}),c?o.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:o.jsx(Eb,{color:"danger",variant:"soft",description:c})}):null]}),o.jsxs("footer",{className:"cronjobs-drawer-actions",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:St("actions.cancel")}),o.jsx(Ht,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:St(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function p6t({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return o.jsxs(Vx,{children:[o.jsx(Cb,{icon:o.jsx(vbe,{}),onClick:n,disabled:!t,title:St(t?"actions.createScheduledTask":"fields.noRuntime"),children:St("actions.createScheduledTask")}),e.map(r=>{const s=eRe(r.schedule);return o.jsx(pE,{className:"cronjobs-card",title:r.name,status:o.jsx(ba,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:St(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:St("fields.schedule"),value:s,title:s}],detailAction:{label:St("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function m6t({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:a,onToggle:l,onRun:c,onDelete:u,onCancel:d,onRetryRun:f,onRetryRuns:h}){const m=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(A8(e)?e.latestRun:void 0),g=r.includes(e.jobId);return o.jsxs("div",{className:"cronjobs-detail",children:[o.jsxs("header",{className:"cronjobs-detail-head",children:[o.jsxs("div",{className:"cronjobs-detail-title",children:[o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":St("actions.backToList"),children:o.jsx(_Fe,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:e.name}),o.jsxs("p",{children:[e.runtimeName||e.agentName," · ",eRe(e.schedule)]})]})]}),o.jsxs("div",{className:"cronjobs-detail-actions",children:[o.jsxs(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:a,disabled:g,children:[o.jsx(BFe,{}),St("actions.edit")]}),o.jsxs(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?o.jsx(qFe,{}):o.jsx(vW,{}),St(e.enabled?"actions.pause":"actions.enable")]}),m?o.jsxs(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[o.jsx(YFe,{}),St(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):o.jsxs(Ht,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[o.jsx(vW,{}),St("actions.runNow")]}),o.jsx(go,{compact:!0,content:St(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:o.jsxs(Ht,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":St("actions.deleteTask"),children:[o.jsx(LFe,{}),St("actions.delete")]})})]})]}),o.jsxs("div",{className:"cronjobs-detail-scroll",children:[o.jsxs("section",{className:"cronjobs-summary-grid","aria-label":St("detail.configuration"),children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:St("detail.status")}),o.jsx("dd",{children:St(e.enabled?"status.enabled":"status.paused")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:St("detail.nextRun")}),o.jsx("dd",{children:e.enabled?T8(e.nextRunAt):"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:St("detail.runtime")}),o.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:St("detail.region")}),o.jsx("dd",{children:e.region})]})]}),o.jsxs("div",{className:"cronjobs-prompt",children:[o.jsx("span",{children:St("fields.prompt")}),o.jsx("p",{children:e.prompt})]})]}),o.jsxs("section",{className:"cronjobs-history",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{children:St("history.title")}),o.jsx("p",{children:St("history.description")})]}),o.jsx(go,{compact:!0,content:St("actions.refresh"),children:o.jsx(Ht,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":St("actions.refreshHistory"),children:o.jsx(Kj,{})})})]}),n&&t.length===0?o.jsx(Ud,{}):i?o.jsx(Eb,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:St("history.loadFailed"),description:i,actions:o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:St("actions.retry")})}):t.length===0?o.jsxs(Cn,{className:"cronjobs-history-state",fill:"none",children:[o.jsx(Cn.Icon,{children:o.jsx(IF,{})}),o.jsx(Cn.Title,{children:St("history.emptyTitle")}),o.jsx(Cn.Description,{children:St("history.emptyDescription")})]}):o.jsx("div",{className:"cronjobs-runs",children:t.map(b=>o.jsxs("article",{className:"cronjobs-run",children:[o.jsxs("div",{className:"cronjobs-run-main",children:[o.jsx(h6t,{run:b}),o.jsxs("div",{children:[o.jsx("strong",{children:T8(b.startedAt||b.scheduledAt)}),o.jsxs("span",{children:[St("history.duration",{duration:a6t(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?o.jsxs("div",{className:"cronjobs-run-meta",children:[o.jsx("span",{children:St("history.session")}),o.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?o.jsxs("div",{className:"cronjobs-run-output",children:[o.jsx("span",{children:St("history.finalAnswer")}),o.jsx(o6t,{output:b.output})]}):null,b.error?o.jsxs("div",{className:"cronjobs-run-output is-error",children:[o.jsx("span",{children:St("history.errorDetails")}),o.jsx(Lb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:St("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?o.jsx(Ht,{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:St(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function g6t({cloudProvider:e}){Te("cronjobs");const[t,n]=p.useState([]),[i,r]=p.useState([]),[s,a]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(void 0),[m,g]=p.useState([]),[b,v]=p.useState(!1),[y,x]=p.useState(""),[O,w]=p.useState(""),[k,S]=p.useState("all"),[E,C]=p.useState(""),[N,_]=p.useState(null),[j,A]=p.useState(""),F=t.find(B=>B.jobId===u),T=k==="all"?t:t.filter(B=>k==="enabled"?B.enabled:!B.enabled),P=p.useCallback(async B=>{a(!0),c("");try{const[ee,le]=await Promise.all([E4(B),_x({scope:"all",region:"all",pageSize:100})]);if(B!=null&&B.aborted)return;n(ee),r(le.runtimes.filter(se=>se.status.toLowerCase()==="ready"))}catch(ee){if(B!=null&&B.aborted)return;console.warn("Unable to load scheduled tasks",ee),c(St("page.loadFailedDescription"))}finally{B!=null&&B.aborted||a(!1)}},[]);p.useEffect(()=>{const B=new AbortController;return P(B.signal),()=>B.abort()},[P]);const R=p.useCallback(async(B,ee)=>{v(!0),x("");try{const le=await C4(B,ee);ee!=null&&ee.aborted||g(le)}catch(le){ee!=null&&ee.aborted||(console.warn("Unable to load scheduled-task history",le),x(St("history.loadFailedDescription")))}finally{ee!=null&&ee.aborted||v(!1)}},[]);p.useEffect(()=>{if(!u){g([]),x("");return}const B=new AbortController;return R(u,B.signal),()=>B.abort()},[R,u]);const L=t.some(A8);p.useEffect(()=>{!L&&E===St("notices.queued")&&C("")},[L,E]),p.useEffect(()=>{if(!L)return;const B=new AbortController,ee=async()=>{try{const[se,re]=await Promise.all([E4(B.signal),u?C4(u,B.signal):Promise.resolve(null)]);if(B.signal.aborted)return;n(se),re&&g(re),se.some(A8)||C("")}catch(se){B.signal.aborted||C(se instanceof Error?se.message:String(se))}},le=window.setInterval(()=>void ee(),l6t);return()=>{window.clearInterval(le),B.abort()}},[L,u]);const M=B=>n(ee=>ee.some(le=>le.jobId===B.jobId)?ee.map(le=>le.jobId===B.jobId?B:le):[B,...ee]),U=async(B,ee,le,se=!1)=>{w(B),C("");try{await ee(),C(le)}catch(re){const ge=re instanceof Error?re.message:String(re);if(se)throw new Error(ge);C(ge)}finally{w("")}},I=async B=>{const ee=f??null;await U(`${(ee==null?void 0:ee.jobId)??"new"}:save`,async()=>{const le=ee?await W0e(ee.jobId,B):await q0e(B);M(le),h(void 0),ee&&d(le.jobId)},St(ee?"notices.updated":"notices.created"),!0)},H=B=>void U(`${B.jobId}:toggle`,async()=>M(await G0e(B.jobId,!B.enabled)),St(B.enabled?"notices.paused":"notices.enabled")),K=(B,ee)=>U(`${B.jobId}:run`,async()=>{const le=await K0e(B.jobId);M({...B,latestRun:le}),u===B.jobId&&g(se=>[le,...se.filter(re=>re.runId!==le.runId)])},ee),Q=B=>void K(B,St("notices.queued")),q=()=>{if(!N)return;A("");const B=N;B.kind==="delete"?U(`${B.job.jobId}:delete`,async()=>{await Y0e(B.job.jobId),n(ee=>ee.filter(le=>le.jobId!==B.job.jobId)),d(""),_(null)},St("notices.deleted"),!0).catch(ee=>{A(ee instanceof Error?ee.message:String(ee))}):U(`${B.job.jobId}:cancel`,async()=>{var le;const ee=await X0e(B.job.jobId,B.run.runId);g(se=>se.map(re=>re.runId===ee.runId?ee:re)),M({...B.job,latestRun:((le=B.job.latestRun)==null?void 0:le.runId)===ee.runId?ee:B.job.latestRun}),_(null)},St("notices.cancelRequested"),!0).catch(ee=>{A(ee instanceof Error?ee.message:String(ee))})};return F?o.jsxs(Th,{className:"cronjobs-page","aria-label":St("detail.pageLabel"),children:[o.jsx(m6t,{job:F,runs:m,runsLoading:b,runsError:y,busyAction:O,onBack:()=>d(""),onEdit:()=>h(F),onToggle:()=>H(F),onRun:()=>Q(F),onDelete:()=>{A(""),_({kind:"delete",job:F})},onCancel:B=>{A(""),_({kind:"cancel",job:F,run:B})},onRetryRun:()=>K(F,St("notices.requeued")),onRetryRuns:()=>void R(F.jobId)}),E?o.jsx("div",{className:"cronjobs-notice",role:"status",children:o.jsx(Eb,{color:"info",variant:"soft",description:E})}):null,f!==void 0?o.jsx(Wte,{job:f,runtimes:i,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null,N?o.jsx(pc,{title:St(N.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:N.kind==="delete"?St("confirm.deleteDescription",{name:N.job.name}):St("confirm.cancelDescription"),error:j,confirmLabel:St(N.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:O.endsWith(N.kind),onCancel:()=>{A(""),_(null)},onConfirm:q}):null]}):o.jsxs(Th,{className:"cronjobs-page","aria-label":St("page.title"),children:[o.jsx(zx,{className:"cronjobs-page-head",title:St("page.title")}),o.jsx(Zb,{children:o.jsx(dE,{idPrefix:"cronjobs-filter",ariaLabel:St("page.filterLabel"),value:k,items:[{id:"all",label:St("filters.all")},{id:"enabled",label:St("status.enabled")},{id:"paused",label:St("status.paused")}],onChange:S})}),E?o.jsx("div",{className:"cronjobs-banner",role:"status",children:o.jsx(Eb,{color:"info",variant:"soft",description:E})}):null,o.jsx(Jb,{"aria-label":St("page.listLabel"),children:s&&t.length===0?o.jsx(Ud,{}):l?o.jsxs(Cn,{className:"cronjobs-state",fill:"none",children:[o.jsx(Cn.Icon,{color:"danger",children:o.jsx(IF,{})}),o.jsx(Cn.Title,{color:"danger",children:St("page.loadFailed")}),o.jsx(Cn.Description,{children:l}),o.jsx(Cn.ActionRow,{children:o.jsxs(Ht,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void P(),children:[o.jsx(Kj,{}),St("actions.retry")]})})]}):o.jsx(p6t,{jobs:T,canCreate:!s&&i.length>0,onCreate:()=>h(null),onSelect:B=>d(B.jobId)})}),f!==void 0?o.jsx(Wte,{job:f,runtimes:i,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null]})}function tRe({label:e,onClick:t}){return o.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}const b6t={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function Sk(e){return e.trim()}function sz(e){return b6t[e]}function y6t(e){const t=Sk(e);if(!t)return null;let n=t;try{n=new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return null}const i=n.match(/^(.+)\.tos-([a-z0-9-]+)\.(?:volces|bytepluses)\.com$/i);return i?{bucket:i[1],region:i[2]}:null}function v6t(e,t){const n=y6t(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${sz(e)}/tos/bucket/setting?${i.toString()}`}function x6t(e,t,n){const i=Sk(t),r=Sk(n);return!i||!r?null:`${sz(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function w6t(e,t,n){const i=Sk(t),r=Sk(n);return!i||!r?null:`${sz(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function lw({href:e,label:t,children:n}){return e?o.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[o.jsx("span",{children:n}),o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M7.75 5.25h-2.5a1.5 1.5 0 0 0-1.5 1.5v8a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5v-2.5"}),o.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):o.jsx("span",{children:n})}function O6t(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function S6t({spinning:e}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?"is-spinning":"",children:o.jsx("path",{d:"M19.5 9A8 8 0 0 0 5 6L3 9m0-5v5h5M4.5 15A8 8 0 0 0 19 18l2-3m0 5v-5h-5"})})}function k6t(){return{busy:!1,error:"",message:""}}function E6t({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:a}=Te("ui"),l=n==="admin",[c,u]=p.useState(""),[d,f]=p.useState([]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState(!0),[x,O]=p.useState(""),[w,k]=p.useState(!0),[S,E]=p.useState(""),[C,N]=p.useState(!0),[_,j]=p.useState(""),[A,F]=p.useState(0),[T,P]=p.useState(0),[R,L]=p.useState(0),M=p.useRef(!1),[U,I]=p.useState({}),[H,K]=p.useState({}),[Q,q]=p.useState(""),[B,ee]=p.useState(!0),le=p.useRef(new Set),se=p.useRef(0),re=`${i}:${r}`,ge=p.useRef(re);ge.current=re,p.useEffect(()=>{K({}),I({})},[re]),p.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]);function W(ae,ue){I(Oe=>({...Oe,[ae]:{...k6t(),...Oe[ae],...ue}}))}async function X(ae){if(!ae.toolId||le.current.has(ae.toolId))return;const ue=re;le.current.add(ae.toolId),se.current+=1,W(ae.toolId,{busy:!0,error:"",message:""});try{const Oe=await fye(ae.kind);if(!M.current||ge.current!==ue)return;se.current+=1,K(ke=>({...ke,[ae.toolId]:Oe.state})),W(ae.toolId,{busy:!1,error:"",message:Oe.updated?a("systemInfo.modelEnvUpdated"):a("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!M.current||ge.current!==ue)return;se.current+=1,W(ae.toolId,{busy:!1,error:a("systemInfo.sandboxUpdateError"),message:""})}finally{le.current.delete(ae.toolId)}}return p.useEffect(()=>{if(!l)return;const ae=new AbortController,ue=++se.current;return q(""),ee(!0),dye(ae.signal).then(Oe=>{ae.signal.aborted||ue!==se.current||K(Object.fromEntries(Oe.map(ke=>[ke.toolId,ke])))}).catch(()=>{!ae.signal.aborted&&ue===se.current&&q(a("systemInfo.versionCheckError"))}).finally(()=>{ae.signal.aborted||ee(!1)}),()=>ae.abort()},[l,i,r,A]),p.useEffect(()=>{if(!Object.values(H).some(ue=>ue.status==="Updating"||ue.status==="Creating"))return;const ae=window.setTimeout(()=>F(ue=>ue+1),5e3);return()=>window.clearTimeout(ae)},[H]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),O("");return}const ae=new AbortController;return y(!0),O(""),f0e(ae.signal).then(ue=>{ae.signal.aborted||(u(ue.storage.tosAddress),f(ue.sandboxTools))}).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&O(a("systemInfo.sandboxInfoError"))}).finally(()=>{ae.signal.aborted||y(!1)}),()=>ae.abort()},[l,i,r,A]),p.useEffect(()=>{if(!l){m([]),k(!1),E("");return}const ae=new AbortController;return k(!0),E(""),aR(ae.signal).then(ue=>{m(ue.filter(Oe=>Oe.isCurrent))}).catch(ue=>{if((ue==null?void 0:ue.name)!=="AbortError"){if(t&&O6t(ue)){m([]);return}E(a("systemInfo.userPoolError"))}}).finally(()=>{ae.signal.aborted||k(!1)}),()=>ae.abort()},[l,t,T]),p.useEffect(()=>{if(!l){b(null),N(!1),j("");return}const ae=new AbortController;return N(!0),j(""),j0e(ae.signal).then(b).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&j(a("systemInfo.environmentResourcesError"))}).finally(()=>{ae.signal.aborted||N(!1)}),()=>ae.abort()},[l,R]),o.jsxs("div",{className:"system-info-page",children:[o.jsxs("header",{className:"system-info-page-header",children:[o.jsx(tRe,{label:a("common.back"),onClick:s}),o.jsxs("div",{children:[o.jsx("h1",{children:a("systemInfo.title")}),o.jsx("p",{children:a("systemInfo.description")})]})]}),o.jsxs("div",{className:"system-info-scroll",children:[o.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[o.jsx("h2",{id:"studio-info-title",children:a("systemInfo.general")}),o.jsx("dl",{className:"system-info-summary",children:o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.currentVersion")}),o.jsx("dd",{children:e||"—"})]})})]}),l?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[o.jsx("h2",{id:"storage-info-title",children:a("systemInfo.storage")}),v?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:a("systemInfo.loadingStorage")})}):x?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:x}),o.jsx("button",{type:"button",onClick:()=>F(ae=>ae+1),children:a("common.reload")})]}):o.jsx("dl",{className:"system-info-summary",children:o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.tosAddress")}),o.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:o.jsx(lw,{href:v6t(i,c),label:a("systemInfo.openTosConsole"),children:c||a("common.notConfigured")})})]})})]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[o.jsx("h2",{id:"environment-build-info-title",children:a("systemInfo.environmentBuild")}),C?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:a("systemInfo.loadingEnvironmentResources")})}):_?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:_}),o.jsx("button",{type:"button",onClick:()=>L(ae=>ae+1),children:a("common.reload")})]}):g?o.jsxs("dl",{className:"system-info-summary",children:[o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.codePipelineWorkspace")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:g.codePipeline.consoleUrl||null,label:a("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||a("systemInfo.createdOnFirstBuild")})})]}),o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.codePipelinePipeline")}),o.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||a("systemInfo.createdOnFirstBuild")})]}),o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.containerRegistryRepository")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:g.containerRegistry.consoleUrl||null,label:a("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||a("systemInfo.createdOnFirstBuild")})})]})]}):null]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[o.jsx("h2",{id:"sandbox-tool-title",children:a("systemInfo.sandboxInfo")}),o.jsx("button",{type:"button",className:"system-info-refresh",disabled:B,onClick:()=>F(ae=>ae+1),children:a(B?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:a("systemInfo.loadingSandboxInfo")})}):x?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:x}),o.jsx("button",{type:"button",onClick:()=>F(ae=>ae+1),children:a("common.reload")})]}):o.jsxs("div",{className:"system-info-tool-list",children:[Q?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:Q}):null,d.map(ae=>{var Le;const ue=H[ae.toolId],Oe=U[ae.toolId],ke=!!ae.toolId&&!!(ue!=null&&ue.canUpdate),st=(Oe==null?void 0:Oe.error)||(ue!=null&&ue.error?a("systemInfo.versionCheckError"):ue!=null&&ue.modelEnvError?a("systemInfo.modelEnvRepairUnavailable"):"");return o.jsx("dl",{className:"system-info-tool",children:o.jsxs("div",{className:"system-info-resource-row",children:[o.jsxs("dt",{className:"system-info-tool-label",children:[o.jsx("span",{children:ae.label}),ae.snapshot?o.jsx("span",{className:"system-info-tool-badge",children:a("systemInfo.snapshot")}):null]}),o.jsxs("dd",{className:`system-info-resource-value${ae.toolId?"":" is-empty"}`,children:[o.jsx(lw,{href:x6t(i,(ue==null?void 0:ue.region)||r,ae.toolId),label:a("systemInfo.openToolConsole",{name:ae.label}),children:ae.toolId||a("common.notConfigured")}),ke?o.jsx("button",{type:"button",className:"system-info-resource-update",disabled:Oe==null?void 0:Oe.busy,"aria-busy":(Oe==null?void 0:Oe.busy)||void 0,"aria-label":a("systemInfo.updateSandbox",{name:ae.label,variant:ae.snapshot?a("systemInfo.snapshotWithSpace"):""}),title:a("systemInfo.updateSandbox",{name:ae.label,variant:ae.snapshot?a("systemInfo.snapshotWithSpace"):""}),onClick:()=>void X(ae),children:o.jsx(S6t,{spinning:(Oe==null?void 0:Oe.busy)||!1})}):null,ue!=null&&ue.currentImage?o.jsxs("span",{className:"system-info-inline-status",title:`${ue.currentImage} → ${ue.latestImage}`,children:[ue.currentImage.split(":").pop(),ue.needsImageUpdate?` → ${(Le=ue.latestImage)==null?void 0:Le.split(":").pop()}`:"",ue.status==="Updating"?` · ${a("systemInfo.updatingSandbox")}`:""]}):null,Oe!=null&&Oe.message?o.jsx("span",{className:"system-info-inline-status",role:"status",children:Oe.message}):null,st?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:st}):null]})]})},ae.kind)})]})]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[o.jsx("h2",{id:"user-pool-title",children:a("systemInfo.userPool")}),w?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(xn,{as:"span",children:a("systemInfo.loadingUserPool")})}):S?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:S}),o.jsx("button",{type:"button",onClick:()=>P(ae=>ae+1),children:a("common.reload")})]}):h.length>0?o.jsx("div",{className:"system-info-pool-list",children:h.map(ae=>o.jsxs("dl",{className:"system-info-pool",children:[o.jsxs("div",{children:[o.jsx("dt",{children:a("common.name")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:w6t(i,ae.region||r,ae.uid),label:a("systemInfo.openUserPoolConsole",{name:ae.name||""}),children:ae.name||a("systemInfo.unnamedUserPool")})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.id")}),o.jsx("dd",{children:ae.uid||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.domain")}),o.jsx("dd",{children:ae.domain||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.region")}),o.jsx("dd",{children:ae.region||"—"})]})]},ae.uid))}):o.jsx("p",{className:"system-info-empty",children:a(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const C6t="_TextLink_16uec_1",T6t={TextLink:C6t},v2=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:a,as:l,href:c,to:u,...d}=e,f=a??/^https?:\/\//.test(c??u??""),h=Bxe(),m=l||(f?"a":h),g={...d,className:pi(T6t.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return o.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return o.jsx(m,{...b,children:t})},A6t="/assets/media/article-agent-workflow-GXPkXUjV.webp",_6t="/assets/media/article-tool-debugging-BxiMDz_8.webp",N6t="/assets/media/showcase-a2ui-BgBnE9RT.webp",j6t="/assets/media/showcase-customer-service-DNw0mUH1.webp",R6t="/assets/media/showcase-multimodal-BRTl8NLI.webp",I6t="/assets/media/showcase-research-assistant-CbfMFfhS.webp",P6t="/assets/media/showcase-web-search-D2kl1imN.webp",D6t={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 M6t(e){return D6t[e]}const L6t=[{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"}],$6t="https://volcengine.github.io/veadk-python/",F6t="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",B6t=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:A6t,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:_6t,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],U6t=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:I6t,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:R6t,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:j6t,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:P6t,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:N6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function Q6t({cloudProvider:e}){const{t}=Te("workspaceTools"),n=M6t(e);return o.jsxs(Th,{className:"developer-resources","aria-label":t("developerResources.title"),children:[o.jsx(zx,{title:t("developerResources.title")}),o.jsx("div",{className:"developer-resources__content",children:L6t.map(i=>o.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[o.jsxs("header",{className:"developer-resources__section-header",children:[o.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),o.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?o.jsxs("ul",{className:"developer-resources__links",children:[o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:$6t,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:F6t,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),o.jsx(YC,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?o.jsx("div",{className:"developer-resources__articles",children:B6t.map(r=>o.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[o.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),o.jsxs("span",{className:"developer-resources__article-copy",children:[o.jsx("strong",{children:t(r.titleKey)}),o.jsx("span",{children:t(r.descriptionKey)}),o.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?o.jsx("div",{className:"developer-resources__showcases",children:U6t.map(r=>o.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"developer-resources__showcase-media",children:o.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),o.jsx("strong",{children:t(r.titleKey)}),o.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}const x2=10;function z6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function V6t({hidden:e,...t}){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),o.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?o.jsx("path",{d:"m4 4 12 12"}):null]})}function dg(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function H6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function q6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cw(e,t,n){const i=t.trim();if(!i)return n?"github.validation.required":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(i))return"github.validation.repository";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(i)||i.includes("..")))return"github.validation.baseBranch";if(e==="projectPath"&&(i.startsWith("/")||i.split("/").includes("..")))return"github.validation.projectPath";if(e==="runtimeName")return qE(i,r=>`github.validation.runtimeName.${r}`)??"";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(i))return"github.validation.runtimeId";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(i))return"github.validation.modelName";if(e==="modelBaseUrl")try{const r=new URL(i);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash)return"github.validation.modelBaseUrlSafe"}catch{return"github.validation.modelBaseUrl"}return e==="pullRequestUrl"&&!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*\/?$/.test(i)?"请输入完整的 GitHub Pull Request URL":""}function W6t(e){try{return`https://github.com/${iz(e)}`}catch{return""}}function G6t(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function K6t(e){return e==="webhook"?"自动触发":"手动发起"}function X6t(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 Y6t(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 Gte(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 Z6t({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=Te("automations"),s=Y4t(e),a=e==="review",l=Iu(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Qe=>Qe.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[x,O]=p.useState(!1),[w,k]=p.useState(!1),[S,E]=p.useState(null),[C,N]=p.useState(""),[_,j]=p.useState(null),[A,F]=p.useState(""),[T,P]=p.useState(!1),[R,L]=p.useState(null),[M,U]=p.useState(""),[I,H]=p.useState(a),[K,Q]=p.useState([]),[q,B]=p.useState(a),[ee,le]=p.useState(""),[se,re]=p.useState(null),[ge,W]=p.useState(1),[X,ae]=p.useState(!1),[ue,Oe]=p.useState(""),[ke,st]=p.useState(""),[Le,Me]=p.useState(""),[Ie,qe]=p.useState([]),[Ae,ze]=p.useState(a),[Ee,De]=p.useState(""),[J,he]=p.useState(null),[_e,Ze]=p.useState(1),[at,wt]=p.useState(!1),Se=p.useRef(null),ve=p.useRef(null),He=p.useRef(null),Je=p.useRef(null),Ce=p.useRef(null),Wt=W6t(u.repository),ln=Wt.replace("https://github.com/",""),cn=Wt?`${Wt}/settings/secrets/actions`:"",Ot=(R==null?void 0:R.appSlug)||"agentkit-veadk-studio",jt=(R==null?void 0:R.installUrl)||`https://github.com/apps/${Ot}/installations/new`,ot=zte(C),gt=K.filter(Qe=>Qe.reviewEnabled),Pe=ot?K.find(Qe=>Qe.fullName.toLowerCase()===ot.toLowerCase()):void 0,Et=ge>1||X,bt=_e>1||at;p.useEffect(()=>()=>{var Qe,tt,ht,pe,We;(Qe=Se.current)==null||Qe.abort(),(tt=ve.current)==null||tt.abort(),(ht=He.current)==null||ht.abort(),(pe=Je.current)==null||pe.abort(),(We=Ce.current)==null||We.abort()},[]),p.useEffect(()=>{var Qe,tt,ht;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),E(null),k(!1),(Qe=Se.current)==null||Qe.abort(),(tt=ve.current)==null||tt.abort(),(ht=Ce.current)==null||ht.abort(),j(null),F(""),qe([]),De(""),he(null),W(1),ae(!1),Oe(""),st(""),Ze(1),wt(!1)},[e,t,s]),p.useEffect(()=>{var tt;if(!a)return;(tt=He.current)==null||tt.abort();const Qe=new AbortController;He.current=Qe,H(!0),U(""),A4t(Qe.signal).then(ht=>{He.current===Qe&&(L(ht),ht.configured||(B(!1),ze(!1)))}).catch(ht=>{Qe.signal.aborted||He.current!==Qe||(U(ht instanceof Error?ht.message:String(ht)),B(!1),ze(!1))}).finally(()=>{He.current===Qe&&(He.current=null,H(!1))})},[a]);const Mt=(Qe=ge,tt=ke)=>{var pe;(pe=Je.current)==null||pe.abort();const ht=new AbortController;Je.current=ht,B(!0),le(""),_4t(ht.signal,{page:Qe,pageSize:x2,query:tt}).then(We=>{if(Je.current===ht){if(We.repositories.length===0&&We.page>1){W(We.page-1),Mt(We.page-1);return}Q(We.repositories),W(We.page),ae(We.hasNextPage),re({reviewSettingsConfigured:We.reviewSettingsConfigured,reviewSettingsReason:We.reviewSettingsReason})}}).catch(We=>{ht.signal.aborted||Je.current!==ht||le(We instanceof Error?We.message:String(We))}).finally(()=>{Je.current===ht&&(Je.current=null,B(!1))})},$e=(Qe=_e)=>{var ht;(ht=Ce.current)==null||ht.abort();const tt=new AbortController;Ce.current=tt,ze(!0),De(""),N4t(tt.signal,{page:Qe,pageSize:x2}).then(pe=>{if(Ce.current===tt){if(pe.records.length===0&&pe.page>1){Ze(pe.page-1),$e(pe.page-1);return}qe(pe.records),Ze(pe.page),wt(pe.hasNextPage),he({reviewSettingsConfigured:pe.reviewSettingsConfigured,reviewSettingsReason:pe.reviewSettingsReason})}}).catch(pe=>{tt.signal.aborted||Ce.current!==tt||De(pe instanceof Error?pe.message:String(pe))}).finally(()=>{Ce.current===tt&&(Ce.current=null,ze(!1))})};p.useEffect(()=>{!a||(R==null?void 0:R.configured)!==!0||(Mt(1),$e(1))},[R==null?void 0:R.configured,a]);const ye=()=>{const Qe=ue.trim();st(Qe),W(1),Mt(1,Qe)},Ue=()=>{Oe(""),st(""),W(1),Mt(1,"")},Ke=(Qe,tt)=>{if(!(tt<1)){if(Qe==="repositories"){W(tt),Mt(tt,ke);return}Ze(tt),$e(tt)}},ft=async Qe=>{if((se==null?void 0:se.reviewSettingsConfigured)!==!0||Le)return;const tt=new AbortController;Me(Qe.fullName),le("");try{const ht=await j4t({repository:Qe.fullName,reviewEnabled:!Qe.reviewEnabled},tt.signal),pe=new Set(ht.map(We=>We.toLowerCase()));Q(We=>We.map(vt=>({...vt,reviewEnabled:pe.has(vt.fullName.toLowerCase())})))}catch(ht){le(ht instanceof Error?ht.message:String(ht))}finally{Me("")}},ut=(Qe,tt)=>{d(ht=>({...ht,[Qe]:tt})),h[Qe]&&m(ht=>({...ht,[Qe]:""}))},Gt=Qe=>{var We;const tt=!a&&Qe==="token"||Qe==="pullRequestUrl"||((We=s.fields.find(vt=>vt.name===Qe))==null?void 0:We.required)===!0,ht=Qe==="pullRequestUrl"?C:u[Qe],pe=cw(Qe,ht,tt);m(vt=>({...vt,[Qe]:pe}))},Rt=async Qe=>{var pe;if(Qe.preventDefault(),a)return;const tt={};for(const We of s.fields){const vt=cw(We.name,u[We.name],We.required);vt&&(tt[We.name]=vt)}if(!a){const We=cw("token",u.token,!0);We&&(tt.token=We)}if(m(tt),Object.keys(tt).length)return;(pe=Se.current)==null||pe.abort();const ht=new AbortController;Se.current=ht,y(!0),b(""),E(null);try{const We=await s.submit(u,{cloudProvider:t},ht.signal);if(Se.current!==ht)return;E(We),d(vt=>({...vt,token:""}))}catch(We){if(ht.signal.aborted||Se.current!==ht)return;b(We instanceof Error?We.message:String(We))}finally{Se.current===ht&&(Se.current=null,y(!1))}},zt=Qe=>{Qe.key==="Enter"&&(Qe.nativeEvent.isComposing||Qe.nativeEvent.keyCode===229)&&Qe.preventDefault()},Z=async()=>{var pe;const Qe={},tt=cw("pullRequestUrl",C,!0);if(tt&&(Qe.pullRequestUrl=tt),!tt){const We=zte(C),vt=K.find(vn=>vn.fullName.toLowerCase()===We.toLowerCase());vt?vt.reviewEnabled||(Qe.pullRequestUrl=`请先在下方开启 ${vt.fullName} 的评审`):Qe.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Qe),Object.keys(Qe).length)return;(pe=ve.current)==null||pe.abort();const ht=new AbortController;ve.current=ht,P(!0),F(""),j(null);try{const We=await T4t({pullRequestUrl:C.trim()},ht.signal);if(ve.current!==ht)return;j(We),d(vt=>({...vt,token:""})),$e(),i==null||i(We.sessionId)}catch(We){if(ht.signal.aborted||ve.current!==ht)return;F(We instanceof Error?We.message:String(We))}finally{ve.current===ht&&(ve.current=null,P(!1))}},Bt=Qe=>{const{name:tt,placeholder:ht,required:pe}=Qe,We=tt==="repository",vt=`cards.${e}.fields.${tt}`;return o.jsxs("div",{className:"github-field",children:[o.jsxs("div",{className:"github-field-label-row",children:[o.jsxs("label",{htmlFor:`github-${tt}`,children:[o.jsx("span",{children:r(`${vt}.label`)}),o.jsx("span",{className:`github-field-requirement${pe?" is-required":""}`,children:r(pe?"github.required":"github.optional")})]}),We?o.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",o.jsx(dg,{})]}):null]}),o.jsx("input",{id:`github-${tt}`,value:u[tt],onChange:vn=>ut(tt,vn.target.value),onBlur:()=>Gt(tt),placeholder:r(`${vt}.placeholder`,{defaultValue:ht}),required:pe,"aria-invalid":!!h[tt],"aria-describedby":`github-${tt}-help${h[tt]?` github-${tt}-error`:""}`}),o.jsx("span",{id:`github-${tt}-help`,className:"github-field-help",children:We&&ln?a?r("github.repositoryReviewHelp",{repository:ln}):r("github.repositoryConfigHelp",{repository:ln}):r(`${vt}.help`)}),h[tt]?o.jsx("span",{id:`github-${tt}-error`,className:"github-field-error",role:"alert",children:r(h[tt])}):null]},tt)};return o.jsxs("div",{className:"github-integration-page",children:[o.jsxs("header",{className:"github-integration-header",children:[o.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:o.jsx(z6t,{})}),o.jsx(YQ,{className:"github-integration-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:r(`cards.${e}.title`)}),o.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),o.jsx("div",{className:"github-integration-layout",children:o.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[o.jsx("div",{className:"github-panel-heading",children:o.jsx("p",{children:r(`cards.${e}.panel`)})}),o.jsxs("form",{className:"github-release-form",onSubmit:Rt,onKeyDown:zt,noValidate:!0,children:[a?null:o.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Bt),o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{id:"github-region-label",children:[o.jsx("span",{children:r("github.region")}),o.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),o.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Qe=>{Qe.key==="Escape"&&k(!1)},children:[o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":w,onClick:()=>k(Qe=>!Qe),children:[o.jsx("span",{children:(f==null?void 0:f.label)??u.region}),o.jsx(H6t,{className:`pp-region-chevron${w?" is-open":""}`})]}),w?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>k(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Qe=>{const tt=Qe.value===u.region;return o.jsxs("button",{type:"button",role:"option","aria-selected":tt,className:`pp-region-option${tt?" is-selected":""}`,onClick:()=>{ut("region",Qe.value),k(!1)},children:[o.jsx("span",{children:Qe.label}),tt?o.jsx(q6t,{}):null]},Qe.value)})})]}):null]}),o.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),a?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`github-app-card${R!=null&&R.configured?" is-ready":""}`,children:[o.jsxs("div",{children:[o.jsx("strong",{children:"GitHub App 授权"}),o.jsx("span",{children:I?"正在检查中心服务配置...":R!=null&&R.configured?`安装 ${Ot} 到目标仓库后,可在下方开启自动评审。`:M||(R==null?void 0:R.reason)||"管理员未配置 GitHub App。"})]}),o.jsxs("a",{className:"github-app-install-link",href:jt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",o.jsx(dg,{})]})]}),o.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),o.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),o.jsx("button",{type:"button",onClick:()=>Mt(),disabled:!(R!=null&&R.configured)||q,children:q?"刷新中...":"刷新"})]}),ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:ee}):null,(se==null?void 0:se.reviewSettingsConfigured)===!1&&!ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:se.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,o.jsxs("div",{className:"github-app-repository-search",children:[o.jsx("input",{type:"search",value:ue,onChange:Qe=>Oe(Qe.target.value),onKeyDown:Qe=>{Qe.key==="Enter"&&(Qe.preventDefault(),ye())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),o.jsx("button",{type:"button",onClick:ye,disabled:!(R!=null&&R.configured)||q,children:"搜索"}),ke?o.jsx("button",{type:"button",onClick:Ue,disabled:q,children:"清除"}):null]}),q&&K.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!q&&K.length===0&&!ee?o.jsx("div",{className:"github-app-repository-empty",children:ke?`没有匹配 “${ke}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,K.length>0?o.jsx("div",{className:"github-app-repository-list",children:K.map(Qe=>{const tt=Le===Qe.fullName,ht=(se==null?void 0:se.reviewSettingsConfigured)!==!0||!!Le;return o.jsxs("div",{className:"github-app-repository-row",children:[o.jsxs("div",{className:"github-app-repository-main",children:[o.jsxs("a",{href:Qe.htmlUrl,target:"_blank",rel:"noreferrer",title:Qe.fullName,children:[Qe.fullName,o.jsx(dg,{})]}),o.jsxs("span",{children:[Qe.private?"Private":"Public"," · Installation ",Qe.installationId]})]}),o.jsx("button",{type:"button",className:`github-review-switch${Qe.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Qe.reviewEnabled,disabled:ht,onClick:()=>{ft(Qe)},children:o.jsx("span",{children:tt?"保存中":Qe.reviewEnabled?"已启用":"未启用"})})]},Qe.fullName)})}):null,Et?o.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[o.jsx("span",{children:Gte(ge,x2,K.length,X)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ke("repositories",ge-1),disabled:ge<=1||q,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ke("repositories",ge+1),disabled:!X||q,children:"下一页"})]})]}):null]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"github-field github-token-field",children:[o.jsxs("div",{className:"github-token-label-row",children:[o.jsxs("label",{htmlFor:"github-token",children:[o.jsx("span",{children:r("github.tokenLabel")}),o.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),o.jsxs("a",{className:"github-field-action",href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write&workflows=write",target:"_blank",rel:"noreferrer",children:[r("github.createToken"),o.jsx(dg,{})]})]}),o.jsxs("div",{className:"github-token-input",children:[o.jsx("input",{id:"github-token",type:x?"text":"password",value:u.token,onChange:Qe=>ut("token",Qe.target.value),onBlur:()=>Gt("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),o.jsx("button",{type:"button",onClick:()=>O(Qe=>!Qe),"aria-label":r(x?"github.hideToken":"github.showToken"),title:r(x?"github.hideToken":"github.showToken"),children:o.jsx(V6t,{hidden:x})})]}),o.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?o.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,S?o.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[o.jsxs("div",{children:[o.jsx("strong",{children:r("github.configPrCreated",{number:S.number})}),o.jsx("span",{children:r("github.configPrNextStep")})]}),o.jsxs("a",{className:"github-result-link",href:S.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),o.jsx(dg,{})]})]}):null,o.jsxs("div",{className:"github-form-actions",children:[o.jsxs("div",{className:"github-secrets-note",children:[o.jsxs("div",{className:"github-secrets-header",children:[o.jsx("strong",{children:r("github.secretsConfigHeading")}),cn?o.jsxs("a",{className:"github-secrets-link",href:cn,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),o.jsx(dg,{})]}):null]}),o.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),o.jsx("ul",{children:c.map(Qe=>{const[tt,...ht]=Qe.split(":");return o.jsxs("li",{children:[o.jsx("code",{children:tt}),ht.length?o.jsx("span",{children:ht.join(":")}):null]},Qe)})})]}),o.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),a?o.jsxs("div",{className:"github-pr-review-sections",children:[o.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[o.jsx("div",{className:"github-review-section-header",children:o.jsxs("div",{children:[o.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),o.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),o.jsxs("div",{className:"github-review-section-body",children:[o.jsxs("div",{className:"github-field",children:[o.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:C,onChange:Qe=>{N(Qe.target.value),h.pullRequestUrl&&m(tt=>({...tt,pullRequestUrl:""}))},onBlur:()=>m(Qe=>({...Qe,pullRequestUrl:cw("pullRequestUrl",C,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?o.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&ot?o.jsx("span",{className:"github-field-help",children:Pe!=null&&Pe.reviewEnabled?`将使用 GitHub App 评审 ${Pe.fullName}`:Pe?`请先在下方开启 ${Pe.fullName} 的评审`:`PR URL 所属仓库 ${ot} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!ot&>.length>0?o.jsxs("span",{className:"github-field-help",children:["已启用仓库:",gt.map(Qe=>Qe.fullName).join("、")]}):null]}),A?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:A}):null,_?o.jsx("div",{className:"github-submit-message is-success",role:"status",children:o.jsxs("span",{children:["已发起评审,Session ",_.sessionId," 正在运行。"]})}):null,o.jsx("div",{className:"github-review-section-actions",children:o.jsx("button",{type:"button",onClick:Z,disabled:T,children:T?"发起评审中…":"立即发起评审"})})]})]}),o.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),o.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),o.jsx("button",{type:"button",onClick:()=>$e(),disabled:!(R!=null&&R.configured)||Ae,children:Ae?"刷新中...":"刷新"})]}),Ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Ee}):null,(J==null?void 0:J.reviewSettingsConfigured)===!1&&!Ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:J.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,Ae&&Ie.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!Ae&&Ie.length===0&&!Ee?o.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,Ie.length>0?o.jsx("div",{className:"github-review-record-list",children:Ie.map(Qe=>{const tt=X6t(Qe),ht=Qe.status==="completed"?"":Qe.sessionId;return o.jsxs("div",{className:"github-review-record-row",children:[o.jsxs("div",{className:"github-review-record-main",children:[o.jsxs("div",{className:"github-review-record-title",children:[o.jsxs("a",{href:Qe.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Qe.repository,"#",Qe.pullRequestNumber,o.jsx(dg,{})]}),o.jsx("span",{className:`github-review-record-status is-${Qe.status}`,children:G6t(Qe.status)})]}),o.jsxs("span",{children:[K6t(Qe.trigger),Qe.action?` · ${Qe.action}`:""," · ",Y6t(Qe.createdAt),tt?` · ${tt}`:""]})]}),o.jsx("div",{className:"github-review-record-actions",children:ht&&i?o.jsx("button",{type:"button",onClick:()=>i(ht),children:"打开 Session"}):null})]},Qe.id)})}):null,bt?o.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[o.jsx("span",{children:Gte(_e,x2,Ie.length,at)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ke("records",_e-1),disabled:_e<=1||Ae,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ke("records",_e+1),disabled:!at||Ae,children:"下一页"})]})]}):null]})]}):null]})})]})}const J6t=1050062,Kte="1.0",e$t="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class t$t{constructor(){ki(this,"enabled",!1);ki(this,"initialized",!1);ki(this,"pending",[]);ki(this,"userUniqueId","");ki(this,"initPromise")}init(t){return this.enabled=t.enabled,this.enabled?this.initPromise?this.initPromise:(this.initPromise=Promise.resolve().then(()=>{const n=this.bootstrapCollector();n("init",{app_id:J6t,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=e$t,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 n$t=256,nRe=1024,fL="[REDACTED]";function i$t(e){if(typeof e!="string"&&typeof e!="number")return;const t=String(e).trim();return/^[A-Za-z0-9_.:-]{1,64}$/.test(t)?t:void 0}function wf(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function iRe(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 r$t(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${fL}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${fL}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${fL}`)}function qg(e,t={}){const n=e!==null&&typeof e=="object"?e:{},r=(typeof n.message=="string"?n.message:typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"").replace(/\s+/g," ").trim();if(r)return iRe(r$t(r),nRe,t)}function Wa(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=i$t(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return wf("runtime_probe_error",i);if(r==="AbortError")return wf("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return wf("auth",i);if(t.phase==="build")return wf("build_failed",i);if(r==="TimeoutError")return wf("timeout",i);if(r==="NetworkError"||r==="TypeError")return wf("network",i);if(r==="ValidationError")return wf("validation",i);if(r==="ServerError")return wf("server",i);const s=typeof n.status=="number"&&Number.isInteger(n.status)?n.status:void 0;if(s===void 0||s<400||s>599)return wf("unknown",i);const a=String(s);return s===401||s===403?{errorKind:"auth",errorCode:a}:s===400||s===409||s===422?{errorKind:"validation",errorCode:a}:s>=500?{errorKind:"server",errorCode:a}:{errorKind:"unknown",errorCode:a}}const s$t=["schema_version","event_id","operation_id","user_pool_id","studio_deploy_id","vefaas_application_id","vefaas_function_id","studio_region","studio_project","studio_version","environment","cloud_provider","account_id","account_id_resolution_error","user_role","user_source","page_instance_id"],a$t={studio_entry_viewed:["auth_state"],studio_session_started:["agents_source"],studio_agent_deploy:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","deploy_region","runtime_network_type","feishu_enabled","runtime_id","duration_ms","failed_phase","error_kind","error_code","error_message"],studio_sandbox_create:["status","sandbox_kind","sandbox_source","sandbox_id","duration_ms","error_kind","error_code"],studio_agent_debug:["status","agent_id","variant_type","debug_run_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_connect:["status","target_id","agent_kind","connect_source","runtime_region","runtime_is_mine","sandbox_status","duration_ms","error_kind","error_code"],studio_agent_message:["status","agent_id","agent_kind","message_source","session_state","session_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_source_download:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","duration_ms","file_count","zip_size_bytes","error_kind","error_code"]};function o$t(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function Xte(e,t){const n=new Set([...s$t,...a$t[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!o$t(s)||(typeof s=="string"?i[r]=iRe(s,r==="error_message"?nRe:n$t):i[r]=s);return i}function l$t(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function c$t(){return typeof performance<"u"?performance.now():Date.now()}function V0(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class u$t{constructor(t){ki(this,"sink");ki(this,"createId");ki(this,"now");ki(this,"pageInstanceId");ki(this,"context");ki(this,"identity");ki(this,"entryViewed",!1);ki(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??l$t,this.now=t.now??c$t,this.pageInstanceId=this.createId()}setContext(t){var n,i;this.context={...t,accountId:((n=t.accountId)==null?void 0:n.trim())??"",accountIdResolutionError:((i=t.accountIdResolutionError)==null?void 0:i.trim())??""}}identify(t){var i,r,s;const n=t.userUniqueId.trim();n&&(this.identity&&this.identity.userUniqueId!==n&&(this.pageInstanceId=this.createId(),this.sessionStarted=!1),this.identity={...t,userUniqueId:n,accountId:((i=t.accountId)==null?void 0:i.trim())??""},(s=(r=this.sink).identify)==null||s.call(r,n))}trackStudioSessionStarted(t){this.sessionStarted||!this.context||!this.identity||(this.sessionStarted=!0,this.emit("studio_session_started",{agents_source:t.agentsSource}))}trackStudioEntryViewed(t){if(this.entryViewed||!this.context)return;this.entryViewed=!0;const n=Xte("studio_entry_viewed",V0({schema_version:Kte,event_id:this.createId(),user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.context.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,page_instance_id:this.pageInstanceId,auth_state:t.authState}));this.sink.emit("studio_entry_viewed",n)}beginAgentDeploy(t){return this.beginOperation("studio_agent_deploy",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted,deploy_region:t.deployRegion,runtime_network_type:t.runtimeNetworkType,feishu_enabled:t.feishuEnabled},n=>({runtime_id:n.runtimeId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode,error_message:n.errorMessage}))}beginSandboxCreate(t){return this.beginOperation("studio_sandbox_create",{sandbox_kind:t.sandboxKind,sandbox_source:t.sandboxSource},n=>({sandbox_id:n.sandboxId}),n=>({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentDebug(t){return this.beginOperation("studio_agent_debug",{agent_id:t.agentId,variant_type:t.variantType},n=>({debug_run_id:n.debugRunId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentConnect(t){return this.beginOperation("studio_agent_connect",{target_id:t.targetId,agent_kind:t.agentKind,connect_source:t.connectSource},n=>V0({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>V0({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",V0({agent_id:t.agentId,agent_kind:t.agentKind,message_source:t.messageSource,session_state:t.sessionState,session_id:t.sessionId}),n=>({session_id:n.sessionId}),n=>V0({session_id:n.sessionId,failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentSourceDownload(t){return this.beginOperation("studio_agent_source_download",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted},n=>({file_count:n.fileCount,zip_size_bytes:n.zipSizeBytes}),n=>({file_count:n.fileCount,error_kind:n.errorKind,error_code:n.errorCode}))}beginOperation(t,n,i,r){const s=this.createId(),a=this.now(),l=!!(this.context&&this.identity);let c=!1;l&&this.emit(t,{...n,status:"started"},s);const u=(d,f)=>{c||(c=!0,l&&this.emit(t,{...n,...f,status:d,duration_ms:Math.max(0,this.now()-a)},s))};return{operationId:s,succeed:d=>u("succeeded",i(d)),fail:d=>u("failed",r(d))}}emit(t,n,i){if(!this.context||!this.identity)return;const r=Xte(t,V0({schema_version:Kte,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 rRe=new t$t,tf=new u$t({sink:rRe});function d$t(e){return rRe.init(e)}function f$t(e){tf.setContext(e)}function h$t(e){tf.identify(e)}function p$t(e){tf.trackStudioEntryViewed(e)}function m$t(e){tf.trackStudioSessionStarted(e)}function sRe(e){return tf.beginAgentDeploy(e)}function g$t(e){return tf.beginSandboxCreate(e)}function b$t(e){return tf.beginAgentDebug(e)}function w2(e){return tf.beginAgentConnect(e)}function Yte(e){return tf.beginAgentMessage(e)}function aRe(e){return tf.beginAgentSourceDownload(e)}const y$t=/^[A-Za-z_][A-Za-z0-9_]*$/;function WE(e,t=n=>$t(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):y$t.test(e)?null:t("characters")}function v$t(e){const t=new Set,n=new Set,i=r=>{WE(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function x$t(e){return{...oc(),name:e,description:Vd("feishu.generatedAgent.description"),instruction:Vd("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function w$t(e){const t=x$t(e.agentName),n=await wO(t);return Ax(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const ud=["cn-beijing","cn-shanghai"],oRe=["prepare","build","deploy","publish"];function O$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function S$t(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Zte(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function k$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function E$t(e){if(!e||e==="upload")return 0;const t=oRe.findIndex(n=>n===e);return t<0?0:t}function hL(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function Jte(e){const t=WE(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function C$t({onBack:e}){const{t}=Te("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState("cn-beijing"),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[x,O]=p.useState(""),[w,k]=p.useState("idle"),[S,E]=p.useState(null),[C,N]=p.useState(""),[_,j]=p.useState(null),A=p.useRef(null),F=p.useRef(null),T=p.useRef([]),P=p.useRef(0),R=p.useRef(null),L=p.useRef(null),M=p.useRef("prepare"),U=p.useRef(!1),I=p.useRef(!0),H=["preparing","running","cancelling"].includes(w);p.useEffect(()=>(I.current=!0,()=>{I.current=!1}),[]),p.useEffect(()=>{var W;if(!h)return;(W=T.current[P.current])==null||W.focus();const re=X=>{X.target instanceof Node&&A.current&&!A.current.contains(X.target)&&m(!1)},ge=X=>{var ae;X.key==="Escape"&&(m(!1),(ae=F.current)==null||ae.focus())};return window.addEventListener("pointerdown",re),window.addEventListener("keydown",ge),()=>{window.removeEventListener("pointerdown",re),window.removeEventListener("keydown",ge)}},[h]);const K=re=>{re.key==="Enter"&&(re.nativeEvent.isComposing||re.nativeEvent.keyCode===229)&&re.preventDefault()},Q=()=>{const re=Jte(n.trim()),ge=r.trim()?"":"feishu.validation.appId",W=a.trim()?"":"feishu.validation.appSecret";return b(re),y(ge),O(W),!re&&!ge&&!W},q=async re=>{if(re.preventDefault(),!Q()||H)return;const ge=crypto.randomUUID();R.current=ge,M.current="prepare",U.current=!1,k("preparing"),E(null),N(""),j(null);const W=sRe({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});L.current=W;try{const X=await w$t({agentName:n.trim(),appId:r.trim(),appSecret:a.trim(),region:d,taskId:ge,onStage:ae=>{M.current=ae.phase||"deploy",!(!I.current||U.current)&&(k("running"),E(ae))}});if(U.current){W.fail({failedPhase:hL(M.current),errorKind:"abort",errorMessage:qg("User cancelled deployment")});return}if(W.succeed({runtimeId:String(X.runtimeId||"")}),!I.current)return;j(X),l(""),u(!1),k("succeeded")}catch(X){if(W.fail({failedPhase:hL(M.current),...U.current?{errorKind:"abort"}:Wa(X,{phase:M.current}),errorMessage:qg(X)}),!I.current||U.current)return;k("failed"),N(X instanceof Error?X.message:String(X))}finally{R.current===ge&&(R.current=null),L.current===W&&(L.current=null)}},B=async()=>{var ge;const re=R.current;if(!(!re||w!=="running")&&window.confirm(t("feishu.confirmCancel"))){U.current=!0,k("cancelling"),N("");try{await $0e(re),(ge=L.current)==null||ge.fail({failedPhase:hL(M.current),errorKind:"abort",errorMessage:qg("User cancelled deployment")}),I.current&&k("cancelled")}catch(W){if(U.current=!1,!I.current)return;k("failed"),N(W instanceof Error?W.message:String(W))}}},ee=E$t((S==null?void 0:S.phase)??null),le=!!(n.trim()&&r.trim()&&a.trim()&&!H),se=t(`feishu.regions.${d}`);return o.jsxs("div",{className:"feishu-integration-page",children:[o.jsxs("header",{className:"feishu-integration-header",children:[o.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:H,children:o.jsx(O$t,{})}),o.jsx("img",{className:"feishu-integration-logo",src:QI,alt:"","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("h1",{children:t("feishu.title")}),o.jsx("p",{children:t("feishu.description")})]})]}),o.jsx("div",{className:"feishu-integration-layout",children:o.jsxs("section",{className:"feishu-section-panel",children:[o.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),o.jsxs("form",{className:"feishu-form",onSubmit:q,onKeyDown:K,noValidate:!0,children:[o.jsxs("div",{className:"feishu-field-grid",children:[o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),o.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:H,onChange:re=>{i(re.target.value),g&&b("")},onBlur:()=>b(Jte(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),o.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?o.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),o.jsxs("div",{className:"feishu-region-picker",ref:A,children:[o.jsxs("button",{ref:F,type:"button",className:"feishu-region-trigger",disabled:H,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{P.current=ud.findIndex(re=>re===d),m(re=>!re)},onKeyDown:re=>{re.key!=="ArrowDown"&&re.key!=="ArrowUp"||(re.preventDefault(),P.current=re.key==="ArrowUp"?ud.length-1:ud.findIndex(ge=>ge===d),m(!0))},children:[o.jsx("span",{id:"feishu-region-value",children:se}),o.jsx(S$t,{})]}),h?o.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:re=>{var X;const ge=T.current.findIndex(ae=>ae===document.activeElement);let W=null;re.key==="ArrowDown"?W=(ge+1)%ud.length:re.key==="ArrowUp"?W=(ge-1+ud.length)%ud.length:re.key==="Home"?W=0:re.key==="End"?W=ud.length-1:re.key==="Tab"&&m(!1),W!==null&&(re.preventDefault(),(X=T.current[W])==null||X.focus())},children:ud.map(re=>o.jsx("button",{ref:ge=>{const W=ud.findIndex(X=>X===re);T.current[W]=ge},type:"button",role:"option","aria-selected":d===re,className:`feishu-region-option${d===re?" is-selected":""}`,onClick:()=>{var ge;f(re),m(!1),(ge=F.current)==null||ge.focus()},children:t(`feishu.regions.${re}`)},re))}):null]}),o.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),o.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:H,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:re=>{s(re.target.value),v&&y("")},onBlur:()=>y(r.trim()?"":"feishu.validation.appId"),"aria-invalid":!!v,"aria-describedby":`feishu-app-id-help${v?" feishu-app-id-error":""}`}),o.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?o.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),o.jsxs("div",{className:"feishu-secret-input",children:[o.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:a,maxLength:256,autoComplete:"off",disabled:H,placeholder:t("feishu.appSecretPlaceholder"),onChange:re=>{l(re.target.value),x&&O("")},onBlur:()=>O(a.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!x,"aria-describedby":`feishu-app-secret-help${x?" feishu-app-secret-error":""}`}),o.jsx("button",{type:"button",disabled:H,onClick:()=>u(re=>!re),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),o.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),x?o.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(x)}):null]})]}),w!=="idle"?o.jsxs("div",{className:`feishu-deployment-status is-${w}`,role:w==="failed"?"alert":"status",children:[o.jsxs("div",{className:"feishu-deployment-heading",children:[w==="preparing"?o.jsx(xn,{as:"strong",children:t("feishu.status.preparing")}):null,w==="running"?o.jsx(xn,{as:"strong",children:S?$I(S):t("feishu.status.running")}):null,w==="cancelling"?o.jsx(xn,{as:"strong",children:t("feishu.status.cancelling")}):null,w==="succeeded"?o.jsxs("strong",{children:[o.jsx(Zte,{}),t("feishu.status.succeeded")]}):null,w==="cancelled"?o.jsx("strong",{children:t("feishu.status.cancelled")}):null,w==="failed"?o.jsx("strong",{children:t("feishu.status.failed")}):null]}),w==="preparing"||w==="running"||w==="cancelling"?o.jsx("ol",{className:"feishu-deployment-steps",children:oRe.map((re,ge)=>{const W=w==="running"&&gevoid B(),children:t("feishu.cancelDeployment")}):null,o.jsx("button",{type:"submit",className:"feishu-submit",disabled:!le,children:t(H?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function az(e,t,n,i=Wo){var s;const r=await An(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let a="";try{a=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(a||V("common.requestFailed",{status:r.status}))}return r.json()}function T$t(e){return az("/web/coding-agents/capabilities",{method:"GET"},e,FF)}function A$t(e,t){return az(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function _$t(e,t){return az("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const N$t="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function j$t(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function ene(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function tne(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function R$t(e){return e instanceof DOMException&&e.name==="AbortError"}function I$t(e){return e instanceof Error&&e.message?e.message:""}function P$t(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function D$t(e){const t=e.split("/");return t[t.length-1]??e}function M$t(e){const t=new Map;for(const n of e){const i=n.path.split("/"),r=i.length>1?i.slice(0,-1).join("/"):"";t.set(r,[...t.get(r)??[],n])}return Array.from(t,([n,i])=>({directory:n,files:i})).sort((n,i)=>n.directory?i.directory?n.directory.localeCompare(i.directory):1:-1)}function L$t({skill:e,onClose:t}){const{t:n}=Te("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),a=p.useId(),[l,c]=p.useState(null),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(0);p.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const w=i.current;return w&&!w.open&&w.showModal(),()=>{var k;w!=null&&w.open&&w.close(),(k=r.current)==null||k.focus()}},[]),p.useEffect(()=>{const w=new AbortController;return h(!0),g(""),c(null),d(""),A$t(e.id,w.signal).then(k=>{if(w.signal.aborted)return;c(k);const S=k.files.find(E=>E.path==="SKILL.md")??k.files[0];d((S==null?void 0:S.path)??"")}).catch(k=>{!w.signal.aborted&&!R$t(k)&&g(I$t(k))}).finally(()=>{w.signal.aborted||h(!1)}),()=>w.abort()},[b,e.id]);const y=p.useMemo(()=>M$t((l==null?void 0:l.files)??[]),[l]),x=(l==null?void 0:l.files.find(w=>w.path===u))??null,O=n(`codingAgents.skills.items.${e.id}.name`,{defaultValue:e.name});return o.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":a,onCancel:w=>{w.preventDefault(),t()},onMouseDown:w=>{const k=w.currentTarget.getBoundingClientRect();(w.clientXk.right||w.clientYk.bottom)&&t()},children:[o.jsxs("header",{className:"coding-agents-preview-header",children:[o.jsx("span",{className:"coding-agents-preview-mark",children:o.jsx(tne,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:s,children:O}),o.jsx("p",{id:a,children:n("codingAgents.preview.description")})]}),o.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:o.jsx(j$t,{})})]}),f?o.jsxs("div",{className:"coding-agents-preview-state",children:[o.jsx("i",{}),n("codingAgents.preview.loading")]}):m?o.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[o.jsx("span",{children:m||n("codingAgents.preview.error")}),o.jsx("button",{type:"button",onClick:()=>v(w=>w+1),children:n("codingAgents.retry")})]}):o.jsxs("div",{className:"coding-agents-preview-layout",children:[o.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:O}),children:[o.jsxs("div",{className:"coding-agents-preview-tree-title",children:[o.jsx("span",{children:n("codingAgents.preview.files")}),o.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),o.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(w=>w.directory?o.jsxs("details",{open:!0,children:[o.jsxs("summary",{children:[o.jsx(tne,{}),o.jsx("span",{children:w.directory})]}),o.jsx("div",{children:w.files.map(k=>o.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[o.jsx(ene,{}),o.jsx("span",{children:D$t(k.path)})]},k.path))})]},w.directory):w.files.map(k=>o.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[o.jsx(ene,{}),o.jsx("span",{children:k.path})]},k.path)))})]}),o.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:x?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("strong",{children:x.path}),o.jsx("span",{children:P$t(x.size)})]}),x.previewable&&x.content!==null?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:x.content})}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function $$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function F$t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function B$t(e){return o.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[o.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),o.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),o.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),o.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),o.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),o.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function U$t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),o.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function nne(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q$t(e){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function z$t({agentId:e}){return e==="trae"?o.jsx("img",{src:N$t,alt:"","aria-hidden":"true"}):e==="claude-code"?o.jsx(B$t,{}):o.jsx(U$t,{})}function ine(e){return e instanceof DOMException&&e.name==="AbortError"}function rne(e,t){return e instanceof Error&&e.message?e.message:t}function V$t({onBack:e}){var j;const{t}=Te("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[a,l]=p.useState(null),[c,u]=p.useState(0),[d,f]=p.useState(new Set),[h,m]=p.useState(new Set),[g,b]=p.useState(null),[v,y]=p.useState(!1),[x,O]=p.useState(null),w=p.useRef(null);p.useEffect(()=>{const A=new AbortController;return s(!0),l(null),T$t(A.signal).then(F=>{if(A.signal.aborted)return;i(F);const T=F.agents.filter(P=>P.available);f(P=>{const R=T.filter(L=>P.has(L.id));return new Set((R.length?R:T.slice(0,1)).map(L=>L.id))}),m(P=>{const R=F.skills.filter(L=>P.has(L.id));return new Set((R.length?R:F.skills).map(L=>L.id))})}).catch(F=>{!ine(F)&&!A.signal.aborted&&(i(null),l(rne(F,"")))}).finally(()=>{A.signal.aborted||s(!1)}),()=>A.abort()},[c]),p.useEffect(()=>()=>{var A;return(A=w.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,F)=>{!F||v||(O(null),f(T=>{const P=new Set(T);return P.has(A)?P.delete(A):P.add(A),P}))},N=A=>{v||(O(null),m(F=>{const T=new Set(F);return T.has(A)?T.delete(A):T.add(A),T}))},_=async()=>{var F;if(!E)return;(F=w.current)==null||F.abort();const A=new AbortController;w.current=A,y(!0),O(null);try{const T=await _$t({agents:k.map(R=>R.id),skills:S.map(R=>R.id)},A.signal);if(A.signal.aborted)return;const P=T.installations;O({tone:"success",agentCount:k.length,skillCount:S.length,installations:P})}catch(T){!ine(T)&&!A.signal.aborted&&O({tone:"error",message:rne(T,"")})}finally{w.current===A&&(w.current=null),A.signal.aborted||y(!1)}};return o.jsxs("section",{className:"coding-agents-page",children:[o.jsxs("header",{className:"coding-agents-header",children:[o.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:o.jsx($$t,{})}),o.jsx(F$t,{className:"coding-agents-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:t("codingAgents.title")}),o.jsx("p",{children:t("codingAgents.description")})]})]}),o.jsx("div",{className:"coding-agents-scroll",children:o.jsxs("div",{className:"coding-agents-content",children:[o.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[o.jsxs("div",{className:"coding-agents-section-heading",children:[o.jsxs("div",{children:[o.jsx("span",{children:"1"}),o.jsx("h2",{children:t("codingAgents.clients.title")})]}),o.jsx("button",{type:"button",onClick:()=>u(A=>A+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?o.jsxs("div",{className:"coding-agents-inline-state",children:[o.jsx("i",{}),t("codingAgents.clients.detecting")]}):a!==null?o.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[o.jsx("span",{children:a||t("codingAgents.errors.detect")}),o.jsx("button",{type:"button",onClick:()=>u(A=>A+1),children:t("codingAgents.retry")})]}):o.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(A=>o.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(A.id)?"is-selected":""}`,"aria-pressed":d.has(A.id),disabled:!A.available||v,onClick:()=>C(A.id,A.available),title:A.available?A.name:A.reason,children:[o.jsx("span",{className:`coding-agents-agent-mark is-${A.id}`,children:o.jsx(z$t,{agentId:A.id})}),o.jsxs("span",{className:"coding-agents-agent-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("small",{children:A.available?A.version||t("codingAgents.clients.detected"):A.reason})]}),o.jsx("span",{className:`coding-agents-status ${A.available?"is-ready":""}`,children:A.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),o.jsx("span",{className:"coding-agents-check",children:o.jsx(nne,{})})]},A.id))})]}),o.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[o.jsx("div",{className:"coding-agents-section-heading",children:o.jsxs("div",{children:[o.jsx("span",{children:"2"}),o.jsx("h2",{children:t("codingAgents.skills.title")})]})}),o.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(A=>o.jsxs("div",{className:`coding-agents-skill ${h.has(A.id)?"is-selected":""}`,children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:h.has(A.id),onChange:()=>N(A.id),disabled:v}),o.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:o.jsx(nne,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:t(`codingAgents.skills.items.${A.id}.name`,{defaultValue:A.name})}),o.jsx("small",{children:t(`codingAgents.skills.items.${A.id}.description`,{defaultValue:A.description})})]})]}),o.jsx("button",{type:"button",onClick:()=>b(A),children:t("codingAgents.skills.viewFiles")})]},A.id))}),o.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[o.jsxs("div",{className:"coding-agents-global-heading",children:[o.jsx(Q$t,{}),o.jsxs("div",{children:[o.jsx("strong",{children:t("codingAgents.global.title")}),o.jsx("span",{children:t("codingAgents.global.description")})]})]}),k.length?o.jsx("dl",{children:k.map(A=>o.jsxs("div",{children:[o.jsx("dt",{children:A.name}),o.jsx("dd",{children:A.globalSkillsPath})]},A.id))}):o.jsx("p",{children:t("codingAgents.global.empty")})]})]}),x?o.jsxs("div",{className:`coding-agents-result is-${x.tone}`,role:x.tone==="error"?"alert":"status",children:[o.jsx("strong",{children:x.tone==="success"?t("codingAgents.success",{agentCount:x.agentCount,skillCount:x.skillCount}):x.message||t("codingAgents.errors.configure")}),(j=x.installations)!=null&&j.length?o.jsx("ul",{children:x.installations.map(A=>o.jsxs("li",{children:[A.agentName," · ",t(`codingAgents.skills.items.${A.skillId}.name`,{defaultValue:A.skill})," → ",A.displayPath]},`${A.agent}:${A.skillId}`))}):null]}):null,o.jsxs("div",{className:"coding-agents-actions",children:[o.jsx("span",{children:k.length?t("codingAgents.selection",{agentCount:k.length,skillCount:S.length}):t("codingAgents.selectClient")}),o.jsx("button",{type:"button",onClick:()=>void _(),disabled:!E,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?o.jsx(L$t,{skill:g,onClose:()=>b(null)}):null]})}async function oz(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function H$t(e){const t=await An("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await oz(t,V("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function q$t(e){const t=await An("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await oz(t,V("websiteIntegration.createFailed"));return t.json()}async function W$t(e){const t=await An(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await oz(t,V("websiteIntegration.deleteFailed"))}function G$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function sne(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),o.jsx("path",{d:"M17 18.5a5 5 0 0 1 5-5h1.5a5 5 0 0 1 5 5V23a5 5 0 0 1-5 5H22l-3.5 2.5v-3.3A5 5 0 0 1 17 23v-4.5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),o.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function K$t(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function X$t(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await _x({nextToken:n||void 0,pageSize:100,region:"all",scope:"all"});if(e.aborted)return[];if(t.push(...r.runtimes),n=r.nextToken,!n)break}return t}function Y$t({onBack:e}){const{t,i18n:n}=Te("websiteIntegration"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,x]=p.useState(""),[O,w]=p.useState("");p.useEffect(()=>{const j=new AbortController;return g(!0),w(""),Promise.all([H$t(j.signal),X$t(j.signal)]).then(([A,F])=>{var P;if(j.signal.aborted)return;r(A),a(F),d(((P=A[0])==null?void 0:P.id)??"");const T=F[0];T&&c(`${T.region}::${T.runtimeId}`)}).catch(A=>{j.signal.aborted||w(A instanceof Error?A.message:t("errors.load"))}).finally(()=>{j.signal.aborted||g(!1)}),()=>j.abort()},[t]);const k=p.useMemo(()=>s.map(j=>({value:`${j.region}::${j.runtimeId}`,label:j.name||j.runtimeId,description:`${j.region} · ${j.status}`,runtime:j})),[s]),S=p.useMemo(()=>new Map(k.map(j=>[j.value,j.runtime])),[k]),E=i.find(j=>j.id===u)??i[0],C=E?` + From 08f4026fb3efb68fa9118492df1fc68e7208d279 Mon Sep 17 00:00:00 2001 From: "yanan.zhangyn" Date: Wed, 9 Sep 2026 15:47:49 +0800 Subject: [PATCH 2/4] fix(studio): handle invalid recovered MCP URLs --- ...enerated_agent_backend_codegen_extended.py | 69 +++++++++++++++++-- veadk/cli/cli_frontend.py | 24 +++---- 2 files changed, 75 insertions(+), 18 deletions(-) diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index dc7ed1a7d..f1d822ba9 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -1221,6 +1221,7 @@ async def fail_mcp_discovery(draft): ( "credential_storage", "tool_name", + "published_url", "edited_url", "expected_status", "expect_credential", @@ -1228,13 +1229,50 @@ async def fail_mcp_discovery(draft): "has_published_draft", ), [ - ("reference-env", "jvmdiag", "https://8.8.8.8/mcp", 200, True, False, True), - ("reference-env", "", "https://8.8.8.8/mcp", 200, True, False, True), - ("servers-json", "jvmdiag", "https://8.8.8.8/mcp", 200, True, False, True), - ("servers-json", "", "https://8.8.8.8/mcp", 200, True, False, True), + ( + "reference-env", + "jvmdiag", + "https://8.8.8.8/mcp", + "https://8.8.8.8/mcp", + 200, + True, + False, + True, + ), + ( + "reference-env", + "", + "https://8.8.8.8/mcp", + "https://8.8.8.8/mcp", + 200, + True, + False, + True, + ), + ( + "servers-json", + "jvmdiag", + "https://8.8.8.8/mcp", + "https://8.8.8.8/mcp", + 200, + True, + False, + True, + ), + ( + "servers-json", + "", + "https://8.8.8.8/mcp", + "https://8.8.8.8/mcp", + 200, + True, + False, + True, + ), ( "servers-json", "jvmdiag", + "https://8.8.8.8/mcp", "https://8.8.8.8/changed-mcp", 422, False, @@ -1244,6 +1282,7 @@ async def fail_mcp_discovery(draft): ( "servers-json", "", + "https://8.8.8.8/mcp", "https://8.8.8.8/changed-mcp", 200, True, @@ -1253,12 +1292,23 @@ async def fail_mcp_discovery(draft): ( "reference-env", "", + "https://8.8.8.8/mcp", "https://8.8.8.8/changed-mcp", 409, False, True, False, ), + ( + "reference-env", + "", + "https://8.8.8.8/mcp?legacy=1", + "https://8.8.8.8/changed-mcp", + 409, + False, + True, + True, + ), ], ) def test_generated_debug_applies_published_mcp_credential_contract_before_discovery( @@ -1266,6 +1316,7 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov tmp_path: Path, credential_storage: str, tool_name: str, + published_url: str, edited_url: str, expected_status: int, expect_credential: bool, @@ -1285,7 +1336,7 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov { "name": tool_name, "transport": "http", - "url": "https://8.8.8.8/mcp", + "url": published_url, "authTokenEnv": credential_reference, } ], @@ -1299,7 +1350,7 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov [ { "name": tool_name or "mcp", - "url": "https://8.8.8.8/mcp", + "url": published_url, "headers": {"Authorization": f"Bearer {credential_value}"}, } ] @@ -1398,6 +1449,12 @@ async def request(self, _method: str, url: str, **_kwargs: Any): ) assert response.status_code == expected_status, response.text + if expected_status != 200: + assert _FakeProcess.created == [] + if "?" in published_url: + assert "MCP 地址无效" in response.json()["detail"] + assert "LegacyRecoveryError" not in response.text + assert "错误 ID" not in response.text if expect_credential: assert captured_discovery_env[credential_reference] == credential_value else: diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 1380464c3..02a7cc124 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -5777,13 +5777,13 @@ async def _create_generated_agent_test_run(request: Request): runtime_region, error.code, ) - debug_mcp_env_values = retained_mcp_secret_values( - published_draft=published_draft, - edited_draft=edited_draft, - published_reference_values=published_reference_values, - ) - if reuse_requests: - try: + try: + debug_mcp_env_values = retained_mcp_secret_values( + published_draft=published_draft, + edited_draft=edited_draft, + published_reference_values=(published_reference_values), + ) + if reuse_requests: supplied_credentials = mcp_reuse_supplied_credentials( published_draft=published_draft, edited_draft=edited_draft, @@ -5796,11 +5796,11 @@ async def _create_generated_agent_test_run(request: Request): supplied_credentials=supplied_credentials, ) ) - except LegacyRecoveryError as error: - raise HTTPException( - status_code=409, - detail=_mcp_deployment_error_detail(error.code), - ) from error + except LegacyRecoveryError as error: + raise HTTPException( + status_code=409, + detail=_mcp_deployment_error_detail(error.code), + ) from error project, draft = await _generate_project_and_draft_from_request( data, From 47d3bc72fd5a7ef99bb8a7bbd28bc45c73e83b49 Mon Sep 17 00:00:00 2001 From: "yanan.zhangyn" Date: Wed, 9 Sep 2026 17:15:36 +0800 Subject: [PATCH 3/4] fix(studio): clarify MCP debug preflight failures --- .../harness-sidecar-release-gate.yaml | 5 + frontend/src/create/mcpAuth.ts | 2 +- frontend/src/i18n/resources/en-US/create.json | 2 +- frontend/src/i18n/resources/zh-CN/create.json | 2 +- frontend/tests/mcpAuth.test.mjs | 12 +- ...enerated_agent_backend_codegen_extended.py | 19 ++- tests/cli/test_generated_agent_mcp.py | 110 ++++++++++++++++-- veadk/cli/cli_frontend.py | 10 ++ veadk/cli/generated_agent_mcp.py | 83 +++++++++++-- .../{index-DZf0wXGZ.js => index-y89rQfXU.js} | 16 +-- ...Dx8z_oo1.js => CodeDiffEditor-B1zZ3C2s.js} | 2 +- ...CI.js => MarkdownPromptEditor-B5lw1jCi.js} | 2 +- .../{arc-CXEGKubz.js => arc-BmSNZeim.js} | 2 +- ...hannel-Cb_XsJlf.js => channel-CK3FNdKP.js} | 2 +- ...ex.es-BRzMxOGE.js => index.es-BwpKNMlY.js} | 2 +- ...n-nhrMhkEQ.js => jspdf.es.min-DYdURk6H.js} | 6 +- ...{linear-CeDfK4RZ.js => linear-FRN7TzCz.js} | 2 +- ...x3.js => abnfDiagram-N423BO3Z-DmJtql8p.js} | 2 +- ... architectureDiagram-T3A2C74G-BC0iLzBL.js} | 2 +- ...9.js => blockDiagram-VBNYF7ZC-wh52Ecel.js} | 2 +- ...7sdL.js => c4Diagram-5PPSVZJV-B9klRQ1P.js} | 2 +- ...CJwzhEYx.js => chunk-2GRJ4B5K-w7u93fzV.js} | 2 +- ...naaeokok.js => chunk-2Q5K7J3B-Df19aPp9.js} | 2 +- ...gjMuKq5U.js => chunk-5RXB4S5H-CziPj31s.js} | 2 +- ...CjM7JLQ8.js => chunk-5VM5RSS4-0VUj4cdX.js} | 2 +- ...D_idPgQl.js => chunk-6Q2QTUOP-BuYPTb-v.js} | 2 +- ...BsdMVsbj.js => chunk-GF5L2VYU-CdzaapU0.js} | 2 +- ...CWI15yjG.js => chunk-JWPE2WC7-s5uAWi9x.js} | 2 +- ...CNEAUy5I.js => chunk-KBJHAD2P-BwJsQpfI.js} | 2 +- ...DfwPULTh.js => chunk-RYQCIY6F-CvZ-mg4G.js} | 2 +- ...DWj8dVYC.js => chunk-XXDRQBXY-DF1LpnDY.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js | 1 - .../mermaid/classDiagram-JCYQIIEL-B86LdNwl.js | 1 + .../classDiagram-v2-OCEON4UE-B8-0NVyL.js | 1 - .../classDiagram-v2-OCEON4UE-B86LdNwl.js | 1 + ..._.js => cose-bilkent-JH36ORCC-BwttPwJa.js} | 2 +- ...p7f4c2.js => cynefin-OW5HDTMX-CfYIu5D_.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-h-hlAvXc.js} | 2 +- ...CoK1hzcv.js => dagre-VZM6K2ZE-Bh80CoKM.js} | 2 +- ...1XlXnp.js => diagram-7IWD3JNH-CHjc3YK7.js} | 2 +- ...-I7wkZ.js => diagram-B4RE2ZJO-Crk5VMXY.js} | 2 +- ...7527yu.js => diagram-LBJQPF4R-B24oG5BD.js} | 2 +- ...EXVUXN.js => diagram-Q27KOJAE-CHt3iGyV.js} | 2 +- ...O8qbf3.js => diagram-UB23O5K3-C0u56O7S.js} | 2 +- ...Gb.js => ebnfDiagram-BXEA7PRR-288CQcDu.js} | 2 +- ...pfV5.js => erDiagram-JOGREHBK-Ccaixrdp.js} | 2 +- ...C-.js => flowDiagram-UKHOOZJN-DmwC0ruo.js} | 2 +- ...n.js => ganttDiagram-PKOTCBZU-CDLstIj6.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-B7nKkelP.js} | 2 +- ...dZ.js => infoDiagram-6WML65LV-B7-q34pi.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-CEEbz2Rm.js} | 2 +- ...=> kanban-definition-27J2QSJJ-4S3DxCBE.js} | 2 +- ...e-DnksLuoJ.js => mermaid.core-Byx96n1y.js} | 8 +- ...> mindmap-definition-FAOFIHXS-N5zHU5MK.js} | 2 +- ...hvB.js => pegDiagram-VL7TDLO6-BOK0qG_k.js} | 2 +- ...Ad6.js => pieDiagram-7S7Q4E2Y-9it0uedZ.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS-CTiy7YiT.js} | 2 +- ...s => railroadDiagram-AXF67PYL-PGVg3Gs4.js} | 2 +- ...> requirementDiagram-LRYGKXZP-BEni_WUb.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-CmNhKWbi.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-ClGkLfJ7.js} | 2 +- ...cN.js => sizeCapture-X5ZJPWSS-C7Roe_yn.js} | 2 +- ...p.js => stateDiagram-OKZ733FA-BrlX_tes.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-BUH5KdnU.js | 1 + .../stateDiagram-v2-UEYNNEHI-DY-saesF.js | 1 - ..._Nns.js => swimlanes-SLNWSIFB-CR3Yx4nf.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-D8bBal3H.js | 8 -- .../swimlanesDiagram-ULZ7WXOC-DpcZasdm.js | 8 ++ ... timeline-definition-Z64GVDOM-Dq9PHz3C.js} | 2 +- ...e0.js => vennDiagram-T6HMQDX7-CYHQcSxC.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-Dkoo2yzf.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-CSukDV3q.js} | 2 +- veadk/webui/index.html | 2 +- veadk/webui/website-integration.js | 4 +- 75 files changed, 303 insertions(+), 108 deletions(-) rename veadk/webui/assets/app/{index-DZf0wXGZ.js => index-y89rQfXU.js} (98%) rename veadk/webui/assets/chunks/{CodeDiffEditor-Dx8z_oo1.js => CodeDiffEditor-B1zZ3C2s.js} (99%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-C4VlPACI.js => MarkdownPromptEditor-B5lw1jCi.js} (99%) rename veadk/webui/assets/chunks/{arc-CXEGKubz.js => arc-BmSNZeim.js} (98%) rename veadk/webui/assets/chunks/{channel-Cb_XsJlf.js => channel-CK3FNdKP.js} (53%) rename veadk/webui/assets/chunks/{index.es-BRzMxOGE.js => index.es-BwpKNMlY.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-nhrMhkEQ.js => jspdf.es.min-DYdURk6H.js} (99%) rename veadk/webui/assets/chunks/{linear-CeDfK4RZ.js => linear-FRN7TzCz.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-BCBAEFx3.js => abnfDiagram-N423BO3Z-DmJtql8p.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-Bqx-XTbw.js => architectureDiagram-T3A2C74G-BC0iLzBL.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-DdQPoes9.js => blockDiagram-VBNYF7ZC-wh52Ecel.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-Bra67sdL.js => c4Diagram-5PPSVZJV-B9klRQ1P.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-CJwzhEYx.js => chunk-2GRJ4B5K-w7u93fzV.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-naaeokok.js => chunk-2Q5K7J3B-Df19aPp9.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-gjMuKq5U.js => chunk-5RXB4S5H-CziPj31s.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-CjM7JLQ8.js => chunk-5VM5RSS4-0VUj4cdX.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-D_idPgQl.js => chunk-6Q2QTUOP-BuYPTb-v.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-BsdMVsbj.js => chunk-GF5L2VYU-CdzaapU0.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-CWI15yjG.js => chunk-JWPE2WC7-s5uAWi9x.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-CNEAUy5I.js => chunk-KBJHAD2P-BwJsQpfI.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-DfwPULTh.js => chunk-RYQCIY6F-CvZ-mg4G.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-DWj8dVYC.js => chunk-XXDRQBXY-DF1LpnDY.js} (53%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B86LdNwl.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B86LdNwl.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-GA0ao5B_.js => cose-bilkent-JH36ORCC-BwttPwJa.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-DAp7f4c2.js => cynefin-OW5HDTMX-CfYIu5D_.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-B1L5kWTo.js => cynefinDiagram-MW4NZA55-h-hlAvXc.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-CoK1hzcv.js => dagre-VZM6K2ZE-Bh80CoKM.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-SC1XlXnp.js => diagram-7IWD3JNH-CHjc3YK7.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-60-I7wkZ.js => diagram-B4RE2ZJO-Crk5VMXY.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-Du7527yu.js => diagram-LBJQPF4R-B24oG5BD.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-s-EXVUXN.js => diagram-Q27KOJAE-CHt3iGyV.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-BSO8qbf3.js => diagram-UB23O5K3-C0u56O7S.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-D1IH6bGb.js => ebnfDiagram-BXEA7PRR-288CQcDu.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-llttpfV5.js => erDiagram-JOGREHBK-Ccaixrdp.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-CvT_V9C-.js => flowDiagram-UKHOOZJN-DmwC0ruo.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-CuYQpRVn.js => ganttDiagram-PKOTCBZU-CDLstIj6.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-D9mrrxwi.js => gitGraphDiagram-DS77QQ5N-B7nKkelP.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-BdqavOdZ.js => infoDiagram-6WML65LV-B7-q34pi.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-C-ri3OTd.js => ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-DItBOT4l.js => journeyDiagram-NVQOT4AX-CEEbz2Rm.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-DwDU3r_E.js => kanban-definition-27J2QSJJ-4S3DxCBE.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-DnksLuoJ.js => mermaid.core-Byx96n1y.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-CgfY0Ls2.js => mindmap-definition-FAOFIHXS-N5zHU5MK.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-Reiw3hvB.js => pegDiagram-VL7TDLO6-BOK0qG_k.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-DnQbiAd6.js => pieDiagram-7S7Q4E2Y-9it0uedZ.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS-BHagSQYD.js => quadrantDiagram-CIZ2JOQS-CTiy7YiT.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-Biow3FMP.js => railroadDiagram-AXF67PYL-PGVg3Gs4.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-JYMpFkh0.js => requirementDiagram-LRYGKXZP-BEni_WUb.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-BF_iEz9u.js => sankeyDiagram-W5VNT64P-CmNhKWbi.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-Bqv2AfOc.js => sequenceDiagram-SI44F4Z6-ClGkLfJ7.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-XOPLWqcN.js => sizeCapture-X5ZJPWSS-C7Roe_yn.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-7KBZw4rp.js => stateDiagram-OKZ733FA-BrlX_tes.js} (96%) create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-BUH5KdnU.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-D1dh_Nns.js => swimlanes-SLNWSIFB-CR3Yx4nf.js} (99%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DpcZasdm.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-Dz8AxK7r.js => timeline-definition-Z64GVDOM-Dq9PHz3C.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-qZKAtDe0.js => vennDiagram-T6HMQDX7-CYHQcSxC.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-DvjwaJgh.js => wardleyDiagram-T6FBY63Y-Dkoo2yzf.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-DfWAA2AU.js => xychartDiagram-ELKLHX3M-CSukDV3q.js} (99%) diff --git a/.github/workflows/harness-sidecar-release-gate.yaml b/.github/workflows/harness-sidecar-release-gate.yaml index 2281be1b5..a0bf9762f 100644 --- a/.github/workflows/harness-sidecar-release-gate.yaml +++ b/.github/workflows/harness-sidecar-release-gate.yaml @@ -10,10 +10,12 @@ on: - 'tests/cli/test_managed_sidecar_source.py' - 'tests/cli/test_legacy_runtime_recovery.py' - 'tests/cli/test_generated_agent_backend_codegen_extended.py' + - 'tests/cli/test_generated_agent_mcp.py' - 'tests/cli/test_studio_rbac.py' - 'tests/extensions/harness/**' - 'tests/integrations/agentkit/test_app.py' - 'veadk/cli/generated_agent_codegen.py' + - 'veadk/cli/generated_agent_mcp.py' - 'veadk/cli/cli_frontend.py' - 'veadk/cli/managed_sidecar_source.py' - 'veadk/cli/legacy_runtime_recovery.py' @@ -28,10 +30,12 @@ on: - 'tests/cli/test_managed_sidecar_source.py' - 'tests/cli/test_legacy_runtime_recovery.py' - 'tests/cli/test_generated_agent_backend_codegen_extended.py' + - 'tests/cli/test_generated_agent_mcp.py' - 'tests/cli/test_studio_rbac.py' - 'tests/extensions/harness/**' - 'tests/integrations/agentkit/test_app.py' - 'veadk/cli/generated_agent_codegen.py' + - 'veadk/cli/generated_agent_mcp.py' - 'veadk/cli/cli_frontend.py' - 'veadk/cli/managed_sidecar_source.py' - 'veadk/cli/legacy_runtime_recovery.py' @@ -83,6 +87,7 @@ jobs: python -m pytest -q \ tests/cli/test_legacy_runtime_recovery.py -k 'six_case_ or changed_unnamed_mcp_url' python -m pytest -q \ + tests/cli/test_generated_agent_mcp.py \ tests/cli/test_generated_agent_backend_codegen_extended.py::test_generated_debug_applies_published_mcp_credential_contract_before_discovery \ tests/cli/test_studio_rbac.py::test_new_deployment_only_updates_non_default_instance_range \ tests/cli/test_studio_rbac.py::test_sidecar_deployment_uses_agentkit_cli_structured_release \ diff --git a/frontend/src/create/mcpAuth.ts b/frontend/src/create/mcpAuth.ts index f144dc1c3..506f70011 100644 --- a/frontend/src/create/mcpAuth.ts +++ b/frontend/src/create/mcpAuth.ts @@ -194,7 +194,7 @@ export function mcpUrlNeedsPathWarning(value: string): boolean { if (!value.trim()) return false; try { const path = new URL(value).pathname.replace(/\/+$/, ""); - return !path.endsWith("/mcp"); + return path === ""; } catch { return false; } diff --git a/frontend/src/i18n/resources/en-US/create.json b/frontend/src/i18n/resources/en-US/create.json index 11e7fe3e8..3f51a36ff 100644 --- a/frontend/src/i18n/resources/en-US/create.json +++ b/frontend/src/i18n/resources/en-US/create.json @@ -763,7 +763,7 @@ "removeTool": "Remove MCP tool", "namePlaceholder": "Name (optional)", "urlPlaceholder": "MCP service URL", - "pathWarning": "This address does not end with /mcp. Confirm that it is the complete MCP service URL.", + "pathWarning": "This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.", "configuredPlaceholder": "Authentication is stored securely", "tokenPlaceholder": "Bearer token (optional)", "changedUrlWarning": "The MCP address changed. Choose how to handle the stored authentication.", diff --git a/frontend/src/i18n/resources/zh-CN/create.json b/frontend/src/i18n/resources/zh-CN/create.json index 5cff99aaf..0a4b04aee 100644 --- a/frontend/src/i18n/resources/zh-CN/create.json +++ b/frontend/src/i18n/resources/zh-CN/create.json @@ -763,7 +763,7 @@ "removeTool": "删除 MCP 工具", "namePlaceholder": "名称(可选)", "urlPlaceholder": "MCP 服务地址", - "pathWarning": "此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。", + "pathWarning": "当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。", "configuredPlaceholder": "已安全保存认证信息", "tokenPlaceholder": "Bearer Token(可选)", "changedUrlWarning": "MCP 地址已变化,请确认如何处理已保存的认证信息。", diff --git a/frontend/tests/mcpAuth.test.mjs b/frontend/tests/mcpAuth.test.mjs index 2a809aa9e..85748f1b1 100644 --- a/frontend/tests/mcpAuth.test.mjs +++ b/frontend/tests/mcpAuth.test.mjs @@ -237,11 +237,11 @@ test("submits an explicit reuse decision for an unnamed MCP without inventing a ]); }); -test("describes the MCP suffix check instead of claiming every address has no path", () => { +test("describes the MCP root-path check without requiring a /mcp suffix", () => { for (const locale of ["zh-CN", "en-US"]) { const warning = createMessages[locale].traditional.mcp.pathWarning; - assert.match(warning, /\/mcp/); - assert.doesNotMatch(warning, /没有路径|has no path/i); + assert.match(warning, /根地址|root address/i); + assert.doesNotMatch(warning, /必须|must|\/mcp/i); } }); @@ -607,13 +607,15 @@ test("resolves new Sidecar MCP credentials from prior tool inputs only", () => { ); }); -test("warns about non-standard MCP paths without rewriting them", () => { +test("warns only for a gateway root and accepts custom MCP endpoint paths", () => { assert.equal(mcpUrlNeedsPathWarning("https://example.com/mcp"), false); assert.equal( mcpUrlNeedsPathWarning("https://example.com/gateway/mcp/?region=cn"), false, ); - assert.equal(mcpUrlNeedsPathWarning("https://example.com/custom-path"), true); + assert.equal(mcpUrlNeedsPathWarning("https://example.com/mysqldiag"), false); + assert.equal(mcpUrlNeedsPathWarning("https://example.com/athena-mcp"), false); + assert.equal(mcpUrlNeedsPathWarning("https://example.com/"), true); }); test("YAML export preserves MCP tokens as runtime environment values", () => { diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index f1d822ba9..48645a430 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -1274,7 +1274,17 @@ async def fail_mcp_discovery(draft): "jvmdiag", "https://8.8.8.8/mcp", "https://8.8.8.8/changed-mcp", - 422, + 409, + False, + False, + True, + ), + ( + "missing", + "", + "https://8.8.8.8/mysqldiag", + "https://8.8.8.8/mysqldiag", + 409, False, False, True, @@ -1357,6 +1367,8 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov ), ) ] + elif credential_storage == "missing": + runtime_envs = [] runtime = SimpleNamespace( runtime_id="runtime-debug-mcp", runtime_name="legacy-agent-runtime", @@ -1382,8 +1394,10 @@ def test_generated_debug_applies_published_mcp_credential_contract_before_discov ) captured_discovery_env: dict[str, str] = {} + discovery_calls: list[bool] = [] async def capture_mcp_discovery(draft, env_values=None): + discovery_calls.append(True) captured_discovery_env.update(env_values or {}) if not expect_credential: raise McpDebugConnectionError("changed MCP endpoint rejected") @@ -1451,6 +1465,7 @@ async def request(self, _method: str, url: str, **_kwargs: Any): assert response.status_code == expected_status, response.text if expected_status != 200: assert _FakeProcess.created == [] + assert bool(discovery_calls) is (expected_status in {200, 422}) if "?" in published_url: assert "MCP 地址无效" in response.json()["detail"] assert "LegacyRecoveryError" not in response.text @@ -1459,6 +1474,8 @@ async def request(self, _method: str, url: str, **_kwargs: Any): assert captured_discovery_env[credential_reference] == credential_value else: assert credential_reference not in captured_discovery_env + if credential_storage == "missing": + assert "缺少可用凭证" in response.json()["detail"] assert credential_value not in response.text diff --git a/tests/cli/test_generated_agent_mcp.py b/tests/cli/test_generated_agent_mcp.py index a07216ca1..4049662ae 100644 --- a/tests/cli/test_generated_agent_mcp.py +++ b/tests/cli/test_generated_agent_mcp.py @@ -16,6 +16,7 @@ from types import SimpleNamespace +import httpx import pytest from veadk.cli.generated_agent_codegen import AgentDraft, McpTool @@ -45,7 +46,7 @@ async def close(self) -> None: @pytest.mark.asyncio async def test_debug_mcp_keeps_configured_path_without_rewriting(monkeypatch) -> None: _FakeMcpToolset.attempted_urls = [] - _FakeMcpToolset.working_urls = {"https://mcp.example.com/custom-endpoint"} + _FakeMcpToolset.working_urls = {"https://mcp.example.com/mysqldiag"} monkeypatch.setattr( "veadk.cli.generated_agent_mcp.MCPToolset", _FakeMcpToolset, @@ -58,7 +59,7 @@ async def test_debug_mcp_keeps_configured_path_without_rewriting(monkeypatch) -> McpTool( name="sequentialthinking", transport="http", - url="https://mcp.example.com/custom-endpoint", + url="https://mcp.example.com/mysqldiag", authToken="secret-token", ) ], @@ -66,9 +67,9 @@ async def test_debug_mcp_keeps_configured_path_without_rewriting(monkeypatch) -> resolved = await resolve_debug_mcp_endpoints(draft) - assert _FakeMcpToolset.attempted_urls == ["https://mcp.example.com/custom-endpoint"] - assert resolved.mcpTools[0].url == "https://mcp.example.com/custom-endpoint" - assert draft.mcpTools[0].url == "https://mcp.example.com/custom-endpoint" + assert _FakeMcpToolset.attempted_urls == ["https://mcp.example.com/mysqldiag"] + assert resolved.mcpTools[0].url == "https://mcp.example.com/mysqldiag" + assert draft.mcpTools[0].url == "https://mcp.example.com/mysqldiag" @pytest.mark.asyncio @@ -128,7 +129,102 @@ async def test_debug_mcp_reports_discovery_failure_without_credentials( message = str(exc_info.value) assert "sequentialthinking" in message - assert "Streamable HTTP" in message - assert "MCP Endpoint" in message + assert "MCP 连接预检" in message + assert "Sidecar" in message assert "secret-token" not in message assert "Bearer" not in message + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("failure", "expected"), + [ + ("auth", "认证被服务拒绝"), + ("endpoint", "完整 Endpoint"), + ("rate_limit", "服务当前限流"), + ("upstream", "服务暂时不可用"), + ("timeout", "连接超时"), + ("network", "网络连接失败"), + ("protocol", "不符合 Streamable HTTP MCP 协议"), + ("empty", "未发现可用工具"), + ], +) +async def test_debug_mcp_classifies_failures_without_exposing_details( + monkeypatch, + failure: str, + expected: str, +) -> None: + request = httpx.Request("POST", "https://mcp.example.com/athena-mcp") + sensitive_marker = "private-debug-detail-marker" + + class FailingMcpToolset: + def __init__(self, *, connection_params) -> None: + del connection_params + + async def get_tools(self): + if failure == "auth": + response = httpx.Response(401, request=request, text=sensitive_marker) + raise httpx.HTTPStatusError( + sensitive_marker, + request=request, + response=response, + ) + if failure == "endpoint": + response = httpx.Response(404, request=request, text=sensitive_marker) + raise httpx.HTTPStatusError( + sensitive_marker, + request=request, + response=response, + ) + if failure == "rate_limit": + response = httpx.Response(429, request=request, text=sensitive_marker) + raise httpx.HTTPStatusError( + sensitive_marker, + request=request, + response=response, + ) + if failure == "upstream": + response = httpx.Response(503, request=request, text=sensitive_marker) + raise httpx.HTTPStatusError( + sensitive_marker, + request=request, + response=response, + ) + if failure == "timeout": + raise httpx.ReadTimeout(sensitive_marker, request=request) + if failure == "network": + raise httpx.ConnectError(sensitive_marker, request=request) + if failure == "protocol": + raise RuntimeError(sensitive_marker) + return [] + + async def close(self) -> None: + return None + + monkeypatch.setattr( + "veadk.cli.generated_agent_mcp.MCPToolset", + FailingMcpToolset, + ) + draft = AgentDraft( + name="demo-agent", + description="Demo agent", + instruction="Use the tool.", + mcpTools=[ + McpTool( + name="", + transport="http", + url="https://mcp.example.com/athena-mcp", + authToken="private-token-marker", + ) + ], + ) + + with pytest.raises(McpDebugConnectionError) as exc_info: + await resolve_debug_mcp_endpoints(draft) + + message = str(exc_info.value) + assert expected in message + assert "MCP 连接预检" in message + assert "Sidecar" in message + assert sensitive_marker not in message + assert "private-token-marker" not in message diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 02a7cc124..7894865b3 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -5801,6 +5801,16 @@ async def _create_generated_agent_test_run(request: Request): status_code=409, detail=_mcp_deployment_error_detail(error.code), ) from error + unresolved_references = set(stored_references).difference( + debug_mcp_env_values + ) + if unresolved_references: + raise HTTPException( + status_code=409, + detail=_mcp_deployment_error_detail( + "legacy_mcp_credential_missing" + ), + ) project, draft = await _generate_project_and_draft_from_request( data, diff --git a/veadk/cli/generated_agent_mcp.py b/veadk/cli/generated_agent_mcp.py index 137147c83..4e76ea693 100644 --- a/veadk/cli/generated_agent_mcp.py +++ b/veadk/cli/generated_agent_mcp.py @@ -17,7 +17,9 @@ from __future__ import annotations from contextlib import suppress +from typing import Iterator +import httpx from google.adk.tools.mcp_tool.mcp_session_manager import ( StreamableHTTPConnectionParams, ) @@ -30,6 +32,74 @@ class McpDebugConnectionError(ValueError): """Raised when a configured MCP server cannot expose tools for debugging.""" +class _McpNoToolsError(RuntimeError): + """Internal marker for an endpoint that completed discovery without tools.""" + + +def _error_tree(error: BaseException) -> Iterator[BaseException]: + pending = [error] + seen: set[int] = set() + while pending: + current = pending.pop() + marker = id(current) + if marker in seen: + continue + seen.add(marker) + yield current + grouped = getattr(current, "exceptions", ()) + if isinstance(grouped, tuple) and all( + isinstance(item, BaseException) for item in grouped + ): + pending.extend(grouped) + if current.__cause__ is not None: + pending.append(current.__cause__) + if current.__context__ is not None: + pending.append(current.__context__) + + +def _mcp_debug_failure_kind(error: BaseException) -> str: + failures = tuple(_error_tree(error)) + statuses = { + int(getattr(getattr(item, "response", None), "status_code", 0) or 0) + for item in failures + } + if statuses & {401, 403}: + return "auth" + if statuses & {404, 405, 410}: + return "endpoint" + if 429 in statuses: + return "rate_limit" + if any(500 <= status <= 599 for status in statuses): + return "upstream" + if any(isinstance(item, _McpNoToolsError) for item in failures): + return "empty" + if any(isinstance(item, httpx.TimeoutException) for item in failures): + return "timeout" + if any(isinstance(item, (httpx.NetworkError, OSError)) for item in failures): + return "network" + return "protocol" + + +def _mcp_debug_failure_detail(name: str, error: BaseException) -> str: + reason = { + "auth": "认证被服务拒绝。请确认 Token 与该 Endpoint 匹配。", + "endpoint": ( + "地址未提供可用的 Streamable HTTP MCP 服务。" + "请确认完整 Endpoint(包括业务路径)。" + ), + "rate_limit": "服务当前限流,请稍后重试。", + "upstream": "服务暂时不可用。请稍后重试,或检查 MCP 服务状态。", + "empty": "连接成功,但未发现可用工具。", + "timeout": "连接超时。请确认网络可达,并检查服务响应时间。", + "network": "网络连接失败。请确认域名、网络和 TLS 配置。", + "protocol": "服务响应不符合 Streamable HTTP MCP 协议。", + }[_mcp_debug_failure_kind(error)] + return ( + f"MCP 工具 `{name}` 连接失败:{reason}" + "调试环境尚未启动;该错误发生在 MCP 连接预检阶段,与 Sidecar 无关。" + ) + + async def _list_mcp_tools( tool: McpTool, url: str, @@ -49,7 +119,7 @@ async def _list_mcp_tools( try: tools = await toolset.get_tools() if not tools: - raise ConnectionError("MCP server returned no tools") + raise _McpNoToolsError finally: with suppress(Exception): await toolset.close() @@ -62,17 +132,12 @@ async def _resolve_http_mcp_tool( url = tool.url.strip() try: await _list_mcp_tools(tool, url, env_values) - except Exception: - pass + except Exception as error: + name = tool.name.strip() or "未命名 MCP" + raise McpDebugConnectionError(_mcp_debug_failure_detail(name, error)) from None else: return tool.model_copy(update={"url": url}) - name = tool.name.strip() or "未命名 MCP" - raise McpDebugConnectionError( - f"MCP 工具 `{name}` 连接失败:无法通过 Streamable HTTP 完成工具发现。" - "请确认 URL 指向实际 MCP Endpoint,并检查 Token。" - ) from None - async def resolve_debug_mcp_endpoints( draft: AgentDraft, diff --git a/veadk/webui/assets/app/index-DZf0wXGZ.js b/veadk/webui/assets/app/index-y89rQfXU.js similarity index 98% rename from veadk/webui/assets/app/index-DZf0wXGZ.js rename to veadk/webui/assets/app/index-y89rQfXU.js index a79c39397..96968fa01 100644 --- a/veadk/webui/assets/app/index-DZf0wXGZ.js +++ b/veadk/webui/assets/app/index-y89rQfXU.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-C4VlPACI.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Byx96n1y.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-B5lw1jCi.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); var IDe=Object.defineProperty;var lV=e=>{throw TypeError(e)};var PDe=(e,t,n)=>t in e?IDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ki=(e,t,n)=>PDe(e,typeof t!="symbol"?t+"":t,n),cV=(e,t,n)=>t.has(e)||lV("Cannot "+n);var uo=(e,t,n)=>(cV(e,t,"read from private field"),n?n.call(e):t.get(e)),uV=(e,t,n)=>t.has(e)?lV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jP=(e,t,n,i)=>(cV(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function DDe(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function px(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uie={exports:{}},vj={};/** * @license React * react-jsx-runtime.production.js @@ -20,7 +20,7 @@ Your goal is to understand the user's request accurately and provide clear, conc Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},lse={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},cse={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}}"}},use={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."}},dse={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"}},fse={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},hse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},pse={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"}}},mse={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"}},gse={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."}},bse={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"}},yse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},vse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},xse={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"}},wse={common:rse,yaml:sse,validation:ase,defaults:ose,helpers:lse,intelligentDeployment:cse,codePackage:use,buildCanvas:dse,intelligent:fse,projectLibrary:hse,modePicker:pse,promptEditor:mse,skills:gse,workflow:bse,workbench:yse,traditional:vse,template:xse},VDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:dse,codePackage:use,common:rse,default:wse,defaults:ose,helpers:lse,intelligent:fse,intelligentDeployment:cse,modePicker:pse,projectLibrary:hse,promptEditor:mse,skills:gse,template:xse,traditional:vse,validation:ase,workbench:yse,workflow:bse,yaml:sse},Symbol.toStringTag,{value:"Module"})),Ose={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"},Sse={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?"},kse={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Ese={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},Cse={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Tse={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"},Ase={all:"All"},_se={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"},Nse={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."},jse={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"},Rse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},Ise={daily:"Daily",once:"Once",weekly:"Weekly"},Pse={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Dse={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."},Mse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},HDe={actions:Ose,confirm:Sse,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},qDe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ose,confirm:Sse,default:HDe,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},Symbol.toStringTag,{value:"Module"})),Lse="Report an issue",$se="Description",Fse="Common issues",Bse="Cancel",Use="Done",Qse="Submit feedback",zse="Submitting…",Vse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},Hse={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"}},qse={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."},WDe={title:Lse,descriptionLabel:$se,commonIssues:Fse,cancel:Bse,done:Use,submit:Qse,submitting:zse,success:Vse,dialog:Hse,page:qse},GDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:Bse,commonIssues:Fse,default:WDe,descriptionLabel:$se,dialog:Hse,done:Use,page:qse,submit:Qse,submitting:zse,success:Vse,title:Lse},Symbol.toStringTag,{value:"Module"})),Wse={back:"Back",close:"Close"},Gse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Kse={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."},Xse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Yse={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"},Zse={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."},Jse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},eae={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},tae={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"},nae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},iae={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."},rae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},sae={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."},aae={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…"},oae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},lae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},cae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},uae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},dae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},fae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},hae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},pae={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"},mae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},gae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},bae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},KDe={common:Wse,optimization:Gse,projects:Kse,framework:Xse,state:Yse,task:Zse,verification:Jse,transfer:eae,validation:tae,duration:nae,expiry:iae,analysis:rae,activity:sae,artifact:aae,model:oae,upload:lae,deployment:cae,workspace:uae,actions:dae,capability:fae,conversation:hae,questions:pae,confirmation:mae,errors:gae,stopDialog:bae},XDe=Object.freeze(Object.defineProperty({__proto__:null,actions:dae,activity:sae,analysis:rae,artifact:aae,capability:fae,common:Wse,confirmation:mae,conversation:hae,default:KDe,deployment:cae,duration:nae,errors:gae,expiry:iae,framework:Xse,model:oae,optimization:Gse,projects:Kse,questions:pae,state:Yse,stopDialog:bae,task:Zse,transfer:eae,upload:lae,validation:tae,verification:Jse,workspace:uae},Symbol.toStringTag,{value:"Module"})),yae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},vae={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."}},xae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},wae={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"},Oae={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Sae={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"},kae={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"}},Eae={compactSelect:yae,featureNotice:vae,workspace:xae,mode:wae,agentPicker:Oae,skill:Sae,video:kae},YDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Oae,compactSelect:yae,default:Eae,featureNotice:vae,mode:wae,skill:Sae,video:kae,workspace:xae},Symbol.toStringTag,{value:"Module"})),Cae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Tae={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}}"},Aae={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"},_ae={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."}}},Nae={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"},jae={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"},Rae={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"},Iae={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"},Pae={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"}},Dae={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"},Mae={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"},Lae={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.`},lse={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},cse={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}}"}},use={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."}},dse={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"}},fse={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},hse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},pse={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"}}},mse={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"}},gse={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."}},bse={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"}},yse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},vse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},xse={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"}},wse={common:rse,yaml:sse,validation:ase,defaults:ose,helpers:lse,intelligentDeployment:cse,codePackage:use,buildCanvas:dse,intelligent:fse,projectLibrary:hse,modePicker:pse,promptEditor:mse,skills:gse,workflow:bse,workbench:yse,traditional:vse,template:xse},VDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:dse,codePackage:use,common:rse,default:wse,defaults:ose,helpers:lse,intelligent:fse,intelligentDeployment:cse,modePicker:pse,projectLibrary:hse,promptEditor:mse,skills:gse,template:xse,traditional:vse,validation:ase,workbench:yse,workflow:bse,yaml:sse},Symbol.toStringTag,{value:"Module"})),Ose={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"},Sse={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?"},kse={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Ese={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},Cse={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Tse={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"},Ase={all:"All"},_se={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"},Nse={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."},jse={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"},Rse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},Ise={daily:"Daily",once:"Once",weekly:"Weekly"},Pse={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Dse={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."},Mse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},HDe={actions:Ose,confirm:Sse,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},qDe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ose,confirm:Sse,default:HDe,detail:kse,drawer:Ese,duration:Cse,fields:Tse,filters:Ase,history:_se,notices:Nse,page:jse,schedule:Rse,scheduleTypes:Ise,status:Pse,validation:Dse,weekdays:Mse},Symbol.toStringTag,{value:"Module"})),Lse="Report an issue",$se="Description",Fse="Common issues",Bse="Cancel",Use="Done",Qse="Submit feedback",zse="Submitting…",Vse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},Hse={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"}},qse={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."},WDe={title:Lse,descriptionLabel:$se,commonIssues:Fse,cancel:Bse,done:Use,submit:Qse,submitting:zse,success:Vse,dialog:Hse,page:qse},GDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:Bse,commonIssues:Fse,default:WDe,descriptionLabel:$se,dialog:Hse,done:Use,page:qse,submit:Qse,submitting:zse,success:Vse,title:Lse},Symbol.toStringTag,{value:"Module"})),Wse={back:"Back",close:"Close"},Gse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Kse={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."},Xse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Yse={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"},Zse={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."},Jse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},eae={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},tae={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"},nae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},iae={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."},rae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},sae={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."},aae={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…"},oae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},lae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},cae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},uae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},dae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},fae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},hae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},pae={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"},mae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},gae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},bae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},KDe={common:Wse,optimization:Gse,projects:Kse,framework:Xse,state:Yse,task:Zse,verification:Jse,transfer:eae,validation:tae,duration:nae,expiry:iae,analysis:rae,activity:sae,artifact:aae,model:oae,upload:lae,deployment:cae,workspace:uae,actions:dae,capability:fae,conversation:hae,questions:pae,confirmation:mae,errors:gae,stopDialog:bae},XDe=Object.freeze(Object.defineProperty({__proto__:null,actions:dae,activity:sae,analysis:rae,artifact:aae,capability:fae,common:Wse,confirmation:mae,conversation:hae,default:KDe,deployment:cae,duration:nae,errors:gae,expiry:iae,framework:Xse,model:oae,optimization:Gse,projects:Kse,questions:pae,state:Yse,stopDialog:bae,task:Zse,transfer:eae,upload:lae,validation:tae,verification:Jse,workspace:uae},Symbol.toStringTag,{value:"Module"})),yae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},vae={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."}},xae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},wae={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"},Oae={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Sae={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"},kae={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"}},Eae={compactSelect:yae,featureNotice:vae,workspace:xae,mode:wae,agentPicker:Oae,skill:Sae,video:kae},YDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Oae,compactSelect:yae,default:Eae,featureNotice:vae,mode:wae,skill:Sae,video:kae,workspace:xae},Symbol.toStringTag,{value:"Module"})),Cae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Tae={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}}"},Aae={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"},_ae={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."}}},Nae={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"},jae={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"},Rae={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"},Iae={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"},Pae={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"}},Dae={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"},Mae={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"},Lae={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"}},$ae={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"}},Fae={common:Cae,tool:Tae,threads:Aae,permissions:_ae,workspace:Nae,approval:jae,composer:Rae,launch:Iae,session:Pae,agentDetails:Dae,agentWorkspace:Mae,handoff:Lae,commands:$ae},ZDe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Dae,agentWorkspace:Mae,approval:jae,commands:$ae,common:Cae,composer:Rae,default:Fae,handoff:Lae,launch:Iae,permissions:_ae,session:Pae,threads:Aae,tool:Tae,workspace:Nae},Symbol.toStringTag,{value:"Module"})),Bae={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."},Uae={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"},Qae={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},zae={cancel:"Cancel",close:"Close confirmation dialog"},JDe={login:Bae,authExpired:Uae,navbar:Qae,confirm:zae},eMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Uae,confirm:zae,default:JDe,login:Bae,navbar:Qae},Symbol.toStringTag,{value:"Module"})),Vae={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"}},Hae={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"},qae={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"},tMe={account:Vae,navigation:Hae,history:qae},nMe=Object.freeze(Object.defineProperty({__proto__:null,account:Vae,default:tMe,history:qae,navigation:Hae},Symbol.toStringTag,{value:"Module"})),Wae={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."},Gae={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Kae={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: @@ -38,7 +38,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},Ece={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Cce={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Tce={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 中声明已有入口。"}},Ace={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:"添加到最后"}},_ce={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},Nce={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},jce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Rce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Ice={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 中心暂无技能。"}},Pce={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}} 条连线"}},Dce={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Mce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Lce={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:"长期"}},$ce={common:wce,yaml:Oce,validation:Sce,defaults:kce,helpers:Ece,intelligentDeployment:Cce,codePackage:Tce,buildCanvas:Ace,intelligent:_ce,projectLibrary:Nce,modePicker:jce,promptEditor:Rce,skills:Ice,workflow:Pce,workbench:Dce,traditional:Mce,template:Lce},mMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Ace,codePackage:Tce,common:wce,default:$ce,defaults:kce,helpers:Ece,intelligent:_ce,intelligentDeployment:Cce,modePicker:jce,projectLibrary:Nce,promptEditor:Rce,skills:Ice,template:Lce,traditional:Mce,validation:Sce,workbench:Dce,workflow:Pce,yaml:Oce},Symbol.toStringTag,{value:"Module"})),Fce={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:"查看详情"},Bce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Uce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Qce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},zce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},Vce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},Hce={all:"全部"},qce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},Wce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},Gce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Kce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Xce={daily:"每天",once:"一次性",weekly:"每周"},Yce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Zce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Jce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},gMe={actions:Fce,confirm:Bce,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},bMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fce,confirm:Bce,default:gMe,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},Symbol.toStringTag,{value:"Module"})),eue="问题反馈",tue="问题描述",nue="常见问题",iue="取消",rue="完成",sue="提交反馈",aue="正在上报…",oue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},lue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},cue={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 团队,请注意隐私保护。"},yMe={title:eue,descriptionLabel:tue,commonIssues:nue,cancel:iue,done:rue,submit:sue,submitting:aue,success:oue,dialog:lue,page:cue},vMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:iue,commonIssues:nue,default:yMe,descriptionLabel:tue,dialog:lue,done:rue,page:cue,submit:sue,submitting:aue,success:oue,title:eue},Symbol.toStringTag,{value:"Module"})),uue={back:"返回",close:"关闭"},due={title:"优化迁移项目",closeAria:"关闭优化窗口"},fue={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},hue={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},pue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},mue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},gue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},bue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},yue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},vue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},xue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},wue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Oue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},Sue={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:"正在读取迁移产物…"},kue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Eue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},Cue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Tue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Aue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},_ue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Nue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},jue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Rue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Iue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Pue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},xMe={common:uue,optimization:due,projects:fue,framework:hue,state:pue,task:mue,verification:gue,transfer:bue,validation:yue,duration:vue,expiry:xue,analysis:wue,activity:Oue,artifact:Sue,model:kue,upload:Eue,deployment:Cue,workspace:Tue,actions:Aue,capability:_ue,conversation:Nue,questions:jue,confirmation:Rue,errors:Iue,stopDialog:Pue},wMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Aue,activity:Oue,analysis:wue,artifact:Sue,capability:_ue,common:uue,confirmation:Rue,conversation:Nue,default:xMe,deployment:Cue,duration:vue,errors:Iue,expiry:xue,framework:hue,model:kue,optimization:due,projects:fue,questions:jue,state:pue,stopDialog:Pue,task:mue,transfer:bue,upload:Eue,validation:yue,verification:gue,workspace:Tue},Symbol.toStringTag,{value:"Module"})),Due={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Mue={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Lue={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},$ue={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:"暂不可用"},Fue={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},Bue={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"},Uue={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}}秒"}},Que={compactSelect:Due,featureNotice:Mue,workspace:Lue,mode:$ue,agentPicker:Fue,skill:Bue,video:Uue},OMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Fue,compactSelect:Due,default:Que,featureNotice:Mue,mode:$ue,skill:Bue,video:Uue,workspace:Lue},Symbol.toStringTag,{value:"Module"})),zue={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Vue={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Hue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},que={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 自动审查流程处理审批请求。"}}},Wue={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Gue={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Kue={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:"发送"},Xue={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:"重新尝试"},Yue={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:"推理输出"}},Zue={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"},Jue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},ede={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Ece={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},Cce={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Tce={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 中声明已有入口。"}},Ace={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:"添加到最后"}},_ce={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},Nce={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},jce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Rce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Ice={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 中心暂无技能。"}},Pce={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}} 条连线"}},Dce={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Mce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Lce={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:"长期"}},$ce={common:wce,yaml:Oce,validation:Sce,defaults:kce,helpers:Ece,intelligentDeployment:Cce,codePackage:Tce,buildCanvas:Ace,intelligent:_ce,projectLibrary:Nce,modePicker:jce,promptEditor:Rce,skills:Ice,workflow:Pce,workbench:Dce,traditional:Mce,template:Lce},mMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Ace,codePackage:Tce,common:wce,default:$ce,defaults:kce,helpers:Ece,intelligent:_ce,intelligentDeployment:Cce,modePicker:jce,projectLibrary:Nce,promptEditor:Rce,skills:Ice,template:Lce,traditional:Mce,validation:Sce,workbench:Dce,workflow:Pce,yaml:Oce},Symbol.toStringTag,{value:"Module"})),Fce={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:"查看详情"},Bce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Uce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Qce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},zce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},Vce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},Hce={all:"全部"},qce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},Wce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},Gce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Kce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Xce={daily:"每天",once:"一次性",weekly:"每周"},Yce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Zce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Jce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},gMe={actions:Fce,confirm:Bce,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},bMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fce,confirm:Bce,default:gMe,detail:Uce,drawer:Qce,duration:zce,fields:Vce,filters:Hce,history:qce,notices:Wce,page:Gce,schedule:Kce,scheduleTypes:Xce,status:Yce,validation:Zce,weekdays:Jce},Symbol.toStringTag,{value:"Module"})),eue="问题反馈",tue="问题描述",nue="常见问题",iue="取消",rue="完成",sue="提交反馈",aue="正在上报…",oue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},lue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},cue={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 团队,请注意隐私保护。"},yMe={title:eue,descriptionLabel:tue,commonIssues:nue,cancel:iue,done:rue,submit:sue,submitting:aue,success:oue,dialog:lue,page:cue},vMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:iue,commonIssues:nue,default:yMe,descriptionLabel:tue,dialog:lue,done:rue,page:cue,submit:sue,submitting:aue,success:oue,title:eue},Symbol.toStringTag,{value:"Module"})),uue={back:"返回",close:"关闭"},due={title:"优化迁移项目",closeAria:"关闭优化窗口"},fue={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},hue={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},pue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},mue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},gue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},bue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},yue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},vue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},xue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},wue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Oue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},Sue={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:"正在读取迁移产物…"},kue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Eue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},Cue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Tue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Aue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},_ue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Nue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},jue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Rue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Iue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Pue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},xMe={common:uue,optimization:due,projects:fue,framework:hue,state:pue,task:mue,verification:gue,transfer:bue,validation:yue,duration:vue,expiry:xue,analysis:wue,activity:Oue,artifact:Sue,model:kue,upload:Eue,deployment:Cue,workspace:Tue,actions:Aue,capability:_ue,conversation:Nue,questions:jue,confirmation:Rue,errors:Iue,stopDialog:Pue},wMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Aue,activity:Oue,analysis:wue,artifact:Sue,capability:_ue,common:uue,confirmation:Rue,conversation:Nue,default:xMe,deployment:Cue,duration:vue,errors:Iue,expiry:xue,framework:hue,model:kue,optimization:due,projects:fue,questions:jue,state:pue,stopDialog:Pue,task:mue,transfer:bue,upload:Eue,validation:yue,verification:gue,workspace:Tue},Symbol.toStringTag,{value:"Module"})),Due={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Mue={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Lue={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},$ue={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:"暂不可用"},Fue={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},Bue={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"},Uue={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}}秒"}},Que={compactSelect:Due,featureNotice:Mue,workspace:Lue,mode:$ue,agentPicker:Fue,skill:Bue,video:Uue},OMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Fue,compactSelect:Due,default:Que,featureNotice:Mue,mode:$ue,skill:Bue,video:Uue,workspace:Lue},Symbol.toStringTag,{value:"Module"})),zue={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Vue={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Hue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},que={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 自动审查流程处理审批请求。"}}},Wue={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Gue={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Kue={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:"发送"},Xue={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:"重新尝试"},Yue={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:"推理输出"}},Zue={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"},Jue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},ede={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:"接力失败"}},tde={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 快捷命令"}},nde={common:zue,tool:Vue,threads:Hue,permissions:que,workspace:Wue,approval:Gue,composer:Kue,launch:Xue,session:Yue,agentDetails:Zue,agentWorkspace:Jue,handoff:ede,commands:tde},SMe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Zue,agentWorkspace:Jue,approval:Gue,commands:tde,common:zue,composer:Kue,default:nde,handoff:ede,launch:Xue,permissions:que,session:Yue,threads:Hue,tool:Vue,workspace:Wue},Symbol.toStringTag,{value:"Module"})),ide={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。保留所有权利。"},rde={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},sde={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},ade={cancel:"取消",close:"关闭确认框"},kMe={login:ide,authExpired:rde,navbar:sde,confirm:ade},EMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:rde,confirm:ade,default:kMe,login:ide,navbar:sde},Symbol.toStringTag,{value:"Module"})),ode={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},lde={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},cde={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},CMe={account:ode,navigation:lde,history:cde},TMe=Object.freeze(Object.defineProperty({__proto__:null,account:ode,default:CMe,history:cde,navigation:lde},Symbol.toStringTag,{value:"Module"})),ude={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},dde={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},fde={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: @@ -563,8 +563,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=R,U=L),M===void 0&&( `+s+w+`, `+v+"]"}return r.pop(),s=v,x}};const oxt={parse:ext,stringify:axt};var jEe=oxt;const lxt=2e5,cxt=new Set(["__proto__","constructor","prototype"]),uxt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function Bw(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wN(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&uxt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)wN(n,t+1);return}if(Bw(e))for(const[n,i]of Object.entries(e)){if(cxt.has(n))throw new Error("ECharts option contains an unsafe key");wN(i,t+1)}}function dxt(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 fxt(e,t){let n=1,i="",r=!1,s=!1,a=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(hxt),s=n[i],a=n[i+1]??!1;if(!Array.isArray(s)||typeof a!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:a}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:a}}function mxt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;llxt)throw new Error("ECharts option is too large");const n=gxt(dxt(e));let i;try{i=jEe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let QM;function yxt(){return QM??(QM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw QM=void 0,e})),QM}function vxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=bxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return yxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const xxt=p.memo(vxt);let IY,PY=Promise.resolve(),wxt=0;function Oxt(){return IY??(IY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DnksLuoJ.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))),IY}function Sxt(e){const t=PY.then(async()=>{const n=await Oxt(),i=`mermaid-diagram-${wxt+=1}`;return n.render(i,e)});return PY=t.then(()=>{},()=>{}),t}function kxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),Sxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const Ext=p.memo(kxt),Cxt="_SegmentedControl_1sl7d_1",Txt="_SegmentedControlOption_1sl7d_140",Axt="_SegmentedControlThumb_1sl7d_219",K6={SegmentedControl:Cxt,SegmentedControlOption:Txt,SegmentedControlThumb:Axt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);Cye({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||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(CWe,{ref:d,className:pi(K6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:K6.SegmentedControlThumb,ref:f}),n]})},_xt=({children:e,...t})=>o.jsx(jWe,{className:K6.SegmentedControlOption,...t,onPointerEnter:l7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=_xt;function Nxt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[a,l]=p.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const jxt=p.memo(Nxt);function Rxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const REe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function X6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(X6).join(""):p.isValidElement(e)?X6(e.props.children):""}function Ixt(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 Rxt(n==null?void 0:n.slice(9))}function IEe(e){if(!e)return!1;try{const t=e.toLowerCase();return REe.some(n=>t.includes(n))}catch{return!1}}function Pxt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(IEe(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 REe.some(s=>r.includes(s))}return!1}function Dxt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),[s,a]=p.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},m=h({children:f});if(m)return m}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Jft,{remarkPlugins:[fmt],rehypePlugins:n?[Gvt,hY]:[hY],components:{pre:({node:d,children:f,...h})=>{const m=Ixt(f);if(m==="mermaid"||m==="echarts"){const g=X6(f).replace(/\n$/,"");return o.jsx(jxt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(Ext,{source:g}):o.jsx(xxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(IEe(h)||Pxt(d))){const m=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(bbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=p.memo(Dxt);function zM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function PEe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Mxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Lxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function $xt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function Fxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx($xt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function Y6(e){return e instanceof DOMException&&e.name==="AbortError"}function Bxt(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 DEe=[".jpg",".jpeg",".png"].join(","),Uxt=new Set(DEe.split(",")),MEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Qxt=new Set(MEe.split(",")),zxt=200*1024*1024;function Z6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function Vxt(e,t,n){return e.size>zxt?n("knowledge.errors.fileTooLarge"):t==="image"?Uxt.has(Z6(e.name))?"":n("knowledge.errors.invalidImageType"):Qxt.has(Z6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function fU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function J6(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 Hxt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await hlt(x))}catch(O){m(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function qxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await plt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function LEe(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 Wxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState("{}"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(null),N=p.useRef(null),_=p.useRef(null),j=p.useRef(null),A=p.useRef(0),F=!!O;p.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=Vxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Z6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!m)return;let U;try{U=LEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await ylt(e.id,e.region,I),n()}else{const I=await vlt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else m&&(await xlt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===XOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(K+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(xn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?DEe:MEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:fU(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(xn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!m),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function Gxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=LEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await wlt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const $Ee=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),FEe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),BEe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Kxt=new Set(["pdf"]),Xxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Yxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Zxt=new Set(["error","failed","unavailable"]);function DY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Jxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(DY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=DY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function UEe(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 e1t(e){const t=UEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function t1t(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 $Ee.has(i)?"image":FEe.has(i)?"audio":BEe.has(i)?"video":Kxt.has(i)?"pdf":t||i?"file":"none"}function n1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Yxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Zxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=J6(e).toLocaleLowerCase();return i==="pdf"||Xxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:$Ee.has(i)||FEe.has(i)||BEe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function i1t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=UEe(e.attachmentUrl),s=t1t(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function r1t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(0),O=p.useRef(null),w=p.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?m(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await blt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!Y6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=e1t(a.url||t.url),S=n1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:fU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Jxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(i1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function s1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,x]=p.useState("overview"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(!0),[N,_]=p.useState(!1),[j,A]=p.useState(""),[F,T]=p.useState([]),[P,R]=p.useState(!1),[L,M]=p.useState(""),[U,I]=p.useState(""),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(!1),[le,se]=p.useState(!1),[re,ge]=p.useState(null),[W,X]=p.useState(null),[ae,ue]=p.useState(null),[Oe,ke]=p.useState(null),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),qe=p.useRef(0),Ae=p.useRef(0),ze=p.useRef([]),Ee=p.useRef(!1),De=p.useRef(!1),J=p.useRef(null),he=p.useRef(null),_e=p.useRef({}),Ze=p.useRef(!1),at=p.useRef(null),wt=p.useRef(null),Se=p.useRef(null),ve=p.useRef(null),He=p.useMemo(()=>[t],[t]),Je=p.useCallback(ye=>`${ye.region}\0${ye.id}`,[]),Ce=u.find(ye=>Je(ye)===b)??null,Wt=!!(Ce&&H===Je(Ce));p.useEffect(()=>{r==null||r(!!Ce)},[r,Ce]),p.useEffect(()=>{x("overview"),S("")},[b]);const ln=p.useMemo(()=>{const ye=O.trim().toLocaleLowerCase();return ye?u.filter(Ue=>[Ue.name,Ue.description,Ue.ownerLabel,Ue.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):u},[u,O]),cn=p.useMemo(()=>{const ye=k.trim().toLocaleLowerCase();return ye?F.filter(Ue=>[Ue.name,Ue.id,J6(Ue)].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):F},[k,F]);p.useEffect(()=>{X(null)},[Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Ot=p.useCallback(async(ye=!1)=>{var ft;if(ye&&(Ze.current||Object.keys(_e.current).length===0))return;(ft=J.current)==null||ft.abort();const Ue=new AbortController;J.current=Ue;const Ke=qe.current+1;qe.current=Ke,Ze.current=!0,ye?_(!0):C(!0),A(""),ye||g([]);try{const ut=await flt({regions:He,nextTokens:ye?_e.current:void 0,signal:Ue.signal});if(qe.current!==Ke)return;d(Rt=>ye?[...Rt,...ut.items.filter(zt=>!Rt.some(Z=>Je(Z)===Je(zt)))]:ut.items),_e.current=ut.nextTokens,h(ut.nextTokens);const Gt=ut.failures.map(({region:Rt,error:zt})=>`${xh(Rt,e)}: ${ho(zt,l("common.loadFailed"))}`);g(Rt=>ye?[...new Set([...Rt,...Gt])]:Gt),ye||v(Rt=>ut.items.some(zt=>Je(zt)===Rt)?Rt:"")}catch(ut){if(Y6(ut))return;qe.current===Ke&&(ye?g(Gt=>[...new Set([...Gt,ho(ut,l("knowledge.errors.loadMoreBases"))])]):A(ho(ut,l("knowledge.errors.loadBases"))))}finally{qe.current===Ke&&(Ze.current=!1,C(!1),_(!1))}},[Je,e,He,l]),jt=p.useCallback(async(ye,Ue=!1)=>{var ut;if(Ue&&Ee.current)return;(ut=he.current)==null||ut.abort();const Ke=new AbortController;he.current=Ke;const ft=Ae.current+1;Ae.current=ft,Ue||(ze.current=[],De.current=!1,T([]),q(!1),I("")),Ee.current=!0,R(!0),Ue?I(""):M("");try{const Gt=await glt(ye.id,{region:ye.region,offset:Ue?ze.current.length:0,signal:Ke.signal});if(Ae.current!==ft)return;K(Bt=>Bt===Je(ye)?"":Bt);const Rt=ze.current,zt=Ue?[...Rt,...Gt.items.filter(Bt=>!Bt.id||!Rt.some(Qe=>Qe.id===Bt.id))]:Gt.items,Z=Gt.hasMore&&(!Ue||zt.length>Rt.length);ze.current=zt,De.current=Z,T(zt),q(Z)}catch(Gt){if(Y6(Gt))return;Ae.current===ft&&(Gt instanceof HR&&Gt.errorCode===XOe&&(K(Je(ye)),ge(zt=>zt&&Je(zt)===Je(ye)?null:zt)),Ue?I(ho(Gt,l("knowledge.errors.loadMoreData"))):M(ho(Gt,l("knowledge.errors.loadData"))))}finally{Ae.current===ft&&(Ee.current=!1,R(!1))}},[Je,l]);p.useEffect(()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1,_e.current={},d([]),h({}),g([]),v(""),K(""),A(""),C(!0)},[e]),p.useEffect(()=>{if(n)return Ot(),()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1}},[n,i,Ot]),p.useEffect(()=>{var ye,Ue;if(!n){(ye=he.current)==null||ye.abort(),Ae.current+=1,Ee.current=!1;return}if(!Ce){(Ue=he.current)==null||Ue.abort(),Ae.current+=1,ze.current=[],Ee.current=!1,De.current=!1,T([]),q(!1),I("");return}return jt(Ce),()=>{var Ke;(Ke=he.current)==null||Ke.abort(),Ae.current+=1,Ee.current=!1}},[n,i,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const ot=n&&!Ce&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;p.useEffect(()=>{const ye=wt.current,Ue=at.current;if(!ye||!Ue||!ot)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ot(!0)},{root:Ue,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[ot,Ot]);const gt=()=>{const ye=at.current;!ye||!ot||ye.scrollHeight-ye.scrollTop-ye.clientHeight<=240&&Ot(!0)},Pe=!!(Ce&&F.length>0&&Q&&!P&&!U);p.useEffect(()=>{const ye=ve.current,Ue=Se.current;if(!Ce||!ye||!Ue||!Pe)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&jt(Ce,!0)},{root:Se.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[Pe,jt,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Et=()=>{const ye=Se.current;if(!Ce||!ye||!De.current||Ee.current||U)return;const{scrollHeight:Ue,scrollTop:Ke,clientHeight:ft}=ye;Ue-Ke-ft<=240&&jt(Ce,!0)},bt=ye=>{d(Ue=>Ue.map(Ke=>Je(Ke)===Je(ye)?ye:Ke))},Mt=async()=>{if(Oe){Ie(!0);try{await mlt(Oe.id,Oe.region),d(ye=>ye.filter(Ue=>Je(Ue)!==Je(Oe))),K(ye=>ye===Je(Oe)?"":ye),b===Je(Oe)&&v(""),ke(null)}catch(ye){A(ho(ye,l("knowledge.errors.deleteBase"))),ke(null)}finally{Ie(!1)}}},$e=async()=>{if(!(!Ce||!st)){Ie(!0);try{await Olt(Ce.id,st.id,Ce.region);const ye=ze.current.filter(Ue=>Ue.id!==st.id);ze.current=ye,T(ye),Le(null)}catch(ye){M(ho(ye,l("knowledge.errors.deleteDocument"))),Le(null)}finally{Ie(!1)}}};return o.jsxs("section",{className:`knowledge-library${Ce?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ce?o.jsx(uE,{className:"knowledge-library__detail",title:Ce.name,description:Ce.description||l("common.noDescription"),identitySeed:Ce.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(jB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:Ce.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ce.providerKnowledgeId,children:Ce.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:Ce.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:zM(Ce.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:Bxt(Ce.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Wt&&Ce.canManage?o.jsx("button",{type:"button",onClick:()=>ke(Ce),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void jt(Ce),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Lxt,{}),o.jsx("p",{children:l("knowledge.noData")}),Ce.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(Ce),children:l("knowledge.addFirstData")})]}):o.jsx(Rot,{rows:cn,rowKey:ye=>ye.id,rowLabel:ye=>ye.name||ye.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:ye=>o.jsx("span",{title:ye.name||ye.id,children:ye.name||ye.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:ye=>J6(ye)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:ye=>fU(ye.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ce.canManage?{label:l(Wt?"knowledge.associationInvalid":"knowledge.addData"),disabled:Wt,title:Wt?l("knowledge.providerMissing"):void 0,onClick:()=>ge(Ce)}:void 0,rowActions:ye=>[{label:l("common.preview"),onSelect:()=>X(ye)},...Ce.canManage?[{label:l("common.edit"),onSelect:()=>ue(ye)},{label:l("common.delete"),onSelect:()=>Le(ye),danger:!0}]:[]],scrollRef:Se,onScroll:Et,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void jt(Ce,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ve,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:Ce.canManage?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>ke(Ce),children:l("common.delete")}),o.jsx(Ht,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:ye=>w(ye.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:at,"aria-live":"polite",onScroll:gt,children:[m.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}):ln.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Mxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx(Fxt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),ln.map(ye=>o.jsx(pE,{className:"knowledge-card",title:ye.name,description:ye.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:zM(ye.ownerLabel),title:zM(ye.ownerLabel)},{label:l("knowledge.project"),value:ye.projectName||"default",title:ye.projectName||"default"}],action:{label:H===Je(ye)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!ye.canManage||H===Je(ye),title:ye.canManage?H===Je(ye)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(ye)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Je(ye))}},Je(ye)))]}),ot||N?o.jsx("div",{ref:wt,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ot?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(Hxt,{region:t,onClose:()=>ee(!1),onCreated:ye=>{d(Ue=>[ye,...Ue]),v(Je(ye)),ee(!1)}}),Ce&&le&&o.jsx(qxt,{item:Ce,onClose:()=>se(!1),onUpdated:ye=>{bt(ye),se(!1)}}),Ce&&W&&o.jsx(r1t,{base:Ce,item:W,onClose:()=>X(null)}),re&&o.jsx(Wxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:ye=>{K(Je(re)),Ce&&Je(Ce)===Je(re)&&M(ho(ye,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{Ce&&Je(Ce)===Je(re)&&jt(Ce),ge(null)}}),Ce&&ae&&o.jsx(Gxt,{base:Ce,item:ae,onClose:()=>ue(null),onUpdated:ye=>{const Ue=ze.current.map(Ke=>Ke.id===ye.id?ye:Ke);ze.current=Ue,T(Ue),ue(null)}}),Oe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:Oe.name}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>ke(null),onConfirm:()=>void Mt()}),st&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:st.name||st.id}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>Le(null),onConfirm:()=>void $e()})]})}const a1t="_EmptyMessage_1r5gu_1",o1t="_IconBadge_1r5gu_16",l1t="_Title_1r5gu_54",c1t="_Description_1r5gu_69",u1t="_ActionRow_1r5gu_77",kE={EmptyMessage:a1t,IconBadge:o1t,Title:l1t,Description:c1t,ActionRow:u1t},Cn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),d1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),f1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),h1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),p1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});Cn.Icon=d1t;Cn.Title=f1t;Cn.Description=h1t;Cn.ActionRow=p1t;const m1t="/web/skill-management";class g1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Uo(`${m1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function QEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new g1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await QEe(e,t);return e.json()}async function b1t(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function y1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function v1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function x1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function w1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function O1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function S1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function k1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function E1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await QEe(t,$t("helpers.skills.agentKitRequestFailed"));return t.json()}async function zEe(){return(await rI("/web/skill-spaces")).items||[]}async function VEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function C1t(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function T1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function A1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function _1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}an.hasResourceBundle("en-US","skills")||an.addResourceBundle("en-US","skills",eoe,!0,!0);an.hasResourceBundle("zh-CN","skills")||an.addResourceBundle("zh-CN","skills",bde,!0,!0);function Ut(e,t={}){return an.t(e,{...t,ns:"skills"})}const N1t="/web/skill-workbench";class e$ extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Ut("api.invalidFormat",{label:t}));return e}function MY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Ut("api.invalidFormat",{label:t}));return e.trim()}}function j1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Ut("api.invalidFormat",{label:Ut("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Uo(`${N1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function hU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Ut("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Ut("api.errorDetails")):r;return new e$(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])||Ut("api.missingContentType");return new e$(Ut("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await hU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Ut("api.missingContentType");throw new Error(Ut("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function R1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Ut("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(Ut("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Ut("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(Ut("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function I1t(e){if(e==null)return;const t=eu(e,Ut("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Ut("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(Ut("api.invalidFormat",{label:Ut("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Ut("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(Ut("api.unknownTaskState"));const r=MY(t.toolId,"Tool ID"),s=MY(t.sessionId,"Session ID"),a=j1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:R1t(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:I1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Ut("api.loadCapability")),Ut("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 P1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Ut("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Ut("api.startTask")))}async function D1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Ut("api.loadTask")))}async function VM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Ut("api.loadArtifact")),Ut("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(Ut("api.invalidFormat",{label:Ut("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Ut("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("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 HM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Ut("api.refine")))}async function M1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Ut("api.stop")))}async function L1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await hU(t,Ut("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Ut("api.nonNdjson"));if(!t.body)throw new Error(Ut("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Ut("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Ut("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=eu(d.error,Ut("api.publishError"));throw new e$(typeof m.message=="string"?m.message:Ut("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(Ut("api.unknownPublishEvent"));const f=eu(d.result,Ut("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"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Ut("api.streamEnded"));return r}async function $1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Ut("api.deleteTask"))}async function F1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await hU(r,Ut("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const B1t={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 U1t(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 Q1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function z1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function pU(e,t){if(Q1t(e))return U1t(t,e.path);if(z1t(e)){const n=B1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=pU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function V1t(e,t){const n=pU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const HEe=new Map;function s0(e,t){HEe.set(e,t)}function H1t(e){return HEe.get(e)}function q1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;spU(i,e.dataModel),resolveString:i=>V1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=H1t(r.component)??W1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function WEe(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 aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(Ebe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function mU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function GEe(e){var n,i,r,s;const t=mU(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 KEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function XEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?t0e(t,e.uri):""}function K1t({kind:e}){return e==="image"?o.jsx($F,{}):e==="video"?o.jsx(Tbe,{}):e==="pdf"?o.jsx(v7e,{}):o.jsx(MF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=mU(l.mimeType),u=XEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(j7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(K1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:GEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):KEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(bbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(X1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function X1t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>XEe(t,e),[e,t]),s=mU(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??i("media.attachment")}),o.jsxs("span",{children:[GEe(t),t.sizeBytes?` · ${KEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function LY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function Y1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function gU(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Z1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function J1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function ewt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function twt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function rwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function swt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function FY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function bU(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function awt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(xn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(bU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function kn(e){return typeof e=="string"?e:""}function BY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function t$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return kn(t.error)||kn(t.message)||kn(n==null?void 0:n.error)||kn(n==null?void 0:n.message)}function owt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=kn(t==null?void 0:t.source_type).toLowerCase(),i=kn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const YEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function lwt(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 cwt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function uwt(e,t=YEe){const n=t$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:kn(l.ref),kind:c,category:owt(l),name:kn(l.name)||kn(l.ref)||t.unnamedResource,description:kn(l.description),source:kn(l.source),version:kn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=kn(l.source),u=kn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:cwt(c),label:lwt(c,t),status:d,count:BY(l.count),message:kn(l.message),searchKeywords:Vc(l.search_keywords).map(kn).filter(Boolean)}]});return{collectionId:kn(n.collection_id),capabilities:{googleAdkVersion:kn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(kn).filter(Boolean),maxOrchestrationDepth:BY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function dwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function ZEe(e,t,n=YEe){const i=t$(e),r=t$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>kn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=kn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),m=kn(d.root_node),g=h.find(E=>kn(E.id)===m),b=h.filter(E=>kn(E.id)!==m).map(E=>({id:kn(E.id)||n.unnamedAgent,type:kn(E.type)||"llm",description:kn(E.description)})),v=s.get(f),y=kn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=UY(v==null?void 0:v.resources),w=O.length>0?O:UY(h.flatMap(E=>Vc(E.resources))),k=QY(v==null?void 0:v.python_tools),S=k.length>0?k:QY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:kn(v==null?void 0:v.description)||kn(g==null?void 0:g.description)||kn(d.task),task:kn(d.task),rootType:kn(v==null?void 0:v.root_type)||kn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:kn(v==null?void 0:v.output),error:kn(v==null?void 0:v.error)}});return{collectionId:kn(r.collection_id)||kn(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 fwt(e,t){return!!lI(t)||ZEe(e,t).failedCount>0}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=kn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:kn(i==null?void 0:i.name)||l[l.length-1]||r,description:kn(i==null?void 0:i.description),version:kn(i==null?void 0:i.version),source:kn(i==null?void 0:i.source)}]})}function QY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i==null?void 0:i.name),s=kn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:kn(i.description),code:s,entrypoint:kn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(kn).filter(Boolean)}])})}function hwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function pwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>gye(e,t,n),[e,t,n]),[a,l]=p.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(hwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(Ht,{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 JEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const yU={...Fb},zY={};function Ab(e,t){const n=p.useRef(zY);return n.current===zY&&(n.current=e(t)),n}const qM=yU.useInsertionEffect,mwt=qM&&qM!==yU.useLayoutEffect?qM:e=>e();function Xa(e){const t=Ab(gwt).current;return t.next=e,mwt(t.effect),t.trampoline}function gwt(){const e={next:void 0,callback:bwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function bwt(){}const ywt=()=>{},bl=typeof document<"u"?p.useLayoutEffect:ywt,eCe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function vwt(){return p.useContext(eCe)}function xwt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=p.useState(!1),l=Ab(Owt).current,c=Ab(wwt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),m()}),b=Xa(k=>{c.delete(k),m()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!Ewt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&tCe(_,j)>0){S.disconnect(),m();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=Swt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(eCe.Provider,{value:w,children:t})}function wwt(){return new Map}function Owt(){return new Set}function Swt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>tCe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function kwt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ewt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=Cwt("https://base-ui.com/production-error","Base UI"),nCe=p.createContext(void 0);function iCe(){const e=p.useContext(nCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(rCe).current;return Awt(r,e,t,n,i)&&sCe(r,[e,t,n,i]),r.callback}function Twt(e){const t=Ab(rCe).current;return _wt(t,e)&&sCe(t,e),t.callback}function rCe(){return{callback:null,cleanup:null,refs:[]}}function Awt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function _wt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function sCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function VY(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(jwt(19)?n==null?void 0:n.ref:t.ref)??null}function n$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Rwt=Object.freeze([]),Ry=Object.freeze({});function Iwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Pwt(e,t){return typeof e=="function"?e(t):e}function aCe(e,t){return typeof e=="function"?e(t):e}const vU={};function xU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Dwt(e){if(e.length===0)return vU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wU(e){return typeof e=="function"}function lCe(e,t){return wU(e)?e(t):e??vU}function $wt(e,t){return t?e?(...n)=>{const i=n[0];if(dCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:cCe(t):e}function cCe(e){return e&&((...t)=>{const n=t[0];return dCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function uCe(e,t){return t?e?t+" "+e:t:e}function dCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=Fwt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Qwt(e,i,r,s)}function Fwt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Pwt(n,s):void 0,f=u?aCe(i,s):void 0,h=u?Iwt(s,c):Ry,m=u&&l?Bwt(l):void 0,g=u?n$(h,m)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Twt([g.ref,VY(r),...a]):g.ref=ON(g.ref,VY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=uCe(g.className,d)),f!==void 0&&(g.style=n$(g.style,f)),g):Ry}function Bwt(e){return Array.isArray(e)?Dwt(e):xU(void 0,e)}const Uwt=Symbol.for("react.lazy");function Qwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=xU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Uwt&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return zwt(e,n);throw new Error(EE(8))}function zwt(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 Vwt={value:()=>null},fCe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[x,O]=JEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=p.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Vwt});return o.jsx(nCe.Provider,{value:S,children:o.jsx(xwt,{elementsRef:y,children:E})})});let HY=0;function Hwt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(HY+=1,i(`${t}-${HY}`))},[n,t]),r}const qY=yU.useId;function qwt(e,t){if(qY!==void 0){const n=qY();return`${t}-${n}`}return Hwt(e,t)}function i$(e){return qwt(e,"base-ui")}const Wwt="none",Gwt="trigger-press";function hCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Kwt(e){p.useEffect(e,Rwt)}const MT=null;let Xwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Xwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Ywt(){const e=Ab(Kl.create).current;return Kwt(e.disposeEffect),e}function Zwt(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Jwt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=JEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Zwt(s,!0,!0),d=i$(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=hCe(Gwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const pCe=p.createContext(void 0);function mCe(){const e=p.useContext(pCe);if(e===void 0)throw new Error(EE(15));return e}function eOt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=vwt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const gCe=p.createContext(void 0);function OU(){const e=p.useContext(gCe);if(e===void 0)throw new Error(EE(9));return e}let WY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const tOt={"data-starting-style":""},nOt={"data-ending-style":""},iOt={transitionStatus(e){return e==="starting"?tOt:e==="ending"?nOt:null}};let SU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=WY.startingStyle]="startingStyle",e[e.endingStyle=WY.endingStyle]="endingStyle",e}({}),rOt=function(e){return e.panelOpen="data-panel-open",e}({});const sOt={[SU.open]:""},aOt={[SU.closed]:""},oOt={open(e){return e?{[rOt.panelOpen]:""}:null}},lOt={open(e){return e?sOt:aOt}};let cOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const kU={...lOt,index:e=>({[cOt.index]:String(e)}),...iOt,value:()=>null},bCe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=eOt(),h=ON(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=iCe(),y=i$(),x=l??y,O=r||m,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Jwt({open:w,onOpenChange:k,disabled:O}),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]),N=p.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=i$(),[j,A]=p.useState(),F=j===null?void 0:j??_,T=p.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:kU});return o.jsx(pCe.Provider,{value:C,children:o.jsx(gCe.Provider,{value:T,children:P})})}),yCe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=OU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:kU})}),uOt=p.createContext(void 0);function dOt(e=!1){const t=p.useContext(uOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function fOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function WM(e,t,{detail:n=0}={}){e.dispatchEvent(new(yo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=dOt(!0),c=s??l!==void 0,{props:u}=fOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;GM(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=m;return xU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=GM(S),C=!r&&pOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),WM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),WM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&GM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),WM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function GM(e){return Kd(e)&&e.tagName==="BUTTON"}function pOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const vCe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=mCe(),g=i||m,{getButtonProps:b,buttonRef:v}=hOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=OU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:oOt})});function mOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function gOt(e){const t=Ab(bOt,e).current;return t.next=e,bl(t.effect),t}function bOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function yOt(e){return e==null?e:"current"in e?e.current:e}function xCe(e,t=!1){const n=Ywt();return Xa((i,r=null)=>{n.cancel();const s=yOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function vOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=xCe(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function xOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(K1),b=p.useRef(K1),v=p.useRef(!1),y=p.useRef(l),x=p.useRef(!1),[O,w]=p.useState(!1),k=p.useRef(null),S=ON(t,f),E=gOt(l),C=xCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),p.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=wOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const ee=OOt(U);if(T(F0(U)),!Q)return ee;const le=$T(U,"transition-duration","0s");return R(le),w(!0),ee}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),vOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),p.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function K(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(K,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),p.useEffect(function(){const I=f.current;if(!I)return;function H(K){const Q=hCe(Wwt,K);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return mOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[SU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wOt(e,t){const n=yo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&GY(n.animationDuration),r=GY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function GY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function OOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let KY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const wCe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=iCe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=mCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=xOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=OU(),L={...P,transitionStatus:F},M=aCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[KY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[KY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:kU});return A?U:null}),SOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=kOt(i,n.getBoundingClientRect()),s=EOt(i,r),a=COt(t.getBoundingClientRect());return AOt([...s,...a])};function kOt(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 EOt(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 COt(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 TOt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function AOt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),_Ot(t)}function _Ot(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const NOt="_Transition_1wdpp_1",jOt="_Popover_1wdpp_3",OCe={Transition:NOt,Popover:jOt},SCe=p.createContext(null),cI=()=>{const e=p.use(SCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=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);o7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=p.useCallback(E=>{x.current(E)},[x]),w=p.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,m,w,k]);return o.jsx(SCe,{value:S,children:o.jsx(pxe,{open:g,onOpenChange:O,modal:!1,children:r})})},ROt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(mxe,{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})},kCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=_ye(y),O=x[x.length-1];O==null||O.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(bxe,{forceMount:!0,ref:g,className:pi(OCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},IOt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=SOt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!TOt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=_ye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(kCe,{...e})},POt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(gxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:OCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(IOt,{...e},"popover-hover"):o.jsx(kCe,{...e},"popover"))})})};im.Trigger=ROt;im.Content=POt;const DOt=["skill_hub","skill_space","knowledge_base","tool"];function ECe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function CCe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function MOt(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 KM({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:MOt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function LOt({tools:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(fCe,{children:e.map((n,i)=>o.jsxs(bCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(yCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(vCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(ECe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(wCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function $Ot({agents:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function FOt({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(()=>uwt(e,i),[i,e]),s=p.useMemo(()=>DOt.map(c=>{const u=dwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(CCe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(fCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(bCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(yCe,{className:"create-agent-card__accordion-header",children:o.jsxs(vCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(ECe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(wCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function BOt({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(()=>ZEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(RB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(PB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Xxe,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(JFe,{"aria-hidden":"true"}),children:[o.jsx(KM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(LOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(t7e,{"aria-hidden":"true"}),children:o.jsx($Ot,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(CCe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const UOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:LY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:LY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:nwt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:rwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:swt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:FY},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:FY},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:Y1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:gU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Z1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:J1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:ewt},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:twt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:iwt,detailRenderer:FOt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:$Y,detailRenderer:BOt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:$Y,detailRenderer:pwt,hideHeader:!0}};function QOt(e){return UOt[e]}function TCe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function zOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function VOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function HOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function ACe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function XM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function qOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function WOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function _Ce(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function GOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function KOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function XOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const YOt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>sje),void 0)),ZOt=p.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-Dx8z_oo1.js"),[])),NCe="veadk-code-workspace-theme";function JOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function eSt(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 tSt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(NCe)==="dark"?"dark":"light"}catch{return"light"}}function nSt(e){return e===""?0:e.split(` +`||c==="\r")&&(s=!1);continue}if(a){c==="*"&&u==="/"&&(a=!1,l+=1);continue}if(i){r?r=!1:c==="\\"?r=!0:c===i&&(i="");continue}if(c==="/"&&u==="/"){s=!0,l+=1;continue}if(c==="/"&&u==="*"){a=!0,l+=1;continue}if(c==="'"||c==='"'){i=c;continue}const d=e.slice(l).match(n);if(d)return{index:l,openingIndex:l+d[0].lastIndexOf("("),type:d[1]==="LinearGradient"?"linear":"radial"}}}function gxt(e){let t=e,n=0;for(;;){const i=mxt(t,n);if(!i)return t;const r=fxt(t,i.openingIndex),s=t.slice(i.openingIndex+1,r),a=JSON.stringify(pxt(i.type,s));t=`${t.slice(0,i.index)}${a}${t.slice(r+1)}`,n=i.index+a.length}}function bxt(e,t=!1){if(e.length>lxt)throw new Error("ECharts option is too large");const n=gxt(dxt(e));let i;try{i=jEe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let QM;function yxt(){return QM??(QM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw QM=void 0,e})),QM}function vxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=bxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return yxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const xxt=p.memo(vxt);let IY,PY=Promise.resolve(),wxt=0;function Oxt(){return IY??(IY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Byx96n1y.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))),IY}function Sxt(e){const t=PY.then(async()=>{const n=await Oxt(),i=`mermaid-diagram-${wxt+=1}`;return n.render(i,e)});return PY=t.then(()=>{},()=>{}),t}function kxt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),Sxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(xn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const Ext=p.memo(kxt),Cxt="_SegmentedControl_1sl7d_1",Txt="_SegmentedControlOption_1sl7d_140",Axt="_SegmentedControlThumb_1sl7d_219",K6={SegmentedControl:Cxt,SegmentedControlOption:Txt,SegmentedControlThumb:Axt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);Cye({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||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(CWe,{ref:d,className:pi(K6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:K6.SegmentedControlThumb,ref:f}),n]})},_xt=({children:e,...t})=>o.jsx(jWe,{className:K6.SegmentedControlOption,...t,onPointerEnter:l7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=_xt;function Nxt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[a,l]=p.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const jxt=p.memo(Nxt);function Rxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const REe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function X6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(X6).join(""):p.isValidElement(e)?X6(e.props.children):""}function Ixt(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 Rxt(n==null?void 0:n.slice(9))}function IEe(e){if(!e)return!1;try{const t=e.toLowerCase();return REe.some(n=>t.includes(n))}catch{return!1}}function Pxt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(IEe(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 REe.some(s=>r.includes(s))}return!1}function Dxt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),[s,a]=p.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},m=h({children:f});if(m)return m}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Jft,{remarkPlugins:[fmt],rehypePlugins:n?[Gvt,hY]:[hY],components:{pre:({node:d,children:f,...h})=>{const m=Ixt(f);if(m==="mermaid"||m==="echarts"){const g=X6(f).replace(/\n$/,"");return o.jsx(jxt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(Ext,{source:g}):o.jsx(xxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(IEe(h)||Pxt(d))){const m=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(bbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=p.memo(Dxt);function zM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function PEe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Mxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Lxt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function $xt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function Fxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx($xt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function Y6(e){return e instanceof DOMException&&e.name==="AbortError"}function Bxt(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 DEe=[".jpg",".jpeg",".png"].join(","),Uxt=new Set(DEe.split(",")),MEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Qxt=new Set(MEe.split(",")),zxt=200*1024*1024;function Z6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function Vxt(e,t,n){return e.size>zxt?n("knowledge.errors.fileTooLarge"):t==="image"?Uxt.has(Z6(e.name))?"":n("knowledge.errors.invalidImageType"):Qxt.has(Z6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function fU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function J6(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 Hxt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await hlt(x))}catch(O){m(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function qxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await plt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function LEe(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 Wxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState("{}"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(null),N=p.useRef(null),_=p.useRef(null),j=p.useRef(null),A=p.useRef(0),F=!!O;p.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=Vxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Z6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!m)return;let U;try{U=LEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await ylt(e.id,e.region,I),n()}else{const I=await vlt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else m&&(await xlt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===XOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(K+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(xn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?DEe:MEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:fU(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(xn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!m),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function Gxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=LEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await wlt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const $Ee=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),FEe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),BEe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Kxt=new Set(["pdf"]),Xxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Yxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Zxt=new Set(["error","failed","unavailable"]);function DY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Jxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(DY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=DY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function UEe(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 e1t(e){const t=UEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function t1t(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 $Ee.has(i)?"image":FEe.has(i)?"audio":BEe.has(i)?"video":Kxt.has(i)?"pdf":t||i?"file":"none"}function n1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Yxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Zxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=J6(e).toLocaleLowerCase();return i==="pdf"||Xxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:$Ee.has(i)||FEe.has(i)||BEe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function i1t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=UEe(e.attachmentUrl),s=t1t(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function r1t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(0),O=p.useRef(null),w=p.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?m(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await blt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!Y6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=e1t(a.url||t.url),S=n1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:fU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Jxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(i1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(xn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function s1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,x]=p.useState("overview"),[O,w]=p.useState(""),[k,S]=p.useState(""),[E,C]=p.useState(!0),[N,_]=p.useState(!1),[j,A]=p.useState(""),[F,T]=p.useState([]),[P,R]=p.useState(!1),[L,M]=p.useState(""),[U,I]=p.useState(""),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(!1),[le,se]=p.useState(!1),[re,ge]=p.useState(null),[W,X]=p.useState(null),[ae,ue]=p.useState(null),[Oe,ke]=p.useState(null),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),qe=p.useRef(0),Ae=p.useRef(0),ze=p.useRef([]),Ee=p.useRef(!1),De=p.useRef(!1),J=p.useRef(null),he=p.useRef(null),_e=p.useRef({}),Ze=p.useRef(!1),at=p.useRef(null),wt=p.useRef(null),Se=p.useRef(null),ve=p.useRef(null),He=p.useMemo(()=>[t],[t]),Je=p.useCallback(ye=>`${ye.region}\0${ye.id}`,[]),Ce=u.find(ye=>Je(ye)===b)??null,Wt=!!(Ce&&H===Je(Ce));p.useEffect(()=>{r==null||r(!!Ce)},[r,Ce]),p.useEffect(()=>{x("overview"),S("")},[b]);const ln=p.useMemo(()=>{const ye=O.trim().toLocaleLowerCase();return ye?u.filter(Ue=>[Ue.name,Ue.description,Ue.ownerLabel,Ue.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):u},[u,O]),cn=p.useMemo(()=>{const ye=k.trim().toLocaleLowerCase();return ye?F.filter(Ue=>[Ue.name,Ue.id,J6(Ue)].some(Ke=>Ke.toLocaleLowerCase().includes(ye))):F},[k,F]);p.useEffect(()=>{X(null)},[Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Ot=p.useCallback(async(ye=!1)=>{var ft;if(ye&&(Ze.current||Object.keys(_e.current).length===0))return;(ft=J.current)==null||ft.abort();const Ue=new AbortController;J.current=Ue;const Ke=qe.current+1;qe.current=Ke,Ze.current=!0,ye?_(!0):C(!0),A(""),ye||g([]);try{const ut=await flt({regions:He,nextTokens:ye?_e.current:void 0,signal:Ue.signal});if(qe.current!==Ke)return;d(Rt=>ye?[...Rt,...ut.items.filter(zt=>!Rt.some(Z=>Je(Z)===Je(zt)))]:ut.items),_e.current=ut.nextTokens,h(ut.nextTokens);const Gt=ut.failures.map(({region:Rt,error:zt})=>`${xh(Rt,e)}: ${ho(zt,l("common.loadFailed"))}`);g(Rt=>ye?[...new Set([...Rt,...Gt])]:Gt),ye||v(Rt=>ut.items.some(zt=>Je(zt)===Rt)?Rt:"")}catch(ut){if(Y6(ut))return;qe.current===Ke&&(ye?g(Gt=>[...new Set([...Gt,ho(ut,l("knowledge.errors.loadMoreBases"))])]):A(ho(ut,l("knowledge.errors.loadBases"))))}finally{qe.current===Ke&&(Ze.current=!1,C(!1),_(!1))}},[Je,e,He,l]),jt=p.useCallback(async(ye,Ue=!1)=>{var ut;if(Ue&&Ee.current)return;(ut=he.current)==null||ut.abort();const Ke=new AbortController;he.current=Ke;const ft=Ae.current+1;Ae.current=ft,Ue||(ze.current=[],De.current=!1,T([]),q(!1),I("")),Ee.current=!0,R(!0),Ue?I(""):M("");try{const Gt=await glt(ye.id,{region:ye.region,offset:Ue?ze.current.length:0,signal:Ke.signal});if(Ae.current!==ft)return;K(Bt=>Bt===Je(ye)?"":Bt);const Rt=ze.current,zt=Ue?[...Rt,...Gt.items.filter(Bt=>!Bt.id||!Rt.some(Qe=>Qe.id===Bt.id))]:Gt.items,Z=Gt.hasMore&&(!Ue||zt.length>Rt.length);ze.current=zt,De.current=Z,T(zt),q(Z)}catch(Gt){if(Y6(Gt))return;Ae.current===ft&&(Gt instanceof HR&&Gt.errorCode===XOe&&(K(Je(ye)),ge(zt=>zt&&Je(zt)===Je(ye)?null:zt)),Ue?I(ho(Gt,l("knowledge.errors.loadMoreData"))):M(ho(Gt,l("knowledge.errors.loadData"))))}finally{Ae.current===ft&&(Ee.current=!1,R(!1))}},[Je,l]);p.useEffect(()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1,_e.current={},d([]),h({}),g([]),v(""),K(""),A(""),C(!0)},[e]),p.useEffect(()=>{if(n)return Ot(),()=>{var ye;(ye=J.current)==null||ye.abort(),qe.current+=1,Ze.current=!1}},[n,i,Ot]),p.useEffect(()=>{var ye,Ue;if(!n){(ye=he.current)==null||ye.abort(),Ae.current+=1,Ee.current=!1;return}if(!Ce){(Ue=he.current)==null||Ue.abort(),Ae.current+=1,ze.current=[],Ee.current=!1,De.current=!1,T([]),q(!1),I("");return}return jt(Ce),()=>{var Ke;(Ke=he.current)==null||Ke.abort(),Ae.current+=1,Ee.current=!1}},[n,i,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const ot=n&&!Ce&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;p.useEffect(()=>{const ye=wt.current,Ue=at.current;if(!ye||!Ue||!ot)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ot(!0)},{root:Ue,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[ot,Ot]);const gt=()=>{const ye=at.current;!ye||!ot||ye.scrollHeight-ye.scrollTop-ye.clientHeight<=240&&Ot(!0)},Pe=!!(Ce&&F.length>0&&Q&&!P&&!U);p.useEffect(()=>{const ye=ve.current,Ue=Se.current;if(!Ce||!ye||!Ue||!Pe)return;const Ke=new IntersectionObserver(([ft])=>{ft.isIntersecting&&jt(Ce,!0)},{root:Se.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(ye),()=>Ke.disconnect()},[Pe,jt,Ce==null?void 0:Ce.id,Ce==null?void 0:Ce.region]);const Et=()=>{const ye=Se.current;if(!Ce||!ye||!De.current||Ee.current||U)return;const{scrollHeight:Ue,scrollTop:Ke,clientHeight:ft}=ye;Ue-Ke-ft<=240&&jt(Ce,!0)},bt=ye=>{d(Ue=>Ue.map(Ke=>Je(Ke)===Je(ye)?ye:Ke))},Mt=async()=>{if(Oe){Ie(!0);try{await mlt(Oe.id,Oe.region),d(ye=>ye.filter(Ue=>Je(Ue)!==Je(Oe))),K(ye=>ye===Je(Oe)?"":ye),b===Je(Oe)&&v(""),ke(null)}catch(ye){A(ho(ye,l("knowledge.errors.deleteBase"))),ke(null)}finally{Ie(!1)}}},$e=async()=>{if(!(!Ce||!st)){Ie(!0);try{await Olt(Ce.id,st.id,Ce.region);const ye=ze.current.filter(Ue=>Ue.id!==st.id);ze.current=ye,T(ye),Le(null)}catch(ye){M(ho(ye,l("knowledge.errors.deleteDocument"))),Le(null)}finally{Ie(!1)}}};return o.jsxs("section",{className:`knowledge-library${Ce?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ce?o.jsx(uE,{className:"knowledge-library__detail",title:Ce.name,description:Ce.description||l("common.noDescription"),identitySeed:Ce.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(jB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:Ce.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ce.providerKnowledgeId,children:Ce.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:Ce.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:zM(Ce.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:Bxt(Ce.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Wt&&Ce.canManage?o.jsx("button",{type:"button",onClick:()=>ke(Ce),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void jt(Ce),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Lxt,{}),o.jsx("p",{children:l("knowledge.noData")}),Ce.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(Ce),children:l("knowledge.addFirstData")})]}):o.jsx(Rot,{rows:cn,rowKey:ye=>ye.id,rowLabel:ye=>ye.name||ye.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:ye=>o.jsx("span",{title:ye.name||ye.id,children:ye.name||ye.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:ye=>J6(ye)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:ye=>fU(ye.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ce.canManage?{label:l(Wt?"knowledge.associationInvalid":"knowledge.addData"),disabled:Wt,title:Wt?l("knowledge.providerMissing"):void 0,onClick:()=>ge(Ce)}:void 0,rowActions:ye=>[{label:l("common.preview"),onSelect:()=>X(ye)},...Ce.canManage?[{label:l("common.edit"),onSelect:()=>ue(ye)},{label:l("common.delete"),onSelect:()=>Le(ye),danger:!0}]:[]],scrollRef:Se,onScroll:Et,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void jt(Ce,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ve,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:Ce.canManage?o.jsxs(o.Fragment,{children:[o.jsx(Ht,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>ke(Ce),children:l("common.delete")}),o.jsx(Ht,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:ye=>w(ye.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:at,"aria-live":"polite",onScroll:gt,children:[m.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}):ln.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Mxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx(Fxt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),ln.map(ye=>o.jsx(pE,{className:"knowledge-card",title:ye.name,description:ye.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:zM(ye.ownerLabel),title:zM(ye.ownerLabel)},{label:l("knowledge.project"),value:ye.projectName||"default",title:ye.projectName||"default"}],action:{label:H===Je(ye)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!ye.canManage||H===Je(ye),title:ye.canManage?H===Je(ye)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(ye)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Je(ye))}},Je(ye)))]}),ot||N?o.jsx("div",{ref:wt,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ot?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(Hxt,{region:t,onClose:()=>ee(!1),onCreated:ye=>{d(Ue=>[ye,...Ue]),v(Je(ye)),ee(!1)}}),Ce&&le&&o.jsx(qxt,{item:Ce,onClose:()=>se(!1),onUpdated:ye=>{bt(ye),se(!1)}}),Ce&&W&&o.jsx(r1t,{base:Ce,item:W,onClose:()=>X(null)}),re&&o.jsx(Wxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:ye=>{K(Je(re)),Ce&&Je(Ce)===Je(re)&&M(ho(ye,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{Ce&&Je(Ce)===Je(re)&&jt(Ce),ge(null)}}),Ce&&ae&&o.jsx(Gxt,{base:Ce,item:ae,onClose:()=>ue(null),onUpdated:ye=>{const Ue=ze.current.map(Ke=>Ke.id===ye.id?ye:Ke);ze.current=Ue,T(Ue),ue(null)}}),Oe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:Oe.name}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>ke(null),onConfirm:()=>void Mt()}),st&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:st.name||st.id}),confirmLabel:l(Me?"common.deleting":"common.delete"),variant:"danger",busy:Me,onCancel:()=>Le(null),onConfirm:()=>void $e()})]})}const a1t="_EmptyMessage_1r5gu_1",o1t="_IconBadge_1r5gu_16",l1t="_Title_1r5gu_54",c1t="_Description_1r5gu_69",u1t="_ActionRow_1r5gu_77",kE={EmptyMessage:a1t,IconBadge:o1t,Title:l1t,Description:c1t,ActionRow:u1t},Cn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),d1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),f1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),h1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),p1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});Cn.Icon=d1t;Cn.Title=f1t;Cn.Description=h1t;Cn.ActionRow=p1t;const m1t="/web/skill-management";class g1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Uo(`${m1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function QEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new g1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await QEe(e,t);return e.json()}async function b1t(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function y1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function v1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function x1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function w1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function O1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function S1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function k1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function E1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await QEe(t,$t("helpers.skills.agentKitRequestFailed"));return t.json()}async function zEe(){return(await rI("/web/skill-spaces")).items||[]}async function VEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function C1t(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function T1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function A1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function _1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}an.hasResourceBundle("en-US","skills")||an.addResourceBundle("en-US","skills",eoe,!0,!0);an.hasResourceBundle("zh-CN","skills")||an.addResourceBundle("zh-CN","skills",bde,!0,!0);function Ut(e,t={}){return an.t(e,{...t,ns:"skills"})}const N1t="/web/skill-workbench";class e$ extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Ut("api.invalidFormat",{label:t}));return e}function MY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Ut("api.invalidFormat",{label:t}));return e.trim()}}function j1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Ut("api.invalidFormat",{label:Ut("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Uo(`${N1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function hU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Ut("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Ut("api.errorDetails")):r;return new e$(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])||Ut("api.missingContentType");return new e$(Ut("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await hU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Ut("api.missingContentType");throw new Error(Ut("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function R1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Ut("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(Ut("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Ut("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(Ut("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function I1t(e){if(e==null)return;const t=eu(e,Ut("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Ut("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(Ut("api.invalidFormat",{label:Ut("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Ut("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(Ut("api.unknownTaskState"));const r=MY(t.toolId,"Tool ID"),s=MY(t.sessionId,"Session ID"),a=j1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:R1t(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:I1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Ut("api.loadCapability")),Ut("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 P1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Ut("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Ut("api.startTask")))}async function D1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Ut("api.loadTask")))}async function VM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Ut("api.loadArtifact")),Ut("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(Ut("api.invalidFormat",{label:Ut("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Ut("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("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 HM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Ut("api.refine")))}async function M1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Ut("api.stop")))}async function L1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await hU(t,Ut("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Ut("api.nonNdjson"));if(!t.body)throw new Error(Ut("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Ut("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Ut("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=eu(d.error,Ut("api.publishError"));throw new e$(typeof m.message=="string"?m.message:Ut("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(Ut("api.unknownPublishEvent"));const f=eu(d.result,Ut("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"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Ut("api.invalidFormat",{label:Ut("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Ut("api.streamEnded"));return r}async function $1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Ut("api.deleteTask"))}async function F1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await hU(r,Ut("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const B1t={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 U1t(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 Q1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function z1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function pU(e,t){if(Q1t(e))return U1t(t,e.path);if(z1t(e)){const n=B1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=pU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function V1t(e,t){const n=pU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const HEe=new Map;function s0(e,t){HEe.set(e,t)}function H1t(e){return HEe.get(e)}function q1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;spU(i,e.dataModel),resolveString:i=>V1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=H1t(r.component)??W1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function WEe(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 aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(Ebe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function mU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function GEe(e){var n,i,r,s;const t=mU(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 KEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function XEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?t0e(t,e.uri):""}function K1t({kind:e}){return e==="image"?o.jsx($F,{}):e==="video"?o.jsx(Tbe,{}):e==="pdf"?o.jsx(v7e,{}):o.jsx(MF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=mU(l.mimeType),u=XEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(j7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(K1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:GEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):KEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(bbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(X1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function X1t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>XEe(t,e),[e,t]),s=mU(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??i("media.attachment")}),o.jsxs("span",{children:[GEe(t),t.sizeBytes?` · ${KEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function LY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function Y1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function gU(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Z1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function J1t(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function ewt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function twt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function rwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function swt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function FY(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function bU(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function awt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(xn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(bU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function kn(e){return typeof e=="string"?e:""}function BY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function t$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return kn(t.error)||kn(t.message)||kn(n==null?void 0:n.error)||kn(n==null?void 0:n.message)}function owt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=kn(t==null?void 0:t.source_type).toLowerCase(),i=kn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const YEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function lwt(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 cwt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function uwt(e,t=YEe){const n=t$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:kn(l.ref),kind:c,category:owt(l),name:kn(l.name)||kn(l.ref)||t.unnamedResource,description:kn(l.description),source:kn(l.source),version:kn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=kn(l.source),u=kn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:cwt(c),label:lwt(c,t),status:d,count:BY(l.count),message:kn(l.message),searchKeywords:Vc(l.search_keywords).map(kn).filter(Boolean)}]});return{collectionId:kn(n.collection_id),capabilities:{googleAdkVersion:kn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(kn).filter(Boolean),maxOrchestrationDepth:BY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function dwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function ZEe(e,t,n=YEe){const i=t$(e),r=t$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=kn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>kn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=kn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),m=kn(d.root_node),g=h.find(E=>kn(E.id)===m),b=h.filter(E=>kn(E.id)!==m).map(E=>({id:kn(E.id)||n.unnamedAgent,type:kn(E.type)||"llm",description:kn(E.description)})),v=s.get(f),y=kn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=UY(v==null?void 0:v.resources),w=O.length>0?O:UY(h.flatMap(E=>Vc(E.resources))),k=QY(v==null?void 0:v.python_tools),S=k.length>0?k:QY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:kn(v==null?void 0:v.description)||kn(g==null?void 0:g.description)||kn(d.task),task:kn(d.task),rootType:kn(v==null?void 0:v.root_type)||kn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:kn(v==null?void 0:v.output),error:kn(v==null?void 0:v.error)}});return{collectionId:kn(r.collection_id)||kn(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 fwt(e,t){return!!lI(t)||ZEe(e,t).failedCount>0}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=kn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:kn(i==null?void 0:i.name)||l[l.length-1]||r,description:kn(i==null?void 0:i.description),version:kn(i==null?void 0:i.version),source:kn(i==null?void 0:i.source)}]})}function QY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=kn(i==null?void 0:i.name),s=kn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:kn(i.description),code:s,entrypoint:kn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(kn).filter(Boolean)}])})}function hwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function pwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>gye(e,t,n),[e,t,n]),[a,l]=p.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(hwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(Ht,{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 JEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const yU={...Fb},zY={};function Ab(e,t){const n=p.useRef(zY);return n.current===zY&&(n.current=e(t)),n}const qM=yU.useInsertionEffect,mwt=qM&&qM!==yU.useLayoutEffect?qM:e=>e();function Xa(e){const t=Ab(gwt).current;return t.next=e,mwt(t.effect),t.trampoline}function gwt(){const e={next:void 0,callback:bwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function bwt(){}const ywt=()=>{},bl=typeof document<"u"?p.useLayoutEffect:ywt,eCe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function vwt(){return p.useContext(eCe)}function xwt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=p.useState(!1),l=Ab(Owt).current,c=Ab(wwt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),m()}),b=Xa(k=>{c.delete(k),m()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!Ewt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&tCe(_,j)>0){S.disconnect(),m();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=Swt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(eCe.Provider,{value:w,children:t})}function wwt(){return new Map}function Owt(){return new Set}function Swt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>tCe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function kwt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ewt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=Cwt("https://base-ui.com/production-error","Base UI"),nCe=p.createContext(void 0);function iCe(){const e=p.useContext(nCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(rCe).current;return Awt(r,e,t,n,i)&&sCe(r,[e,t,n,i]),r.callback}function Twt(e){const t=Ab(rCe).current;return _wt(t,e)&&sCe(t,e),t.callback}function rCe(){return{callback:null,cleanup:null,refs:[]}}function Awt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function _wt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function sCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function VY(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(jwt(19)?n==null?void 0:n.ref:t.ref)??null}function n$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Rwt=Object.freeze([]),Ry=Object.freeze({});function Iwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Pwt(e,t){return typeof e=="function"?e(t):e}function aCe(e,t){return typeof e=="function"?e(t):e}const vU={};function xU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Dwt(e){if(e.length===0)return vU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function wU(e){return typeof e=="function"}function lCe(e,t){return wU(e)?e(t):e??vU}function $wt(e,t){return t?e?(...n)=>{const i=n[0];if(dCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:cCe(t):e}function cCe(e){return e&&((...t)=>{const n=t[0];return dCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function uCe(e,t){return t?e?t+" "+e:t:e}function dCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=Fwt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Qwt(e,i,r,s)}function Fwt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Pwt(n,s):void 0,f=u?aCe(i,s):void 0,h=u?Iwt(s,c):Ry,m=u&&l?Bwt(l):void 0,g=u?n$(h,m)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Twt([g.ref,VY(r),...a]):g.ref=ON(g.ref,VY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=uCe(g.className,d)),f!==void 0&&(g.style=n$(g.style,f)),g):Ry}function Bwt(e){return Array.isArray(e)?Dwt(e):xU(void 0,e)}const Uwt=Symbol.for("react.lazy");function Qwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=xU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Uwt&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return zwt(e,n);throw new Error(EE(8))}function zwt(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 Vwt={value:()=>null},fCe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[x,O]=JEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=p.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Vwt});return o.jsx(nCe.Provider,{value:S,children:o.jsx(xwt,{elementsRef:y,children:E})})});let HY=0;function Hwt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(HY+=1,i(`${t}-${HY}`))},[n,t]),r}const qY=yU.useId;function qwt(e,t){if(qY!==void 0){const n=qY();return`${t}-${n}`}return Hwt(e,t)}function i$(e){return qwt(e,"base-ui")}const Wwt="none",Gwt="trigger-press";function hCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Kwt(e){p.useEffect(e,Rwt)}const MT=null;let Xwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Xwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Ywt(){const e=Ab(Kl.create).current;return Kwt(e.disposeEffect),e}function Zwt(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Jwt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=JEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Zwt(s,!0,!0),d=i$(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=hCe(Gwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const pCe=p.createContext(void 0);function mCe(){const e=p.useContext(pCe);if(e===void 0)throw new Error(EE(15));return e}function eOt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=vwt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const gCe=p.createContext(void 0);function OU(){const e=p.useContext(gCe);if(e===void 0)throw new Error(EE(9));return e}let WY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const tOt={"data-starting-style":""},nOt={"data-ending-style":""},iOt={transitionStatus(e){return e==="starting"?tOt:e==="ending"?nOt:null}};let SU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=WY.startingStyle]="startingStyle",e[e.endingStyle=WY.endingStyle]="endingStyle",e}({}),rOt=function(e){return e.panelOpen="data-panel-open",e}({});const sOt={[SU.open]:""},aOt={[SU.closed]:""},oOt={open(e){return e?{[rOt.panelOpen]:""}:null}},lOt={open(e){return e?sOt:aOt}};let cOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const kU={...lOt,index:e=>({[cOt.index]:String(e)}),...iOt,value:()=>null},bCe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=eOt(),h=ON(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=iCe(),y=i$(),x=l??y,O=r||m,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Jwt({open:w,onOpenChange:k,disabled:O}),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]),N=p.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=i$(),[j,A]=p.useState(),F=j===null?void 0:j??_,T=p.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:kU});return o.jsx(pCe.Provider,{value:C,children:o.jsx(gCe.Provider,{value:T,children:P})})}),yCe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=OU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:kU})}),uOt=p.createContext(void 0);function dOt(e=!1){const t=p.useContext(uOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function fOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function WM(e,t,{detail:n=0}={}){e.dispatchEvent(new(yo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=dOt(!0),c=s??l!==void 0,{props:u}=fOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;GM(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=m;return xU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=GM(S),C=!r&&pOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),WM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),WM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&GM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),WM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function GM(e){return Kd(e)&&e.tagName==="BUTTON"}function pOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const vCe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=mCe(),g=i||m,{getButtonProps:b,buttonRef:v}=hOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=OU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:oOt})});function mOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function gOt(e){const t=Ab(bOt,e).current;return t.next=e,bl(t.effect),t}function bOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function yOt(e){return e==null?e:"current"in e?e.current:e}function xCe(e,t=!1){const n=Ywt();return Xa((i,r=null)=>{n.cancel();const s=yOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function vOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=xCe(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function xOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(K1),b=p.useRef(K1),v=p.useRef(!1),y=p.useRef(l),x=p.useRef(!1),[O,w]=p.useState(!1),k=p.useRef(null),S=ON(t,f),E=gOt(l),C=xCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),p.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=wOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const ee=OOt(U);if(T(F0(U)),!Q)return ee;const le=$T(U,"transition-duration","0s");return R(le),w(!0),ee}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),vOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),p.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function K(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(K,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),p.useEffect(function(){const I=f.current;if(!I)return;function H(K){const Q=hCe(Wwt,K);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return mOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[SU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wOt(e,t){const n=yo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&GY(n.animationDuration),r=GY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function GY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function OOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let KY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const wCe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=iCe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=mCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=xOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=OU(),L={...P,transitionStatus:F},M=aCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[KY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[KY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:kU});return A?U:null}),SOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=kOt(i,n.getBoundingClientRect()),s=EOt(i,r),a=COt(t.getBoundingClientRect());return AOt([...s,...a])};function kOt(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 EOt(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 COt(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 TOt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function AOt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),_Ot(t)}function _Ot(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const NOt="_Transition_1wdpp_1",jOt="_Popover_1wdpp_3",OCe={Transition:NOt,Popover:jOt},SCe=p.createContext(null),cI=()=>{const e=p.use(SCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=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);o7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=p.useCallback(E=>{x.current(E)},[x]),w=p.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,m,w,k]);return o.jsx(SCe,{value:S,children:o.jsx(pxe,{open:g,onOpenChange:O,modal:!1,children:r})})},ROt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(mxe,{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})},kCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=_ye(y),O=x[x.length-1];O==null||O.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(bxe,{forceMount:!0,ref:g,className:pi(OCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},IOt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=SOt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!TOt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=_ye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(kCe,{...e})},POt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(gxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:OCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(IOt,{...e},"popover-hover"):o.jsx(kCe,{...e},"popover"))})})};im.Trigger=ROt;im.Content=POt;const DOt=["skill_hub","skill_space","knowledge_base","tool"];function ECe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function CCe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function MOt(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 KM({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:MOt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function LOt({tools:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(fCe,{children:e.map((n,i)=>o.jsxs(bCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(yCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(vCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(ECe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(wCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function $Ot({agents:e}){const{t}=Te("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function FOt({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(()=>uwt(e,i),[i,e]),s=p.useMemo(()=>DOt.map(c=>{const u=dwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(CCe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(fCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(bCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(yCe,{className:"create-agent-card__accordion-header",children:o.jsxs(vCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(ECe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(wCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function BOt({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(()=>ZEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(RB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(IB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(PB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Xxe,{"aria-hidden":"true"}),children:o.jsx(KM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(JFe,{"aria-hidden":"true"}),children:[o.jsx(KM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(LOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(t7e,{"aria-hidden":"true"}),children:o.jsx($Ot,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(CCe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const UOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:LY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:LY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:nwt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:rwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:swt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:FY},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:FY},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:Y1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:gU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:Z1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:J1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:ewt},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:twt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:iwt,detailRenderer:FOt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:$Y,detailRenderer:BOt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:$Y,detailRenderer:pwt,hideHeader:!0}};function QOt(e){return UOt[e]}function TCe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function zOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function VOt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function HOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function ACe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function XM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function qOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function WOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function _Ce(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function GOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function KOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function XOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const YOt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>sje),void 0)),ZOt=p.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-B1zZ3C2s.js"),[])),NCe="veadk-code-workspace-theme";function JOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function eSt(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 tSt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(NCe)==="dark"?"dark":"light"}catch{return"light"}}function nSt(e){return e===""?0:e.split(` `).length}function WS({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var F;const{t:a}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(tSt),m=p.useMemo(()=>s?HOt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(T=>({path:T.path,content:T.status==="deleted"?T.before:T.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(T=>[T.path,T.status])),[m]),[v,y]=p.useState(((F=g[0])==null?void 0:F.path)??null),[x,O]=p.useState(new Set),w=p.useMemo(()=>JOt(g),[g]),k=g.find(T=>T.path===v)??null,S=m.find(T=>T.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(NCe,f)}catch{}},[f]),p.useEffect(()=>{var L;if(!t)return;const T=document.body.style.overflow,P=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=u.current)==null||L.focus();const R=M=>{if(M.key==="Escape"){M.preventDefault(),d.current();return}if(M.key!=="Tab"||!c.current)return;const U=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(K=>K.offsetParent!==null);if(U.length===0)return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=T,window.removeEventListener("keydown",R),P!=null&&P.isConnected&&P.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(T){O(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}function C(T){return T?o.jsx("span",{className:`code-browser-change is-${T}`,children:a(`codeBrowser.change.${T}`)}):null}function N(T,P,R){return eSt(T,P===0).map(L=>{const M=R?`${R}/${L.name}`:L.name;if(!(L.children.size>0&&L.path===void 0)&&L.path){const H=b.get(L.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===L.path?" is-active":""}`,style:{paddingLeft:`${12+P*16}px`},onClick:()=>y(L.path??null),title:L.path,"aria-pressed":v===L.path,children:[o.jsx(XM,{}),o.jsx("span",{children:L.name}),C(H)]},M)}const I=x.has(M);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+P*16}px`},onClick:()=>E(M),"aria-expanded":!I,children:[o.jsx(WOt,{className:I?"":"is-open"}),o.jsx(qOt,{}),o.jsx("span",{children:L.name})]}),!I&&N(L,P+1,M)]},M)})}function _(T){!k||s||i({...e,files:e.files.map(P=>P.path===k.path?{...P,content:T}:P)})}const j=f==="light"?"dark":"light",A=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Li.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:T=>{T.target===T.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon",children:o.jsx(ACe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:a(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),o.jsx("p",{title:e.name,children:e.name||a("codeBrowser.projectFallback")})]})]}),o.jsxs("div",{className:"code-browser-head-actions",children:[o.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(j),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${j}`)}),children:f==="light"?o.jsx(KOt,{}):o.jsx(GOt,{})}),o.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":a("codeBrowser.closeWorkspace"),title:a("codeBrowser.close"),children:o.jsx(_Ce,{})})]})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":a(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:[o.jsx("span",{children:a(s?"codeBrowser.changes":"codeBrowser.files")}),o.jsx("span",{children:g.length})]}),o.jsx("div",{className:"code-browser-tree",children:g.length>0?N(w,0,""):o.jsx("div",{className:"code-browser-empty",children:A})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:k?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(XM,{}),o.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(XM,{}),o.jsx("span",{children:(k==null?void 0:k.path)??a("codeBrowser.noFileSelected")})]}),s?o.jsxs("div",{className:"code-browser-diff-labels","aria-label":a("codeBrowser.comparisonDirection"),children:[o.jsx("span",{children:s.baseLabel??a("codeBrowser.before")}),o.jsx("span",{children:s.targetLabel??a("codeBrowser.after")})]}):null,o.jsx("div",{className:"code-browser-editor",children:k?o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:S?o.jsx(ZOt,{before:S.before,after:S.after,path:S.path,theme:f}):o.jsx(YOt,{value:k.content,path:k.path,onChange:_,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:A})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:m.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:k?a("codeBrowser.lineCount",{count:nSt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function iSt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,a]=p.useState(!1),l=i??r("codeBrowser.viewSource");return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>a(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[o.jsx(ACe,{}),o.jsx("span",{children:l})]}),o.jsx(WS,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const jCe="send_a2ui_json_to_client",rSt=28,sSt=3e3;function aSt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function oSt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function RCe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),a=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=a.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(a.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=a.current;if(!b.startsWith(v)){a.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function lSt(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function cSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),o.jsx("path",{d:"M12 7h7.5"}),o.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),o.jsx("path",{d:"M12 13h7.5"}),o.jsx("path",{d:"M5 19h4"}),o.jsx("path",{d:"M12 19h7.5"})]})}function uSt(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),o.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function dSt({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?o.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>o.jsxs("div",{children:[o.jsx("dt",{children:i}),o.jsx("dd",{title:r,children:r})]},i))}):null}function fSt(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 ICe({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=Te("conversation"),[a,l]=p.useState(!(t||n)),c=p.useRef(!1);p.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(g=>g.replace(/[^\S\n]*\n[^\S\n]*/g,(b,v,y)=>{const x=y[v-1]??"",O=y[v+b.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` @@ -1058,15 +1058,15 @@ ${t}`}function Y9t(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(- `);return i>=0&&(n=n.slice(i+1)),{text:n,omitted:!0}}function Z9t(e,t,n=K9t){const i=X9t((e==null?void 0:e.text)??"",t.text??""),r=Y9t(i,n),s=r.text?r.text.split(` `).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||r.omitted);return{...t,text:r.text,lineCount:s,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}function J9t(e,t){const n=e.trim();if(!n)return t("githubCicd.repository");const i=n.match(/github\.com[:/](?[^/\s]+)\/(?[^/\s#?]+?)(?:\.git)?(?:[/?#].*)?$/);return i!=null&&i.groups?`${i.groups.owner}/${i.groups.repo}`:n}function W0(e){return e.trim()||"main"}function Tne(e,t){return e instanceof xO?e.detail:e instanceof Error?{message:e.message}:{message:String(e||t("githubCicd.syncFailed"))}}function eFt(e,t){return e.status==="cicd-bound"?t("githubCicd.status.mounted"):e.status==="bound"?t("githubCicd.status.bound"):e.status==="succeeded"?t("githubCicd.status.synced"):e.status||t("githubCicd.status.created")}function Ane(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6.2 3.8H4.3A1.8 1.8 0 0 0 2.5 5.6v6.1a1.8 1.8 0 0 0 1.8 1.8h6.1a1.8 1.8 0 0 0 1.8-1.8V9.8"}),o.jsx("path",{d:"M8.7 2.5h4.8v4.8"}),o.jsx("path",{d:"m13.1 2.9-6 6"})]})}function _ne(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"8",cy:"8",r:"5.5",stroke:"currentColor",strokeWidth:"1.7",opacity:"0.24"}),o.jsx("path",{d:"M13.5 8A5.5 5.5 0 0 0 8 2.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function tFt({hidden:e,...t}){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),o.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?o.jsx("path",{d:"m4 4 12 12"}):null]})}function nFt({project:e,region:t,cloudProvider:n,runtimeId:i,binding:r,disabled:s=!1,showSetup:a=!0,onPendingCicdChange:l,onBindingChange:c}){var W,X,ae;const{t:u}=Te("ui"),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState("main"),[v,y]=p.useState(""),[x,O]=p.useState(""),[w,k]=p.useState(""),[S,E]=p.useState("source"),[C,N]=p.useState(!1),[_,j]=p.useState(!1),[A,F]=p.useState(null),[T,P]=p.useState(null),[R,L]=p.useState(!1),[M,U]=p.useState(!1);p.useEffect(()=>{(r!=null&&r.pipelineId||r!=null&&r.runtimeId||r!=null&&r.status)&&F(r)},[r]),p.useEffect(()=>{let ue=!1;if(!i){F(null),c==null||c(null);return}return j(!0),M0e(i).then(Oe=>{ue||(F(Oe),c==null||c(Oe))}).catch(Oe=>{ue||P(Tne(Oe,u))}).finally(()=>{ue||j(!1)}),()=>{ue=!0}},[c,i,u]),p.useEffect(()=>{if(!l)return;if(i||S!=="cicd"||!a){l(null),L(!1);return}const ue=d.trim(),Oe=h.trim(),ke=v.trim(),st=x.trim();if(!ue||!Oe||!ke||!st||e.files.length===0){l(null),L(!1);return}l({githubUrl:ue,githubToken:h,baseBranch:W0(g),volcengineAccessKey:ke,volcengineSecretKey:x,volcengineSessionToken:w.trim(),pipelineId:A==null?void 0:A.pipelineId,cloudProvider:n})},[g,n,h,d,S,l,e.files.length,A==null?void 0:A.pipelineId,i,a,v,x,w]);const I=p.useMemo(()=>J9t(d,u),[d,u]),H=A==null?void 0:A.github,K=H!=null&&H.owner&&H.repo?`${H.owner}/${H.repo}`:(H==null?void 0:H.repo)??I,Q=(H==null?void 0:H.branch)??W0(g),q=A==null?void 0:A.runtimeId,B=S==="cicd",ee=n==="byteplus"?"BytePlus":u("githubCicd.volcengine"),le=!a&&!!i,se=a&&!s&&!C&&d.trim().length>0&&h.trim().length>0&&(B?v.trim().length>0&&x.trim().length>0&&(!!i||e.files.length>0):e.files.length>0),re=u(B?i?"githubCicd.mountDelivery":R?"githubCicd.selectedForDeployment":"githubCicd.mountOnDeploy":"githubCicd.syncCode");async function ge(ue){if(ue.preventDefault(),!!se){N(!0),F(null),P(null);try{if(B&&!i){l==null||l({githubUrl:d.trim(),githubToken:h,baseBranch:W0(g),volcengineAccessKey:v.trim(),volcengineSecretKey:x,volcengineSessionToken:w.trim(),cloudProvider:n}),L(!0);return}const Oe=B&&i?await P0e({githubUrl:d.trim(),githubToken:h,baseBranch:W0(g),runtimeName:e.name,runtimeId:i??"",region:t,cloudProvider:n,projectPath:".",volcengineAccessKey:v.trim(),volcengineSecretKey:x,volcengineSessionToken:w.trim()}):await I0e({project:e,githubUrl:d.trim(),githubToken:h,baseBranch:W0(g),region:t,cloudProvider:n}),ke=!B&&i&&Oe.pipelineId?await n7({pipelineId:Oe.pipelineId,runtimeId:i,region:t,cloudProvider:n}):Oe;F(ke),c==null||c(ke),B&&!i&&ke.pipelineId&&(l==null||l({githubUrl:d.trim(),githubToken:h,baseBranch:W0(g),volcengineAccessKey:v.trim(),volcengineSecretKey:x,volcengineSessionToken:w.trim(),pipelineId:ke.pipelineId,cloudProvider:n})),(!B||i)&&(m(""),y(""),O(""),k(""))}catch(Oe){P(Tne(Oe,u))}finally{N(!1)}}}return le&&!_&&!A?null:o.jsxs("section",{className:"pp-config-section pp-github-cicd",children:[o.jsxs("div",{className:"pp-config-label pp-github-cicd-title",children:[a?o.jsxs("div",{className:"pp-github-cicd-tabs",role:"tablist","aria-label":u("githubCicd.deliveryMode"),children:[o.jsx("button",{type:"button",className:S==="source"?"is-active":"",role:"tab","aria-selected":S==="source",onClick:()=>E("source"),children:u("githubCicd.sourceSync")}),o.jsx("button",{type:"button",role:"tab",className:S==="cicd"?"is-active":"","aria-selected":S==="cicd",onClick:()=>E("cicd"),children:u("githubCicd.mountDelivery")})]}):o.jsx("span",{children:u("githubCicd.delivery")}),(C||_)&&o.jsxs("span",{className:"pp-github-cicd-status",role:"status",children:[o.jsx(_ne,{className:"pp-ic spin"}),u(_?"githubCicd.loading":"githubCicd.running")]})]}),a&&o.jsx("p",{className:"pp-github-cicd-copy",children:u(B?i?"githubCicd.runtimeDeliveryHint":"githubCicd.initialDeliveryHint":"githubCicd.sourceSyncHint")}),a&&o.jsxs("form",{className:"pp-github-cicd-form",onSubmit:ge,children:[o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsx("span",{children:u("githubCicd.githubUrl")}),o.jsx("input",{value:d,placeholder:"https://github.com/org/repo",disabled:s||C,autoComplete:"off",onChange:ue=>{L(!1),f(ue.currentTarget.value)}})]}),o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsxs("span",{className:"pp-github-token-label-row",children:[o.jsx("span",{children:u("githubCicd.token")}),o.jsxs("a",{href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Sync%20AgentKit%20Studio%20source&contents=write",target:"_blank",rel:"noreferrer",children:[u("githubCicd.getToken"),o.jsx(Ane,{className:"pp-ic"})]})]}),o.jsxs("span",{className:"pp-github-token-input",children:[o.jsx("input",{type:M?"text":"password",value:h,placeholder:u("githubCicd.tokenPlaceholder"),disabled:s||C,autoComplete:"off","aria-describedby":"pp-github-token-help",onChange:ue=>{L(!1),m(ue.currentTarget.value)}}),o.jsx("button",{type:"button",disabled:s||C,onClick:()=>U(ue=>!ue),"aria-label":u(M?"githubCicd.hideToken":"githubCicd.showToken"),title:u(M?"githubCicd.hideToken":"githubCicd.showToken"),children:o.jsx(tFt,{hidden:!M})})]}),o.jsx("small",{id:"pp-github-token-help",className:"pp-github-token-help",children:u("githubCicd.tokenHelp")})]}),o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsx("span",{children:u("githubCicd.targetBranch")}),o.jsx("input",{value:g,placeholder:"main",disabled:s||C,autoComplete:"off",onChange:ue=>{L(!1),b(ue.currentTarget.value)}})]}),B&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsxs("span",{children:[ee," AK"]}),o.jsx("input",{type:"password",value:v,placeholder:u("githubCicd.actionsSecretPlaceholder"),disabled:s||C,autoComplete:"off",onChange:ue=>{L(!1),y(ue.currentTarget.value)}})]}),o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsxs("span",{children:[ee," SK"]}),o.jsx("input",{type:"password",value:x,placeholder:u("githubCicd.actionsSecretPlaceholder"),disabled:s||C,autoComplete:"off",onChange:ue=>{L(!1),O(ue.currentTarget.value)}})]}),o.jsxs("label",{className:"pp-github-cicd-field",children:[o.jsx("span",{children:u("githubCicd.sessionToken",{provider:ee})}),o.jsx("input",{type:"password",value:w,placeholder:u("githubCicd.sessionTokenPlaceholder"),disabled:s||C,autoComplete:"off",onChange:ue=>{L(!1),k(ue.currentTarget.value)}})]})]}),o.jsx("button",{type:"submit",className:"pp-github-cicd-submit",disabled:!se,children:C?o.jsxs(o.Fragment,{children:[o.jsx(_ne,{className:"pp-ic spin"}),u("githubCicd.syncing")]}):re})]}),R&&!A&&o.jsx("p",{className:"pp-github-cicd-bound-note",children:u("githubCicd.pendingHint")}),A&&o.jsxs("div",{className:"pp-github-cicd-result",role:"status",children:[o.jsxs("div",{className:"pp-github-cicd-result-head",children:[o.jsx("strong",{children:(W=A.cicd)!=null&&W.enabled?A.runtimeId?u("githubCicd.result.deliveryMounted"):u("githubCicd.result.deliverySelected"):u(q?"githubCicd.result.githubBound":"githubCicd.result.codeSynced")}),o.jsx("span",{children:eFt(A,u)})]}),o.jsxs("dl",{className:"pp-github-cicd-result-grid",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.repository")}),o.jsx("dd",{children:K})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.branch")}),o.jsx("dd",{children:Q})]}),q&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.runtime")}),o.jsx("dd",{children:q})]}),(H==null?void 0:H.commitSha)&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.commit")}),o.jsx("dd",{children:H.commitSha.slice(0,12)})]}),((X=A.cicd)==null?void 0:X.workflowPath)&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.workflow")}),o.jsx("dd",{children:A.cicd.workflowPath})]})]}),o.jsx("div",{className:"pp-github-cicd-links",children:(H==null?void 0:H.pullRequestUrl)&&o.jsxs("a",{href:H.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(Ane,{className:"pp-ic"}),u("githubCicd.viewPr")]})}),q&&o.jsx("p",{className:"pp-github-cicd-bound-note",children:(ae=A.cicd)!=null&&ae.enabled?u("githubCicd.result.deliveryHint"):u("githubCicd.result.boundHint")})]}),T&&o.jsxs("div",{className:"pp-github-cicd-error",role:"alert",children:[o.jsx("strong",{children:u("githubCicd.createFailed")}),o.jsx("p",{children:T.message}),(T.phase||T.runtimeId||T.logPath)&&o.jsxs("dl",{children:[T.phase&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.phase")}),o.jsx("dd",{children:T.phase})]}),T.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.runtime")}),o.jsx("dd",{children:T.runtimeId})]}),T.logPath&&o.jsxs("div",{children:[o.jsx("dt",{children:u("githubCicd.log")}),o.jsx("dd",{children:T.logPath})]})]})]})]})}xo.registerLanguage("python",Oke);xo.registerLanguage("typescript",Pke);xo.registerLanguage("javascript",gke);xo.registerLanguage("json",bke);xo.registerLanguage("yaml",Dke);xo.registerLanguage("markdown",wke);xo.registerLanguage("bash",JB);xo.registerLanguage("ini",dke);xo.registerLanguage("dockerfile",Cmt);xo.registerLanguage("makefile",xke);function OL(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}const Nne={prepare:0,upload:1,build:2,deploy:3,publish:4,update:5,evaluation:6,complete:7,github:8};function iFt(e,t){if(!t)return e??"prepare";if(!e)return t;const n=Nne[e],i=Nne[t];return n===void 0||i===void 0||i>=n?t:e}const rFt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>sje),void 0)),pp=()=>{};function sFt({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M2.75 12s3.35-5.25 9.25-5.25S21.25 12 21.25 12 17.9 17.25 12 17.25 2.75 12 2.75 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.5"})]})}function aFt({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M3 3l18 18"}),o.jsx("path",{d:"M9.7 6.95A9.7 9.7 0 0 1 12 6.68c5.9 0 9.25 5.32 9.25 5.32a16 16 0 0 1-2.28 2.85"}),o.jsx("path",{d:"M14.35 14.55A3.25 3.25 0 0 1 9.5 10.2"}),o.jsx("path",{d:"M6.25 8.12A16.4 16.4 0 0 0 2.75 12S6.1 17.32 12 17.32c.8 0 1.55-.1 2.25-.27"})]})}const SL={status:"hidden",apiKeyId:"",value:"",error:""};function oFt({open:e,isUpdate:t,title:n,description:i,confirmLabel:r,onCancel:s,onConfirm:a}){const{t:l}=Te("ui"),c=p.useRef(null);return p.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=c.current)==null||f.focus();const d=h=>{h.key==="Escape"&&s()};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[s,e]),e?Li.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&s()},children:o.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(M7e,{})}),o.jsx("h2",{id:"pp-confirm-title",children:n??l(t?"projectPreview.confirm.updateTitle":"projectPreview.confirm.deployTitle")})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:s,"aria-label":l("projectPreview.confirm.closeLabel"),children:o.jsx(Ba,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:i??l(t?"projectPreview.confirm.updateDescription":"projectPreview.confirm.deployDescription")})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:c,type:"button",onClick:s,children:l("common.cancel")}),o.jsx("button",{type:"button",className:"is-primary",onClick:a,children:r??l(t?"projectPreview.confirm.update":"projectPreview.confirm.deploy")})]})]})}),document.body):null}function lFt({value:e,disabled:t,onChange:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[a,l]=p.useState(!0),[c,u]=p.useState(null),[d,f]=p.useState(0);p.useEffect(()=>{const g=new AbortController;return l(!0),u(null),aR(g.signal).then(b=>s(b)).catch(b=>{b instanceof DOMException&&b.name==="AbortError"||(s([]),u(b instanceof Error?b.message:String(b)))}).finally(()=>{g.signal.aborted||l(!1)}),()=>g.abort()},[d]);const h=p.useMemo(()=>[...r].sort((g,b)=>Number(b.isCurrent)-Number(g.isCurrent)).map(g=>({value:g.uid,label:g.name.trim()||i("projectPreview.userPool.unnamed"),description:g.domain||g.uid,badge:g.isCurrent?i("projectPreview.userPool.current"):void 0})),[r,i]),m=r.find(g=>g.uid===e);return o.jsxs("div",{className:"pp-user-pool-picker",children:[o.jsx(VE,{ariaLabel:i("projectPreview.userPool.ariaLabel"),value:e,placeholder:i(a?"projectPreview.userPool.loading":"projectPreview.userPool.placeholder"),options:h,disabled:t||a||!!c,onChange:n}),c?o.jsxs("div",{className:"pp-user-pool-error",role:"alert",children:[o.jsx("span",{children:c}),o.jsx("button",{type:"button",onClick:()=>f(g=>g+1),children:i("common.retry")})]}):a?o.jsxs("span",{className:"pp-user-pool-status","aria-live":"polite",children:[o.jsx(fi,{"aria-hidden":"true",className:"pp-user-pool-spinner"}),i("projectPreview.userPool.loadingIdentity")]}):r.length===0?o.jsx("span",{className:"pp-user-pool-status",children:i("projectPreview.userPool.empty")}):m!=null&&m.isCurrent?o.jsx("span",{className:"pp-user-pool-status",children:i("projectPreview.userPool.currentHint")}):m?o.jsx("div",{className:"pp-user-pool-error",role:"alert",children:o.jsx("span",{children:i("projectPreview.userPool.mismatchHint")})}):o.jsx("span",{className:"pp-user-pool-status",children:i("projectPreview.userPool.markedHint")})]})}function cFt(e){return[{value:"api_key",label:"API Key",description:e("projectPreview.authentication.apiKeyDescription")},{value:"user_pool",label:e("projectPreview.authentication.userPool"),description:e("projectPreview.authentication.userPoolDescription")}]}const uFt={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},jne={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function Rne(e){return e.replace(/&/g,"&").replace(//g,">")}function dFt(e){const n=(e.split("/").pop()??e).toLowerCase();if(jne[n])return jne[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const i=n.lastIndexOf(".");if(i===-1)return null;const r=n.slice(i+1);return uFt[r]??null}function fFt(e,t){try{const n=dFt(t);return n&&xo.getLanguage(n)?xo.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?xo.highlightAuto(e).value:Rne(e)}catch{return Rne(e)}}function hFt(e){return[{phase:"build",label:e("projectPreview.steps.buildImage")},{phase:"deploy",label:e("projectPreview.steps.deploy")},{phase:"publish",label:e("projectPreview.steps.publish")}]}function pFt(e){return[{phase:"upload",label:e("projectPreview.steps.uploadPackage")},{phase:"build",label:e("projectPreview.steps.packageImage")},{phase:"deploy",label:e("projectPreview.steps.createRuntime")},{phase:"publish",label:e("projectPreview.steps.publishService")}]}function mFt(e){return e?!e.memory.shortTerm||(e.shortTermBackend||"local")==="local":!1}function gFt(e,t,n){const i=Number(e),r=Number(t);return!e.trim()||!t.trim()||!Number.isSafeInteger(i)||!Number.isSafeInteger(r)||i<0||r<1?{valid:!1,error:n("projectPreview.errors.instanceRangeInteger")}:i>r?{valid:!1,error:n("projectPreview.errors.instanceRangeOrder")}:{valid:!0,min:i,max:r}}function bFt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function yFt(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 vFt(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function xFt({left:e,right:t}){const[n,i]=p.useState(null);return p.useLayoutEffect(()=>{const r=document.getElementById("veadk-page-header-left"),s=document.getElementById("veadk-page-header-actions");r&&s&&i({left:r,right:s})},[]),n?o.jsxs(o.Fragment,{children:[Li.createPortal(e,n.left),Li.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function WI({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:i,agentName:r,agentCount:s,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f,deploymentConfirmation:h,deploymentActionTargetId:m,deploymentRuntimeId:g,deploymentRuntimeName:b,deploymentRuntimeNameCustomized:v=!1,onDeploymentRuntimeNameChange:y,onDeploymentStarted:x,onDeploymentTaskChange:O,feishuEnabled:w=!1,onFeishuEnabledChange:k,configuredRuntimeEnvKeys:S=[],deploymentEnv:E=[],requiredSecretEnv:C=[],requiredSecretEnvValues:N,onRequiredSecretEnvChange:_,deploymentEnvValues:j={},onDeploymentEnvChange:A,onFeishuCredentialsChange:F,network:T,onNetworkChange:P,cloudProvider:R="volcengine",deployRegion:L=Ji(R),onDeployRegionChange:M,deploymentTelemetry:U={source:"unknown",createMode:"unknown",aiAssisted:!1},onBack:I,backLabel:H,onExportYaml:K,deploymentPrimaryPane:Q,deployDisabled:q=!1}){var xc,Sr,Qn,za,rf,Al;const{t:B}=Te("ui"),ee=f??B("projectPreview.deploy"),le=H??B("projectPreview.backToConfiguration"),se=typeof l=="function",re=!!g,ge=p.useMemo(()=>new Set(S),[S]),W=mFt(i),X=(r==null?void 0:r.trim())||(i==null?void 0:i.name)||e.name,ae=p.useMemo(()=>Yje(X),[X]),[ue,Oe]=p.useState(null),ke=re?b??X:v?b??"":ue??ae,st=re?null:qE(ke),[Le,Me]=p.useState(null),[Ie,qe]=p.useState(!1),Ae=`${L}\0${ke.trim()}`,ze=p.useRef(Ae);ze.current=Ae;const Ee=(Le==null?void 0:Le.key)===Ae?Le.message:null,De=st??Ee,J=((Sr=(xc=i==null?void 0:i.deployment)==null?void 0:xc.modelApiKeyId)==null?void 0:Sr.trim())??"",he=((Qn=i==null?void 0:i.harnessSidecar)==null?void 0:Qn.enabled)===!0,[_e,Ze]=p.useState(((rf=(za=e==null?void 0:e.files)==null?void 0:za[0])==null?void 0:rf.path)??null);p.useEffect(()=>{Oe(null),Me(null)},[X]);const[at,wt]=p.useState(new Set),[Se,ve]=p.useState(!1),[He,Je]=p.useState(""),[Ce,Wt]=p.useState(!1),[ln,cn]=p.useState(!1),[Ot,jt]=p.useState(!1),[ot,gt]=p.useState(!1),[Pe,Et]=p.useState(!1),[bt,Mt]=p.useState(null),[$e,ye]=p.useState(null),[Ue,Ke]=p.useState(null),[ft,ut]=p.useState(null),[Gt,Rt]=p.useState({}),[zt,Z]=p.useState(null),[Bt,Qe]=p.useState(!1),[tt,ht]=p.useState([]),[pe,We]=p.useState(SL),vt=p.useRef(null),vn=p.useRef(J);vn.current=J;const[Ki,Fe]=p.useState({}),Pt=N??Ki,[pn,Jt]=p.useState(null),[en,Un]=p.useState({}),wn=p.useRef(new Map),[oi,Oi]=p.useState(Ije),[mi,bn]=p.useState(null),[qi,ri]=p.useState(!1),zi=p.useId(),as=p.useId(),Lr=p.useId(),_r=p.useId(),[xs,os]=p.useState("api_key"),[ia,Nr]=p.useState(""),As=Iu(R),Vs=xh(L,R),[Yr,ra]=p.useState("1"),[sa,ls]=p.useState(W||he?"1":"5"),[va,aa]=p.useState(!1),ws=R!=="byteplus",Ua=ws&&va,[oa,Qa]=p.useState(null),Jn=p.useRef(!0),Ni=C.map(be=>`${be.key}:${be.label}`).join("|"),Eo=E.map(be=>`${be.key}:${be.required}:${be.serverManaged??!1}:${(be.requiredBy??[]).join(",")}`).join("|"),xa=p.useRef(L),Xi=gFt(Yr,sa,B),Co=!re&&Xi.valid&&(Xi.min!==1||Xi.max!==5),xe=Q?pFt(B):hFt(B),Xe=Co?[...xe,{phase:"update",label:B("projectPreview.steps.updateInstances")}]:xe,Yt=Ua?[...Xe,{phase:"evaluation",label:B("projectPreview.steps.createEvaluationSets")}]:Xe,tn=g&&(Ue!=null&&Ue.pipelineId)||ft?[...Yt,{phase:"github",label:B("projectPreview.steps.syncCode")}]:Yt;function In(){var be;(be=vt.current)==null||be.abort(),vt.current=null,We(SL)}async function mr(){var Ct;const be=vn.current;if(!be){We({status:"error",apiKeyId:"",value:"",error:B("projectPreview.errors.selectApiKey")});return}(Ct=vt.current)==null||Ct.abort();const Ye=new AbortController;vt.current=Ye,We({status:"loading",apiKeyId:be,value:"",error:""});try{const _n=await $be(be,Ye.signal);if(Ye.signal.aborted||vn.current!==be)return;We({status:"visible",apiKeyId:be,value:_n.value,error:""})}catch(_n){if(Ye.signal.aborted)return;We({status:"error",apiKeyId:be,value:"",error:_n instanceof Error?_n.message:B("projectPreview.errors.loadApiKey")})}finally{vt.current===Ye&&(vt.current=null)}}p.useEffect(()=>{In(),J&&Un(be=>{if(!("MODEL_AGENT_API_KEY"in be))return be;const Ye={...be};return delete Ye.MODEL_AGENT_API_KEY,Ye})},[J]),p.useEffect(()=>(window.addEventListener("pagehide",In),()=>{window.removeEventListener("pagehide",In),In()}),[]),p.useEffect(()=>{const be=new Set(C.map(Ye=>Ye.key));N===void 0&&Fe(Ye=>Object.fromEntries(Object.entries(Ye).filter(([Ct])=>be.has(Ct)))),Jt(Ye=>Ye&&be.has(Ye)?Ye:null)},[Ni,N]),p.useEffect(()=>{const be=new Set(E.map(Ye=>Ye.key));Un(Ye=>{const Ct=Object.fromEntries(Object.entries(Ye).filter(([_n])=>be.has(_n)));return Object.keys(Ct).length===Object.keys(Ye).length?Ye:Ct})},[Eo]),p.useEffect(()=>{!M||re||As.some(be=>be.value===L)||M(Ji(R))},[R,L,As,re,M]),p.useEffect(()=>{if(!m){Qa(null);return}Qa(document.getElementById(m))},[m]);const jr=be=>o.jsxs("div",{className:`pp-network-region${qi?" is-open":""}`,onKeyDown:Ye=>{Ye.key==="Escape"&&ri(!1)},children:[be&&o.jsx("span",{children:B("projectPreview.releaseRegion")}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":B("projectPreview.deployRegion"),"aria-haspopup":"listbox","aria-expanded":qi,"aria-describedby":re?zi:void 0,disabled:Ce||re||!M,onClick:()=>ri(Ye=>!Ye),children:[o.jsx("span",{children:Vs}),o.jsx(c7e,{className:`pp-region-chevron${qi?" is-open":""}`})]}),qi&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>ri(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":B("projectPreview.deployRegion"),children:As.map(Ye=>{const Ct=Ye.value===L;return o.jsxs("button",{type:"button",role:"option","aria-selected":Ct,className:`pp-region-option${Ct?" is-selected":""}`,onClick:()=>{M==null||M(Ye.value),ri(!1)},children:[o.jsx("span",{children:Ye.label}),Ct&&o.jsx(Vu,{"aria-hidden":"true"})]},Ye.value)})})]}),re&&o.jsx("span",{id:zi,className:"pp-region-help",children:B("projectPreview.regionPreserved")})]});p.useEffect(()=>(Jn.current=!0,()=>{Jn.current=!1}),[]),p.useEffect(()=>{ra("1"),ls(W||he?"1":"5")},[W,he]),p.useEffect(()=>{xa.current!==L&&(xa.current=L,Oi(be=>({tos:be.tos.mode==="existing"?{mode:"existing"}:be.tos,cr:be.cr.mode==="existing"?{mode:"existing"}:be.cr,codePipeline:be.codePipeline.mode==="existing"?{mode:"existing"}:be.codePipeline})),bn(null))},[L]),p.useEffect(()=>{if(!ot)return;const be=document.body.style.overflow;document.body.style.overflow="hidden";const Ye=Ct=>{Ct.key==="Escape"&>(!1)};return window.addEventListener("keydown",Ye),()=>{document.body.style.overflow=be,window.removeEventListener("keydown",Ye)}},[ot]);const _s=p.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:bFt(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:B("projectPreview.errors.invalidProject")});const Si=e.files.find(be=>be.path===_e)??null,la=(T==null?void 0:T.mode)??"public",Hs=()=>({agentId:String((r==null?void 0:r.trim())||e.name||"unknown"),deployAction:g?"update":"create",deploySource:U.source,createMode:U.createMode,aiAssisted:U.aiAssisted?1:0,deployRegion:String(L),runtimeNetworkType:la,feishuEnabled:w?1:0}),$r=new Set(C.map(be=>be.key)),wa=j9t(w?[...E,...Mw]:E,j).filter(be=>!$r.has(be.key)),cs=wa.length+C.length+tt.length,Vi=pe.apiKeyId===J?pe:SL,so=Vi.status==="visible",ao=J?Vi.status==="loading"?B("projectPreview.apiKey.revealing"):so?B("projectPreview.apiKey.hide"):Vi.status==="error"?B("projectPreview.apiKey.retryReveal"):B("projectPreview.apiKey.reveal"):B("projectPreview.apiKey.selectFirst");function Go(be){wt(Ye=>{const Ct=new Set(Ye);return Ct.has(be)?Ct.delete(be):Ct.add(be),Ct})}function oo(be,Ye){l&&(l({...e,files:be}),Ye!==void 0&&Ze(Ye))}function ed(be){Si&&oo(e.files.map(Ye=>Ye.path===Si.path?{...Ye,content:be}:Ye))}function bc(){const be=He.trim();if(ve(!1),Je(""),!!be){if(e.files.some(Ye=>Ye.path===be)){Ze(be);return}oo([...e.files,{path:be,content:""}],be)}}function uu(){if(!Si)return;const be=window.prompt(B("projectPreview.files.renamePrompt"),Si.path),Ye=be==null?void 0:be.trim();!Ye||Ye===Si.path||e.files.some(Ct=>Ct.path===Ye)||oo(e.files.map(Ct=>Ct.path===Si.path?{...Ct,path:Ye}:Ct),Ye)}function To(){var Ye;if(!Si)return;const be=e.files.filter(Ct=>Ct.path!==Si.path);oo(be,((Ye=be[0])==null?void 0:Ye.path)??null)}function yc(be,Ye){ht(Ct=>Ct.map(_n=>_n.id===be?{..._n,...Ye}:_n))}function Cl(be){ht(Ye=>Ye.filter(Ct=>Ct.id!==be))}function td(){ht(be=>[...be,vFt()])}function Oa(be){Un(Ye=>{if(!(be in Ye))return Ye;const Ct={...Ye};return delete Ct[be],Ct})}function Wh(be){window.requestAnimationFrame(()=>{const Ye=wn.current.get(be);Ye&&(Ye.focus({preventScroll:!0}),Ye.scrollIntoView({block:"center",behavior:"smooth"}))})}function Gh(be){P&&P(be==="public"?void 0:{...T??{mode:be},mode:be})}function ce(be){P==null||P({...T??{mode:"private"},...be})}function li(){var _n,Dt,fn,On;const be=new Map(tt.map(Y=>({key:Y.key.trim(),value:Y.value})).filter(Y=>Y.key.length>0).map(Y=>[Y.key,Y.value])),Ye=w?[...E,...Mw]:E;for(const Y of cz(Ye,j))be.set(Y.key,Y.value);for(const Y of C){const we=Pt[Y.key]??"";we.trim()&&be.set(Y.key,we)}const Ct=Y=>Y.agentType==="llm"&&Im(Y,R)==="ark"||Y.subAgents.some(Ct);if(i&&Ct(i)){const Y=(Dt=(_n=i.deployment)==null?void 0:_n.modelApiKeyId)==null?void 0:Dt.trim(),we=(On=(fn=i.deployment)==null?void 0:fn.modelApiKeyName)==null?void 0:On.trim();Y&&be.set("MODEL_AGENT_API_KEY_ID",Y),we&&be.set("MODEL_AGENT_API_KEY_NAME",we)}return[...be].map(([Y,we])=>({key:Y,value:we}))}async function ci(){if(!(!k||Ce||Pe)){Mt(null),Et(!0);try{await k(!w)}catch(be){Jn.current&&Mt(B("projectPreview.errors.updateFeishu",{message:be instanceof Error?be.message:String(be)}))}finally{Jn.current&&Et(!1)}}}const Sa=p.useCallback(be=>{Ke(be)},[]);async function Hn(){var fn;if(!c||Ce||ln||Ie||q)return;if(De){Mt(De);return}if(!re){const On=Dje(oi);if(On){bn(On),Mt(On);return}}if(bn(null),!Xi.valid){Mt(Xi.error);return}if(!re&&xs==="user_pool"&&!ia){Mt(B("projectPreview.errors.userPoolRequired"));return}if(la!=="public"&&!((fn=T==null?void 0:T.vpcId)!=null&&fn.trim())){Mt(B("projectPreview.errors.vpcRequired"));return}const be=C.find(On=>!(Pt[On.key]??"").trim());if(be){Jt(be.key),Mt(B("projectPreview.errors.modelSecretRequired",{label:be.label}));return}Jt(null);const Ye=_Re(E,j),Ct=E.find(On=>On.key==="MODEL_AGENT_API_KEY"&&On.required&&On.serverManaged&&!J),_n=[...Ct?[Ct]:[],...Ye];if(_n.length){const On=Object.fromEntries(_n.map(Y=>{var we;return[Y.key,Y.serverManaged?B("projectPreview.errors.managedApiKeyRequired",{requirement:((we=kne(Y))==null?void 0:we.replace(/。$/,""))||Y.comment||Y.key}):I9t(Y)]}));Un(On),Mt(On[_n[0].key]),Wh(_n[0].key);return}Un({});const Dt=R8(E,j);if(Dt){Mt(`${Dt.spec.comment||Dt.spec.key}:${Dt.error}`);return}if(w){const On=Mw.find(Y=>!String(j[Y.key]??"").trim()&&!ge.has(Y.key));if(On){const Y=Mw.find(we=>we.key===On.key);Mt(B("projectPreview.errors.feishuEnvRequired",{field:(Y==null?void 0:Y.comment)||(Y==null?void 0:Y.key)}));return}}if(!re){const On=ke.trim(),Y=`${L}\0${On}`;qe(!0),Mt(null);try{const we=await sR(On,L);if(!Jn.current||ze.current!==Y)return;if(!we.available){const Ge=B("projectPreview.errors.runtimeNameExists");Me({key:Y,message:Ge}),Mt(Ge);return}Me(null)}catch(we){if(!Jn.current)return;Mt(we instanceof Error?we.message:String(we));return}finally{Jn.current&&qe(!1)}}jt(!0)}async function ji(){var ca,lt;if(!c||Ce||ln)return;if(De){jt(!1),Mt(De);return}if(!Xi.valid){jt(!1),Mt(Xi.error);return}jt(!1);const be=li();Jn.current&&(Mt(null),cn(!1),ye(null),Rt({}),Z(null),Wt(!0));const Ye=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,Ct=(r==null?void 0:r.trim())||(i==null?void 0:i.name)||e.name,_n=ke.trim();let Dt=_n;const fn=Date.now(),On=aRe(Hs()),Y={id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",phase:"prepare",label:B("projectPreview.task.preparing"),agentDraft:i,githubDelivery:!!ft,instanceRange:Co?{min:Xi.min,max:Xi.max}:void 0,createEvaluationSets:Ua};O==null||O(Y),x==null||x(Y);let we,Ge,_t=Y.phase??"prepare",un=Y.message,Nn=Y.messageCode;const Yi=Sn=>we?{...we,status:Sn,updatedAt:Date.now()}:void 0,Ri=Sn=>{const Qt=Yi(Sn);return Qt?{buildLog:Qt}:{}},Kn=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:B("projectPreview.task.waitingBuildLog")}),zn=(Sn,Qt="running")=>{const fs=[(Ge==null?void 0:Ge.text)??"",Sn].filter(Boolean).join(` `);return Ge={source:"github-delivery",status:Qt,text:fs,lineCount:fs?fs.split(` -`).length:0,truncated:!1,updatedAt:Date.now(),pendingMessage:Qt==="running"?B("projectPreview.task.waitingGithubLog"):void 0},Ge},ds=()=>{if(!(_t!=="build"||!(we!=null&&we.text)))return we={...we,status:"error",updatedAt:Date.now()},we},$n=Sn=>_t==="build"&&(we!=null&&we.text)?qg(we.text,{preserveEnd:!0}):qg(Sn);try{let Sn=Ue;if(g&&(Ue!=null&&Ue.pipelineId)){_t="github";const si=zn(B("projectPreview.task.syncingGithub")),fs={level:"info",phase:"github",message:B("projectPreview.task.syncingGithub"),pct:0};Jn.current&&(Rt(hs=>({...hs,github:fs})),Z("github")),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.syncGithubCode"),message:fs.message,pct:0,githubDelivery:!0,githubLog:si});const or=await $0e({runtimeId:g,project:e});if(Sn=or,Jn.current&&(Ke(or),Rt(hs=>({...hs,github:{level:"success",phase:"github",message:B("projectPreview.task.githubSynced"),pct:100}})),Z(null)),(ca=or.cicd)!=null&&ca.enabled){O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"success",phase:"github",label:B("projectPreview.task.githubSubmitted"),message:B("projectPreview.task.githubUpdatingRuntime"),pct:100,githubDelivery:!0,githubLog:zn(B("projectPreview.task.githubUpdatingRuntime"),"complete")});return}}const Qt=await c(e,si=>{var or;si.runtimeName&&(Dt=si.runtimeName);const fs=iFt(_t,si.phase);si.buildLog?we=Z9t(we,si.buildLog):si.phase==="build"&&!we&&(we=Kn()),si.phase===fs&&(un=si.message,Nn=si.messageCode),_t=fs,Jn.current&&(Rt(hs=>({...hs,[si.phase]:si})),Z(_t)),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",phase:_t,label:((or=tn.find(hs=>hs.phase===_t))==null?void 0:or.label)??_t,message:un,messageCode:Nn,pct:si.pct,...we?{buildLog:we}:{}})},{taskId:Ye,runtimeName:_n,sessionStorage:W?"in-memory":"persistent",minInstance:Xi.min,maxInstance:Xi.max,...re?{}:{authentication:xs==="user_pool"?{type:"user_pool",userPoolUid:ia}:{type:"api_key"}},createEvaluationSets:Ua,...w?{im:{feishu:{enabled:!0}}}:{},envs:be,...re?{}:{resources:oi}});if(!g&&ft&&Qt.runtimeId){_t="github";const si=zn(B("projectPreview.task.initializingGithub")),fs={level:"info",phase:"github",message:B("projectPreview.task.initializingGithubBranch"),pct:0};Jn.current&&(Rt(or=>({...or,github:fs})),Z("github")),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.mountGithubDelivery"),message:fs.message,pct:0,githubDelivery:!0,githubLog:si});try{const or=await D0e({project:e,githubUrl:ft.githubUrl,githubToken:ft.githubToken,baseBranch:ft.baseBranch,runtimeName:Qt.agentName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,cloudProvider:ft.cloudProvider,projectPath:".",volcengineAccessKey:ft.volcengineAccessKey,volcengineSecretKey:ft.volcengineSecretKey,volcengineSessionToken:ft.volcengineSessionToken});Sn=or,Jn.current&&(Ke(or),ut(null),Rt(hs=>({...hs,github:{level:"success",phase:"github",message:B("projectPreview.task.githubBranchInitialized"),pct:100}})),Z(null)),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.githubDeliveryMounted"),message:B("projectPreview.task.githubBranchInitialized"),pct:100,githubDelivery:!0,githubLog:zn(B("projectPreview.task.githubBranchInitialized"),"complete")})}catch(or){const hs=zn(B("projectPreview.task.githubMountFailedDetail",{message:or instanceof Error?or.message:String(or)}),"error");throw O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"error",phase:"github",label:B("projectPreview.task.githubMountFailed"),message:B("projectPreview.task.githubMountFailedHint"),pct:100,githubDelivery:!0,githubLog:hs}),new Error(B("projectPreview.errors.deployedButGithubMountFailed",{message:or instanceof Error?or.message:String(or)}))}}else if(!g&&(Sn!=null&&Sn.pipelineId)&&Qt.runtimeId)try{const si=await n7({pipelineId:Sn.pipelineId,runtimeId:Qt.runtimeId,region:Qt.region||L,cloudProvider:Sn.cloudProvider??R});Sn=si,Jn.current&&Ke(si)}catch(si){Jn.current&&Mt(B("projectPreview.errors.deployedButGithubBindFailed",{message:si instanceof Error?si.message:String(si)}))}Jn.current&&(ye(Qt),Z(null)),On.succeed({runtimeId:String(Qt.runtimeId||g||"")}),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId||g,region:Qt.region||L,startedAt:fn,status:"success",phase:"complete",label:B("projectPreview.task.deploymentComplete"),message:(lt=Qt.warnings)==null?void 0:lt.join(B("environmentCenter.listSeparator")),githubDelivery:!!(ft||Ge),...Ge?{githubLog:Ge}:{},...Ri("complete")});try{await(d==null?void 0:d(Qt))}catch(si){if(!(si instanceof Ds))throw si;O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId||g,region:Qt.region||L,startedAt:fn,status:"success",phase:"complete",label:B("projectPreview.task.deployedNotConnected"),message:si.message,...Ri("complete")})}}catch(Sn){const Qt=Sn instanceof Error?Sn.message:String(Sn);if(Sn instanceof DOMException&&Sn.name==="AbortError"){On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:qg(Sn)}),Jn.current&&(Mt(null),Z(null)),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"cancelled",label:B("projectPreview.task.cancelled"),message:B("projectPreview.task.cancelledHint"),...Ri("complete")});return}if(Pbe(Sn)){Jn.current&&(Mt(null),ye(null),cn(!0)),On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:qg(Sn)}),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",statusUnconfirmed:!0,phase:_t,label:B("projectPreview.task.deploymentStatusUnconfirmed"),message:B("projectPreview.errors.deploymentStatusUnconfirmed"),...we?{buildLog:we}:{}});return}Jn.current&&Mt(Qt),Jn.current&&ye(null);const fs=ds();On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:$n(Sn)});const or=!!fs,hs=_t==="github"&&!!Ge;O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"error",phase:_t,label:B("projectPreview.task.deploymentFailed"),message:or?B("projectPreview.task.buildFailedHint"):hs?B("projectPreview.task.githubMountFailedHint"):Qt,...fs?{buildLog:fs}:Ri("complete"),...hs?{githubDelivery:!0,githubLog:Ge}:{},retry:Hn})}finally{Jn.current&&Wt(!1)}}function nd(){jt(!1)}async function vc(){if(!(!$e||Bt)){Qe(!0),Mt(null);try{const{addConnection:be,addRuntimeConnection:Ye,remoteAppId:Ct,loadConnections:_n}=await Md(async()=>{const{addConnection:On,addRuntimeConnection:Y,remoteAppId:we,loadConnections:Ge}=await Promise.resolve().then(()=>pte);return{addConnection:On,addRuntimeConnection:Y,remoteAppId:we,loadConnections:Ge}},void 0),{probeRuntimeApps:Dt}=await Md(async()=>{const{probeRuntimeApps:On}=await Promise.resolve().then(()=>lUe);return{probeRuntimeApps:On}},void 0);let fn;if($e.runtimeId){const On=$e.region??L,Y=await Dt($e.runtimeId,On,{retryProbe:!0})??[];fn=Ye($e.runtimeId,$e.runtimeName,On,Y,Y.length>0?{[Y[0]]:$e.agentName}:void 0,$e.version)}else fn=await be($e.agentName,$e.url,$e.apikey,"");if(fn.apps.length===0)Mt(B("projectPreview.errors.noAgentAtEndpoint"));else{const On={[fn.apps[0]]:$e.agentName},Y={...fn,appLabels:{...fn.appLabels??{},...On}},Ge=_n().map(un=>un.id===fn.id?Y:un);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(Ge));const{registerConnections:_t}=await Md(async()=>{const{registerConnections:un}=await Promise.resolve().then(()=>pte);return{registerConnections:un}},void 0);if(_t(Ge),u){const un=Ct(fn.id,fn.apps[0]);await u(un,$e.agentName)}else alert(B("projectPreview.agentAdded",{name:$e.agentName}))}}catch(be){Mt(B("projectPreview.errors.addAgent",{message:be instanceof Error?be.message:String(be)}))}finally{Qe(!1)}}}function du(){const be=Hs(),Ye=oRe({agentId:be.agentId,deployAction:be.deployAction,deploySource:be.deploySource,createMode:be.createMode,aiAssisted:be.aiAssisted});try{const Ct=M9t(e.files),_n=URL.createObjectURL(Ct),Dt=document.createElement("a");Dt.href=_n,Dt.download=`${e.name||"project"}.zip`,document.body.appendChild(Dt),Dt.click(),document.body.removeChild(Dt),URL.revokeObjectURL(_n),Ye.succeed({fileCount:e.files.length,zipSizeBytes:Ct.size})}catch(Ct){throw Ye.fail({fileCount:e.files.length,...Wa(Ct)}),Ct}}const us=o.jsxs("div",{className:`pp-artifact-actions${t?" is-rail":""}`,"aria-label":B("projectPreview.artifactActions"),children:[K&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:K,children:[o.jsx(b7e,{className:"pp-ic"}),B("projectPreview.exportYaml")]}),se&&l&&o.jsx(iSt,{project:e,onChange:l,className:"pp-artifact-source",label:B("projectPreview.viewSource")}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:du,children:[o.jsx(Yj,{className:"pp-ic"}),B("projectPreview.downloadSource")]})]});function Tl(be,Ye,Ct){return yFt(be,Ye===0).map(_n=>{const Dt=Ct?`${Ct}/${_n.name}`:_n.name,fn=_n.path!==void 0,On={paddingLeft:8+Ye*14};if(fn){const we=_n.path===_e;return o.jsxs("button",{type:"button",className:`pp-row pp-file${we?" pp-active":""}`,style:On,onClick:()=>Ze(_n.path),title:_n.path,children:[o.jsx(x7e,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:_n.name})]},Dt)}const Y=at.has(Dt);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:On,onClick:()=>Go(Dt),children:[o.jsx(Uk,{className:`pp-ic pp-chevron${Y?"":" pp-open"}`}),o.jsx(O7e,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:_n.name})]}),!Y&&Tl(_n,Ye+1,Dt)]},Dt)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${Q?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(xFt,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[I&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:I,children:[o.jsx(kbe,{className:"pp-ic"}),le]}),o.jsxs("span",{className:"pp-toolbar-title",children:[B("projectPreview.deployTitle",{name:r||e.name||B("projectPreview.unnamedAgent")}),s&&s>1?B("projectPreview.additionalAgentCount",{count:s}):""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!Q&&o.jsx("section",{className:"pp-release-overview","aria-label":B("projectPreview.releaseOverview"),children:o.jsxs("div",{className:`pp-release-preview${t?" is-embedded":""}`,children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[i&&o.jsx(LS,{draft:i,direction:"horizontal",selectedPath:[],onSelect:pp,onAdd:pp,onInsert:pp,onDelete:pp,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>gt(!0),"aria-label":B("projectPreview.expandFlow"),title:B("projectPreview.expand"),children:o.jsx(Ky,{"aria-hidden":!0})})]}),t&&us,!t&&o.jsxs("div",{className:"pp-release-info",children:[o.jsx("div",{className:"pp-release-card-head",children:B("projectPreview.agentOverview")}),o.jsxs("div",{className:"pp-release-info-body",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:r||e.name||B("projectPreview.unnamedAgent")}),(i==null?void 0:i.description)&&o.jsx("p",{className:"pp-release-description",title:i.description,children:i.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.agentCount")}),o.jsx("dd",{children:s??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.model")}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("common.description")}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.systemPrompt")}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.optimizations")}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join(B("environmentCenter.listSeparator")):B("projectPreview.notEnabled")})]}),a.effectiveOptimizations&&a.effectiveOptimizations.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.effectiveCapabilities")}),o.jsx("dd",{children:a.effectiveOptimizations.join(B("environmentCenter.listSeparator"))})]}),a.autoAddedOptimizations&&a.autoAddedOptimizations.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.automaticProtection")}),o.jsx("dd",{children:a.autoAddedOptimizations.join(B("environmentCenter.listSeparator"))})]}),a.planHash&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.planHash")}),o.jsx("dd",{className:"pp-release-fact-long",children:a.planHash})]})]})]})]}),us]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:B("projectPreview.files.preview")}),se&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:B("projectPreview.files.new"),onClick:()=>{ve(!0),Je("")},children:o.jsx(y7e,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[Se&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:He,onChange:be=>Je(be.target.value),onBlur:bc,onKeyDown:be=>{be.key==="Enter"&&bc(),be.key==="Escape"&&(ve(!1),Je(""))}}),e.files.length===0&&!Se?o.jsx("div",{className:"pp-empty",children:B("projectPreview.files.empty")}):Tl(_s,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:Si==null?void 0:Si.path,children:(Si==null?void 0:Si.path)??B("projectPreview.files.noneSelected")}),o.jsx("div",{className:"pp-actions",children:se&&Si&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:B("projectPreview.files.rename"),onClick:uu,children:o.jsx(N7e,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:B("common.delete"),onClick:To,children:o.jsx(pm,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:Si==null?o.jsx("div",{className:"pp-placeholder",children:B("projectPreview.files.selectToView")}):se?o.jsx("div",{className:"pp-codemirror",children:o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:B("projectPreview.files.loadingEditor")}),children:o.jsx(rFt,{value:Si.content,path:Si.path,onChange:ed})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:fFt(Si.content,Si.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":B("projectPreview.deploymentConfiguration"),children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:B("projectPreview.deploymentConfiguration")})}),o.jsxs("div",{className:"pp-config-scroll",children:[Q,!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("label",{className:"pp-config-label",htmlFor:as,children:B("projectPreview.runtimeName")}),o.jsxs("div",{className:"pp-runtime-name-field",children:[o.jsx("input",{id:as,className:"pp-runtime-name-input",value:ke,disabled:Ce||Ie||re,maxLength:64,autoComplete:"off","aria-label":B("projectPreview.runtimeName"),"aria-invalid":!!De,"aria-describedby":`${Lr}${De?` ${_r}`:""}`,onChange:be=>{const Ye=be.currentTarget.value;Me(null),Mt(null),y?y(Ye):Oe(Ye)}}),o.jsx("p",{id:Lr,className:"pp-config-note",children:B(re?"projectPreview.runtimeNamePreserved":"projectPreview.runtimeNameHint")}),De&&o.jsx("p",{id:_r,className:"pp-runtime-name-error",role:"alert",children:De})]})]}),!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.releaseRegion")}),jr(!1)]}),!Q&&o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"pp-config-section pp-auth-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.accessAuthentication")}),re?o.jsx("p",{className:"pp-config-note pp-auth-preserved-note",children:B("projectPreview.authenticationPreserved")}):o.jsxs("div",{className:"pp-auth-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:B("projectPreview.authenticationMethod")}),o.jsx(VE,{ariaLabel:B("projectPreview.authenticationAriaLabel"),value:xs,placeholder:B("projectPreview.authenticationPlaceholder"),options:cFt(B),disabled:Ce,onChange:be=>{Mt(null),os(be)}})]}),xs==="user_pool"&&o.jsxs("label",{children:[o.jsx("span",{children:B("projectPreview.userPool.label")}),o.jsx(lFt,{value:ia,disabled:Ce,onChange:be=>{Mt(null),Nr(be)}})]})]})]}),o.jsx(nFt,{project:e,region:L,cloudProvider:R,runtimeId:g,binding:Ue,showSetup:!re,onPendingCicdChange:ut,onBindingChange:Sa,disabled:Ce||Pe||q||!!n})]}),!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.messageChannels")}),o.jsx(W9t,{enabled:w,updating:Pe,disabled:Ce||Ie||!k||!F,agentName:r||e.name,appId:j.FEISHU_APP_ID??"",appSecret:j.FEISHU_APP_SECRET??"",appIdConfigured:ge.has("FEISHU_APP_ID"),appSecretConfigured:ge.has("FEISHU_APP_SECRET"),onToggle:ci,onCredentialsChange:(be,Ye)=>{F==null||F(be,Ye)}})]}),!re&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.instanceSettings")}),o.jsxs("div",{className:"pp-instance-fields",children:[o.jsxs("label",{htmlFor:"runtime-min-instance",children:[o.jsx("span",{children:B("projectPreview.minInstances")}),o.jsx("input",{id:"runtime-min-instance",type:"number",min:"0",step:"1",inputMode:"numeric",value:Yr,disabled:Ce||he,"aria-invalid":!Xi.valid,onChange:be=>ra(be.currentTarget.value)})]}),o.jsxs("label",{htmlFor:"runtime-max-instance",children:[o.jsx("span",{children:B("projectPreview.maxInstances")}),o.jsx("input",{id:"runtime-max-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:sa,disabled:Ce||he,"aria-invalid":!Xi.valid,onChange:be=>ls(be.currentTarget.value)})]})]}),(W||he)&&o.jsx("p",{className:"pp-instance-note",role:"note",children:B(he?"projectPreview.sidecarSingleInstance":"projectPreview.inMemorySingleInstance")}),!Xi.valid&&o.jsx("p",{className:"pp-instance-error",role:"alert",children:Xi.error})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.network")}),Q&&jr(!0),re&&o.jsx("p",{className:"pp-config-note",children:B("projectPreview.networkPreserved")}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":B("projectPreview.networkMode"),children:["public","private","both"].map(be=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:be,checked:la===be,onChange:()=>Gh(be),disabled:Ce||re||!P}),o.jsx("span",{children:be==="public"?B("projectPreview.networkModes.public"):be==="private"?"VPC":B("projectPreview.networkModes.both")})]},be))}),la!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(T==null?void 0:T.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:Ce||re,onChange:be=>ce({vpcId:be.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:[B("projectPreview.subnetId")," ",o.jsx("small",{children:B("projectPreview.subnetHint")})]}),o.jsx("input",{value:(T==null?void 0:T.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:Ce||re,onChange:be=>ce({subnetIds:be.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(T!=null&&T.enableSharedInternetAccess),disabled:Ce||re,onChange:be=>ce({enableSharedInternetAccess:be.target.checked})}),B("projectPreview.sharedInternetAccess")]})]})]})]}),ws&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.evaluationSets")}),o.jsxs("label",{className:"pp-evaluation-set-option",children:[o.jsx("input",{type:"checkbox",checked:va,disabled:Ce,onChange:be=>aa(be.currentTarget.checked)}),o.jsxs("span",{children:[o.jsx("strong",{children:B("projectPreview.createEvaluationSets")}),o.jsx("small",{children:B("projectPreview.createEvaluationSetsHint")})]})]})]}),!re&&o.jsxs("section",{className:"pp-config-section pp-resource-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.resourceConfiguration")}),o.jsx(Mje,{value:oi,agentName:r||e.name||"agentkit-app",runtimeName:ke,region:L,disabled:Ce,validationError:mi,onChange:be=>{Oi(be),bn(null)}})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsx("div",{className:"pp-env-head",children:o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:[B("projectPreview.environmentVariables"),o.jsx("span",{className:"pp-agent-child-count pp-env-count",children:B("projectPreview.itemCount",{count:cs})})]}),o.jsx("div",{className:"pp-env-sub",children:B("projectPreview.environmentVariablesHint")})]})}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:td,disabled:Ce,children:[o.jsx(Fo,{className:"pp-ic"}),B("projectPreview.addVariable")]}),(wa.length>0||C.length>0||tt.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[wa.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:B("projectPreview.componentGenerated")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:wa.length})})]}),wa.map(be=>{const Ye=be.readOnly||be.key.startsWith("ENABLE_"),Ct=be.serverManaged&&be.key==="MODEL_AGENT_API_KEY",_n=Ct?so?Vi.value:B("projectPreview.injectedByApiKey"):be.value,Dt=uz(be,j),fn=en[be.key],On=`deployment-env-${be.key.toLowerCase()}-error`,Y=kne(be)||be.help||be.comment,we=be.multiline||be.format==="json";return o.jsxs("div",{className:`pp-env-row pp-env-row-derived${we?" is-multiline":""}`,children:[o.jsxs("div",{className:"pp-env-key-fixed pp-env-key-cell","aria-label":B("projectPreview.envNameAriaLabel",{key:be.key}),"aria-disabled":Ce,children:[o.jsx("span",{title:be.key,children:be.key}),Y&&o.jsxs("span",{className:"pp-env-help",tabIndex:0,"data-help":Y,"aria-label":B("projectPreview.envDescriptionAriaLabel",{key:be.key,description:Y}),children:["?",o.jsx("span",{className:"pp-env-help-popover",role:"tooltip",children:Y})]}),be.link&&o.jsx("a",{className:"pp-env-link",href:be.link.url,target:"_blank",rel:"noopener noreferrer",title:B("projectPreview.openOpenViking",{label:be.link.label}),"aria-label":B("projectPreview.openOpenVikingAriaLabel",{key:be.key,label:be.link.label}),children:o.jsx(gb,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"pp-env-value-wrap",children:[we?o.jsx("textarea",{ref:Ge=>{Ge?wn.current.set(be.key,Ge):wn.current.delete(be.key)},className:"pp-env-value pp-env-json-value",value:be.value,placeholder:be.placeholder||(be.required?B("projectPreview.requiredEmpty"):B("projectPreview.optionalEmpty")),readOnly:Ye,disabled:Ce||!Ye&&!A,autoComplete:"off",spellCheck:!1,"aria-invalid":!!(fn||Dt),"aria-describedby":fn?On:void 0,"aria-label":B("projectPreview.envValueAriaLabel",{key:be.key}),onChange:Ge=>{const _t=Ge.currentTarget.value;A==null||A(be.key,_t),fn&&_t.trim()&&(Oa(be.key),Mt(null))}}):o.jsxs("div",{className:Ct?"pp-env-secret-control":void 0,children:[o.jsx("input",{ref:Ge=>{Ge?wn.current.set(be.key,Ge):wn.current.delete(be.key)},className:"pp-env-value",type:Ct?"text":be.secret?"password":"text",value:_n,placeholder:be.placeholder||(be.required?B("projectPreview.requiredEmpty"):B("projectPreview.optionalEmpty")),readOnly:Ye,disabled:Ce||!Ye&&!A,autoComplete:be.secret?"new-password":"off",spellCheck:be.secret?!1:void 0,"aria-invalid":!!(fn||Dt),"aria-describedby":fn?On:void 0,"aria-label":B("projectPreview.envValueAriaLabel",{key:be.key}),onChange:Ge=>{const _t=Ge.currentTarget.value;A==null||A(be.key,_t),fn&&_t.trim()&&(Oa(be.key),Mt(null))}}),Ct&&o.jsx("button",{type:"button",className:"pp-env-secret-toggle","aria-label":ao,title:ao,"aria-pressed":so,disabled:Vi.status==="loading"||!J,onClick:()=>{so?In():mr()},children:Vi.status==="loading"?o.jsx(fi,{className:"pp-env-secret-spinner","aria-hidden":"true"}):so?o.jsx(aFt,{}):o.jsx(sFt,{})})]}),fn&&o.jsx("span",{id:On,className:"pp-env-error",role:"alert",children:fn}),Dt&&o.jsx("span",{className:"pp-env-error",children:Dt}),Ct&&Vi.status==="error"&&o.jsx("span",{className:"pp-env-reveal-error",role:"alert",children:Vi.error})]}),o.jsx("span",{className:"pp-env-source",children:B(Ye?"projectPreview.automatic":"projectPreview.synced")})]},be.key)})]}),C.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:B("projectPreview.customModelCredentials")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:C.length})})]}),C.map(be=>{const Ye=pn===be.key,Ct=`${be.key.toLowerCase()}-error`;return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("label",{className:"pp-env-key-fixed pp-env-key-cell",htmlFor:be.key,title:be.label,children:o.jsx("span",{children:be.key})}),o.jsxs("div",{className:"pp-env-value-wrap",children:[o.jsx("input",{id:be.key,className:"pp-env-value",type:"password",value:Pt[be.key]??"",placeholder:B("projectPreview.releaseOnlySecret"),disabled:Ce,autoComplete:"new-password",spellCheck:!1,"aria-invalid":Ye,"aria-describedby":Ye?Ct:void 0,"aria-label":be.label,onChange:_n=>{const Dt=_n.currentTarget.value;_?_(be.key,Dt):Fe(fn=>({...fn,[be.key]:Dt})),Ye&&Dt.trim()&&(Jt(null),Mt(null))}}),Ye&&o.jsx("span",{id:Ct,className:"pp-env-error",role:"alert",children:B("projectPreview.errors.modelApiKeyRequired")})]}),o.jsx("span",{className:"pp-env-source",children:B("projectPreview.thisRelease")})]},be.key)})]}),tt.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:B("projectPreview.customVariables")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:tt.length})})]}),tt.map(be=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:be.key,placeholder:B("common.name"),disabled:Ce,autoComplete:"off",onChange:Ye=>yc(be.id,{key:Ye.currentTarget.value})}),o.jsx("input",{type:"text",value:be.value,placeholder:B("projectPreview.value"),disabled:Ce,autoComplete:"off",onChange:Ye=>yc(be.id,{value:Ye.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:B("projectPreview.deleteVariable"),disabled:Ce,onClick:()=>Cl(be.id),children:o.jsx(Ba,{className:"pp-ic"})})]},be.id))]})]}),(Ce||$e||Object.keys(Gt).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.deploymentProgress")}),o.jsx("ol",{className:"pp-steps",children:tn.map((be,Ye)=>{const Ct=zt?tn.findIndex(On=>On.phase===zt):-1,_n=!!bt&&(Ct===-1?Ye===0:Ye===Ct),Dt=Gt[be.phase];let fn;return $e||(Dt==null?void 0:Dt.level)==="success"?fn="done":_n?fn="failed":Ct===-1?fn=Ce?"active":"pending":Yebe.phase===zt))==null?void 0:Al.label)??zt,message:bt}):bt,onRetry:Hn,retryLabel:B(re?"projectPreview.retryUpdate":"projectPreview.retryDeploy")}),ln&&o.jsxs("div",{className:"pp-status-unconfirmed",role:"status",children:[o.jsx("strong",{children:B("projectPreview.task.deploymentStatusUnconfirmed")}),o.jsx("span",{children:B("projectPreview.errors.deploymentStatusUnconfirmed")})]}),$e&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:B(re?"projectPreview.updateSucceeded":"projectPreview.deploySucceeded")}),o.jsxs("div",{className:"pp-deploy-result-body",children:[$e.warnings&&$e.warnings.length>0&&o.jsx("div",{className:"pp-deploy-result-warning",role:"status",children:$e.warnings.map(be=>o.jsx("span",{children:be},be))}),$e.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.region")}),o.jsx("code",{children:xh($e.region,R)})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.agentName")}),o.jsx("code",{children:$e.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.runtimeName")}),o.jsx("code",{children:$e.runtimeName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.apiEndpoint")}),o.jsx("code",{className:"pp-deploy-result-url",children:$e.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:vc,disabled:Bt,children:[Bt?o.jsx(fi,{className:"pp-ic spin"}):o.jsx(_be,{className:"pp-ic"}),B(Bt?"projectPreview.connecting":"projectPreview.chatNow")]}),$e.consoleUrl&&o.jsxs("a",{href:$e.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(gb,{className:"pp-ic"}),B("projectPreview.console")]})]})]})]}),o.jsx("div",{className:`pp-config-actions${oa?" is-external":""}`,children:oa?Li.createPortal(o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Hn,disabled:Ce||ln||Ie||Pe||q||!!n||!!De,title:n||De||void 0,children:Ce?B("projectPreview.actionInProgress",{action:ee}):ln?B("projectPreview.task.deploymentStatusUnconfirmed"):Ie?B("projectPreview.checkingName"):bt?B("projectPreview.retryAction",{action:ee}):ee}),oa):o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Hn,disabled:Ce||ln||Ie||Pe||q||!!n||!!De,title:n||De||void 0,children:Ce?B("projectPreview.actionInProgress",{action:ee}):ln?B("projectPreview.task.deploymentStatusUnconfirmed"):Ie?B("projectPreview.checkingName"):bt?B("projectPreview.retryAction",{action:ee}):ee})})]})]}),ot&&i&&Li.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:be=>{be.target===be.currentTarget&>(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":B("projectPreview.flowPreview"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:B("projectPreview.executionFlow")}),o.jsx("span",{children:B("projectPreview.flowPreviewHint")})]}),o.jsx("button",{type:"button",onClick:()=>gt(!1),"aria-label":B("projectPreview.closeFlowPreview"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(LS,{draft:i,direction:"horizontal",selectedPath:[],onSelect:pp,onAdd:pp,onInsert:pp,onDelete:pp,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(oFt,{open:Ot,isUpdate:re,...h,onCancel:nd,onConfirm:()=>void ji()})]})}const wFt=new Set(["MODEL_AGENT_API_KEY"]),OFt=new Set(["MODEL_AGENT_NAME","MODEL_NAME"]),SFt=new Set(["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY","VOLCENGINE_SESSION_TOKEN","BYTEPLUS_ACCESS_KEY","BYTEPLUS_SECRET_KEY","BYTEPLUS_SESSION_TOKEN","VEADK_DISABLE_EXPIRE_AT"]);function cb(e){return!SFt.has(e)}function kk(e){return wFt.has(e)||/(?:API_KEY|ACCESS_KEY|SECRET_KEY|PRIVATE_KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIAL)$/.test(e)}function kFt(e,t){const n={},i=new Set([...e.environment.required,...e.environment.optional]);for(const r of i){if(!cb(r)||kk(r))continue;const s=r==="MODEL_AGENT_API_BASE"?xl(t):OFt.has(r)?wh(t):e.environment.defaults[r];s!=null&&s.trim()&&(n[r]=s)}return n}function EFt({delivery:e,onBack:t,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,cloudProvider:a="volcengine",initialDeployRegion:l}){const{t:c}=Te("create"),[u,d]=p.useState(l??Ji(a)),[f,h]=p.useState(),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState(()=>({name:Yje(e.agentName),files:e.files??[]})),O=e.environment??{required:[],optional:[],defaults:{}},[w,k]=p.useState(()=>({...O.defaults})),S=O.required.filter(cb).filter(kk).map(j=>({key:j,label:j})),E=[...O.required.filter(cb).filter(j=>!kk(j)).map(j=>({key:j,required:!0,comment:j,placeholder:c("intelligentDeployment.env.requiredPlaceholder",{key:j})})),...O.optional.filter(cb).map(j=>({key:j,required:!1,comment:j,placeholder:c("intelligentDeployment.env.optionalPlaceholder",{key:j})}))],C=qE(y.name,j=>c(`validation.runtimeName.${j}`));p.useEffect(()=>{if(C){g(null);return}const j=new AbortController,A=window.setTimeout(()=>{v(!0),sR(y.name,u).then(F=>{j.signal.aborted||g(F.available===!0)}).catch(()=>{j.signal.aborted||g(null)}).finally(()=>{j.signal.aborted||v(!1)})},250);return()=>{window.clearTimeout(A),j.abort()}},[u,y.name,C]);const N={kind:"intelligentDevelopment",sessionId:e.sessionId,...e.projectId&&e.versionId?{projectId:e.projectId,versionId:e.versionId}:{},artifactSha256:e.artifactSha256,validationReportSha256:e.validationReportSha256,...e.verified?{}:{acknowledgeUnverified:!0}};async function _(j,A,F){const T=f&&f.mode!=="public"?{mode:f.mode,vpc_id:f.vpcId,subnet_ids:f.subnetIds,enable_shared_internet_access:f.enableSharedInternetAccess}:void 0;return Ax(j.name,[],{region:u,projectName:"default",network:T},{...F,onStage:A,runtimeName:j.name,source:N})}return o.jsx(WI,{cloudProvider:a,project:y,agentName:y.name,onDeploy:_,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,network:f,onNetworkChange:h,deployRegion:u,onDeployRegionChange:d,deploymentEnv:E,requiredSecretEnv:S,deploymentEnvValues:w,onDeploymentEnvChange:(j,A)=>k(F=>({...F,[j]:A})),deploymentActionLabel:c("common.deploy"),deployDisabled:!!C||m===!1||b,deployDisabledReason:C??(m===!1?c("intelligentDeployment.runtimeNameExists"):b?c("intelligentDeployment.checkingRuntimeName"):void 0),deploymentTelemetry:{source:"intelligent_development",createMode:"intelligent",aiAssisted:!0},onBack:t,backLabel:c("intelligentDeployment.back"),deploymentPrimaryPane:o.jsxs("section",{className:"trusted-source-pane","aria-label":e.verified?c("intelligentDeployment.verifiedSource"):c("intelligentDeployment.deployableSource"),children:[o.jsx("div",{className:"trusted-source-pane__badge",children:e.verified?c("intelligentDeployment.verifiedByCodex"):c("intelligentDeployment.deployableSource")}),o.jsx("h2",{children:e.agentName}),o.jsxs("label",{className:"trusted-source-pane__runtime-name",children:[o.jsx("span",{children:c("intelligentDeployment.runtimeName")}),o.jsx("input",{value:y.name,maxLength:64,onChange:j=>x(A=>({...A,name:j.target.value}))})]}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.files")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.artifact")}),o.jsx("dd",{children:o.jsx("code",{children:e.artifactSha256.slice(0,16)})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.validationReport")}),o.jsx("dd",{children:o.jsx("code",{children:e.validationReportSha256.slice(0,16)})})]})]}),o.jsx("p",{children:e.verified?c("intelligentDeployment.verifiedHint"):c("intelligentDeployment.unverifiedHint")})]})})}const CFt="_Container_1tuad_1",TFt="_Checkbox_1tuad_22",AFt="_CheckMark_1tuad_92",_Ft="_Label_1tuad_162",O2={Container:CFt,Checkbox:TFt,CheckMark:AFt,Label:_Ft},fz=({className:e,label:t,id:n,disabled:i,orientation:r="left",...s})=>{const a=p.useId(),l=n??a;return o.jsxs("div",{"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-orientation":r,className:pi(e,O2.Container),children:[o.jsx(Lze,{className:O2.Checkbox,id:l,disabled:i,...s,children:o.jsx(Fze,{className:O2.CheckMark})}),t&&o.jsx("label",{htmlFor:l,className:O2.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},NFt="_RadioGroup_onrfm_1",jFt="_RadioLabel_onrfm_9",RFt="_RadioIndicatorWrapper_onrfm_26",IFt="_RadioItem_onrfm_43",PFt="_RadioIndicator_onrfm_26",Gw={RadioGroup:NFt,RadioLabel:jFt,RadioIndicatorWrapper:RFt,RadioItem:IFt,RadioIndicator:PFt},jRe=p.createContext(null),DFt=()=>{const e=p.use(jRe);if(!e)throw new Error("RadioGroup components must be wrapped in ");return e},Wg=({onChange:e,children:t,className:n,direction:i="row",disabled:r=!1,...s})=>{const a=p.useMemo(()=>({disabled:r,direction:i}),[r,i]);return o.jsx(jRe,{value:a,children:o.jsx(rWe,{className:pi(Gw.RadioGroup,n),"data-direction":i,onValueChange:e,disabled:r,...s,children:t})})},MFt=({value:e,disabled:t=!1,required:n,children:i,className:r,block:s=!1,...a})=>{const{disabled:l}=DFt(),c=l||t,u=p.useId(),d=`${e}-${u}`;return o.jsx("div",{className:"flex",...a,children:o.jsxs("label",{htmlFor:d,className:pi(Gw.RadioLabel,r),"data-disabled":c?"":void 0,"data-block":s?"":void 0,onMouseDown:f=>{!f.defaultPrevented&&f.detail>1&&f.preventDefault()},children:[o.jsx("div",{className:Gw.RadioIndicatorWrapper,children:o.jsx(lWe,{id:d,value:e,disabled:c,required:n,className:Gw.RadioItem,children:o.jsx(uWe,{className:Gw.RadioIndicator})})}),i]})})};Wg.Item=MFt;function LFt({className:e,...t}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),o.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}function uw(e,t){return{id:e,get label(){return $t(`traditional.agentTypes.${e}.fullLabel`)},get desc(){return $t(`traditional.agentTypes.${e}.description`)},icon:t}}const dw={llm:uw("llm",LFt),sequential:uw("sequential",S7e),parallel:uw("parallel",D7e),loop:uw("loop",Nbe),a2a:uw("a2a",Zj)},$Ft=[dw.llm,dw.sequential,dw.parallel,dw.loop,dw.a2a],RRe=e=>e==="sequential"||e==="parallel"||e==="loop",GI=e=>e==="a2a";function ub(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(i=>i==null?void 0:i.toLocaleLowerCase().includes(n)):!0}const IRe=new Set(["local","sqlite","mysql","postgresql"]),PRe=new Set(["local","opensearch","redis","viking","openviking","mem0"]),DRe=new Set(["opensearch","viking","context_search","openviking"]),MRe=new Set(["apmplus","cozeloop","tls"]),LRe=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),FFt=new Set(["llm","sequential","parallel","loop","a2a"]),BFt=new Set(["lark-cli","github-cli","pandoc"]),UFt=new Set(["default","ops"]);function En(e,t=""){return typeof e=="string"?e:t}function al(e){return e===!0}function QFt(e){return typeof e=="string"&&UFt.has(e)?e:"default"}function xv(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function zFt(e){return Array.from(new Set(xv(e).filter(t=>BFt.has(t))))}function VFt(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function $Re(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:En(t.name),description:En(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function wv(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function FRe(e){return typeof e=="string"&&FFt.has(e)?e:"llm"}function BRe(e){return e==="byteplus"?"byteplus":"volcengine"}function URe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function QRe(e){const t=e&&typeof e=="object"?e:{};return{enabled:al(t.enabled),registrySpaceId:En(t.registrySpaceId),registryTopK:En(t.registryTopK),registryRegion:En(t.registryRegion),registryEndpoint:En(t.registryEndpoint)}}function HFt(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=t.componentOverrides&&typeof t.componentOverrides=="object"?t.componentOverrides:{},i=Object.fromEntries(Ux.map(l=>[l,n[l]===!0])),r={enabled:Object.values(i).some(Boolean),profile:QFt(t.profile),componentOverrides:i},s=En(t.catalogVersion).trim(),a=En(t.planHash).trim();return s&&(r.catalogVersion=s),a&&(r.planHash=a),kB(r)}function zRe(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const i=n&&typeof n=="object"?n:{},r=BRe(i.cloudProvider??t),s=i.memory&&typeof i.memory=="object"?i.memory:{},a=QRe(i.a2aRegistry),l=FRe(i.agentType),c=a.enabled&&l==="llm"?"a2a":l;return{...oc(r),cloudProvider:r,name:En(i.name),description:En(i.description),instruction:En(i.instruction),agentType:c,maxIterations:URe(i.maxIterations),a2aUrl:En(i.a2aUrl),modelName:En(i.modelName),modelSource:i.modelSource==="custom"||i.modelSource==="ark"?i.modelSource:void 0,modelProvider:En(i.modelProvider),modelApiBase:En(i.modelApiBase),builtinTools:xv(i.builtinTools).filter(u=>LRe.has(u)),customTools:$Re(i.customTools),memory:{shortTerm:al(s.shortTerm),longTerm:al(s.longTerm)},shortTermBackend:wv(i.shortTermBackend,IRe,"local"),longTermBackend:wv(i.longTermBackend,PRe,"local"),longTermMemoryIndex:En(i.longTermMemoryIndex),autoSaveSession:al(i.autoSaveSession),knowledgebase:al(i.knowledgebase),knowledgebaseBackend:wv(i.knowledgebaseBackend,DRe,nm),knowledgebaseIndex:En(i.knowledgebaseIndex),tracing:al(i.tracing),tracingExporters:xv(i.tracingExporters).filter(u=>MRe.has(u)),a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,subAgents:zRe(i.subAgents,r),selectedSkills:VRe(i)}}):[]}function VRe(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const i=n&&typeof n=="object"?n:{},r=En(i.source),s=r==="local"||r==="skillspace"||r==="skillhub"||r==="runtime"?r:"skillhub",a=En(i.name)||En(i.slug)||En(i.skillName)||En(i.skillId)||"skill",l=En(i.folder)||a,c=En(i.description);if(s==="runtime"){if(l!==a)continue;t.push({source:s,folder:l,name:a,description:c});continue}if(s==="skillhub"){const f=En(i.slug);if(!f)continue;t.push({source:s,folder:l,name:a,description:c,slug:f,namespace:En(i.namespace)||"public"});continue}if(s==="local"){const h=(Array.isArray(i.localFiles)?i.localFiles:[]).map(m=>{const g=m&&typeof m=="object"?m:{},b=En(g.path),v=En(g.content);return b?{path:b,content:v}:null}).filter(m=>m!==null);if(h.length===0)continue;t.push({source:s,folder:l,name:a,description:c,localFiles:h});continue}const u=En(i.skillSpaceId),d=En(i.skillId);!u||!d||t.push({source:s,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:En(i.skillSpaceName),skillId:d,version:En(i.version)})}return t}function qFt(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},i=t.deployment&&typeof t.deployment=="object"?t.deployment:{},r=VFt(i.envValues),s=t.cloudEnvironment&&typeof t.cloudEnvironment=="object"?t.cloudEnvironment:{},a=QRe(t.a2aRegistry),l=FRe(t.agentType),c=a.enabled&&l==="llm"?"a2a":l,u=BRe(t.cloudProvider),d=Array.isArray(t.mcpTools)?t.mcpTools.map(f=>{const h=f&&typeof f=="object"?f:{},m=h.transport==="stdio"?"stdio":"http";return{name:En(h.name),transport:m,url:En(h.url),authToken:En(h.authToken),authTokenEnv:En(h.authTokenEnv),credentialConfigured:h.credentialConfigured===!0,command:En(h.command),args:xv(h.args)}}).filter(f=>f.transport==="http"?!!f.url:!!f.command):[];return{...oc(u),cloudProvider:u,name:En(t.name)||"my_agent",description:En(t.description),instruction:En(t.instruction)||"You are a helpful assistant.",dynamicAgentDelegation:al(t.dynamicAgentDelegation),agentType:c,maxIterations:URe(t.maxIterations),a2aUrl:En(t.a2aUrl),modelName:En(t.modelName),modelSource:t.modelSource==="custom"||t.modelSource==="ark"?t.modelSource:void 0,modelProvider:En(t.modelProvider),modelApiBase:En(t.modelApiBase),builtinTools:xv(t.builtinTools).filter(f=>LRe.has(f)),customTools:$Re(t.customTools),mcpTools:d,a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,memory:{shortTerm:al(n.shortTerm),longTerm:al(n.longTerm)},shortTermBackend:wv(t.shortTermBackend,IRe,"local"),longTermBackend:wv(t.longTermBackend,PRe,"local"),longTermMemoryIndex:En(t.longTermMemoryIndex),autoSaveSession:al(t.autoSaveSession),knowledgebase:al(t.knowledgebase),knowledgebaseBackend:wv(t.knowledgebaseBackend,DRe,nm),knowledgebaseIndex:En(t.knowledgebaseIndex),tracing:al(t.tracing),tracingExporters:xv(t.tracingExporters).filter(f=>MRe.has(f)),deployment:{feishuEnabled:al(i.feishuEnabled),runtimeName:En(i.runtimeName),runtimeNameCustomized:al(i.runtimeNameCustomized)||!!En(i.runtimeName).trim(),modelApiKeyId:En(i.modelApiKeyId),modelApiKeyName:En(i.modelApiKeyName),...Object.keys(r).length>0?{envValues:r}:{}},cloudEnvironment:{environmentId:En(s.environmentId),environmentVersionId:En(s.environmentVersionId),cliTools:zFt(s.cliTools),...typeof s.dockerfile=="string"?{dockerfile:s.dockerfile}:{}},harnessSidecar:HFt(t.harnessSidecar),subAgents:zRe(t.subAgents,u),selectedSkills:VRe(t)}}function HRe(e,t=e.cloudProvider??"volcengine"){const n=e.cloudProvider??t,i=new Set(bOe(n).map(r=>r.id));return{...e,builtinTools:(e.builtinTools??[]).filter(r=>i.has(r)),tracing:!1,tracingExporters:[],memory:{shortTerm:!1,longTerm:!1},shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebase:!1,knowledgebaseBackend:nm,knowledgebaseIndex:"",subAgents:e.subAgents.map(r=>HRe(r,n))}}const WFt=/^[A-Za-z_][A-Za-z0-9_]*$/,KI=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Ine(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function GFt(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function d1(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&WFt.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(KI))==null?void 0:r[1])??""}function dj(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)dj(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])dj(i.agent,t)}function qRe(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 KFt(e,t){let n=e.name.trim();if(!n){const i=qRe(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 WRe(e){const t=new Set,n=new Set;let i=null;const r=s=>{var a;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=KFt(l,c),d=qRe(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),(a=s.workflow)==null||a.nodes.forEach(l=>r(l.agent)))};return r(e),i}function XFt(e){const t=new Set;return dj(e,n=>{const i=d1(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function GRe(e){const t=new Set;return dj(e,n=>{const i=d1(n);i&&t.add(i)}),[...t]}function YFt(e,t){const n=new Set(GRe(t));return[...new Set(e)].filter(i=>!n.has(i))}function ZFt(e){if(e.credentialUpdate==="pending")return"";if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=d1(e);return t?`\${${t}}`:""}function JFt(e,t){if(!t){if(e.authToken){const r={...e,credentialConfigured:!1};return delete r.authToken,delete r.authTokenEnv,r}if(e.credentialConfigured){const r={...e};return delete r.authToken,r}const i={...e};return delete i.authToken,delete i.authTokenEnv,i}const n=t.trim().match(KI);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&d1(e)===n[1],...e.credentialSourceUrl?{credentialUpdate:"replace"}:{}};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1,...e.credentialSourceUrl?{credentialUpdate:"replace"}:{}}}function e7t(e){const t={...e,credentialConfigured:!1};return delete t.authToken,delete t.authTokenEnv,t}function t7t(e){if(!e.trim())return!1;try{return!new URL(e).pathname.replace(/\/+$/,"").endsWith("/mcp")}catch{return!1}}function Pne(e){return(e??"").trim().replace(/\/+$/,"")}function KRe(e){return e.credentialUpdate==="pending"}function n7t(e,t){var s;const n=e.credentialSourceUrl??(e.credentialConfigured?((s=e.url)==null?void 0:s.trim())??"":""),i=e.credentialSourceAuthTokenEnv??(e.credentialConfigured?d1(e):"");if(!n||!i)return{...e,url:t};if(Pne(t)===Pne(n)){const a={...e,url:t,authTokenEnv:i,credentialConfigured:!0,credentialSourceUrl:n,credentialSourceAuthTokenEnv:i};return delete a.authToken,delete a.credentialUpdate,a}const r={...e,url:t,authTokenEnv:i,credentialConfigured:!1,credentialSourceUrl:n,credentialSourceAuthTokenEnv:i,credentialUpdate:"pending"};return delete r.authToken,r}function i7t(e){return e.credentialSourceAuthTokenEnv?{...e,authTokenEnv:e.credentialSourceAuthTokenEnv,credentialConfigured:!1,credentialUpdate:"reuse"}:e}function I8(e){const t={...e,credentialConfigured:!1,credentialUpdate:"replace"};return delete t.authToken,delete t.authTokenEnv,t}function r7t(e){const t=I8(e);return t.credentialUpdate="remove",t}function s7t(e){const t=KE(e),n={},i=a=>{var l,c;Object.assign(n,((l=a.deployment)==null?void 0:l.envValues)??{}),a.subAgents.forEach(i),(c=a.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=a=>{var l,c,u;for(const d of a.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:a.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}a.subAgents.forEach(s),(u=a.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function a7t(e){const t=[],n=i=>{var r,s,a;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||KI.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),(a=i.workflow)==null||a.nodes.forEach(l=>n(l.agent))};return n(e),t}function Dne(e){const t=[],n=i=>{var r,s,a;for(const l of i.mcpTools??[]){const c=((r=l.credentialSourceAuthTokenEnv)==null?void 0:r.trim())??"";l.transport==="http"&&l.credentialUpdate==="reuse"&&c&&t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",sourceAuthTokenEnv:c})}i.subAgents.forEach(n),(a=i.workflow)==null||a.nodes.forEach(l=>n(l.agent))};return n(e),t}function KE(e){const t=new Set,n={},i=r=>{var u;const s=Ine(r.name,"AGENT"),a=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,x;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((x=h.match(KI))==null?void 0:x[1])??"";let b=d1(d);if(!b&&h){const O=Ine(d.name,`TOOL_${f+1}`);b=GFt(`MCP_${s}_${O}_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,delete v.credentialUpdate,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,...a?{mcpTools:a}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const o7t={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"};function XRe(e,t=!0){var i,r,s,a,l,c,u,d,f,h,m,g,b,v,y,x,O,w,k,S,E,C,N,_,j,A,F,T,P,R,L,M,U,I,H,K,Q,q,B,ee,le,se,re,ge;const n={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((i=e.a2aRegistry)!=null&&i.enabled){const W=VR(e.cloudProvider??"volcengine"),X={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(X.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),X.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||W.topK,X.registryRegion=((a=e.a2aRegistry.registryRegion)==null?void 0:a.trim())||W.region,X.registryEndpoint=((l=e.a2aRegistry.registryEndpoint)==null?void 0:l.trim())||W.endpoint,n.a2aRegistry=X}return n}if(n.name=e.name,n.description=e.description,n.instruction=e.instruction,e.agentType==="loop"&&(n.maxIterations=e.maxIterations??3),(c=e.modelName)!=null&&c.trim()&&(n.modelName=e.modelName.trim()),e.modelSource&&(n.modelSource=e.modelSource),e.modelSource!=="ark"&&((u=e.modelProvider)!=null&&u.trim()&&(n.modelProvider=e.modelProvider.trim()),(d=e.modelApiBase)!=null&&d.trim()&&(n.modelApiBase=e.modelApiBase.trim())),(f=e.builtinTools)!=null&&f.length&&(n.builtinTools=[...e.builtinTools]),(h=e.customTools)!=null&&h.length&&(n.customTools=e.customTools.map(W=>({name:W.name,description:W.description}))),(m=e.mcpTools)!=null&&m.length&&(n.mcpTools=e.mcpTools.map(W=>{var ae,ue,Oe,ke;const X={name:W.name,transport:W.transport};return(ae=W.url)!=null&&ae.trim()&&(X.url=W.url.trim()),(ue=W.authTokenEnv)!=null&&ue.trim()&&(X.authTokenEnv=W.authTokenEnv.trim()),(Oe=W.command)!=null&&Oe.trim()&&(X.command=W.command.trim()),(ke=W.args)!=null&&ke.length&&(X.args=W.args),X})),((g=e.memory)!=null&&g.shortTerm||(b=e.memory)!=null&&b.longTerm)&&(n.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(n.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(n.longTermBackend=e.longTermBackend||"local",(v=e.longTermMemoryIndex)!=null&&v.trim()&&(n.longTermMemoryIndex=e.longTermMemoryIndex.trim()),n.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(n.knowledgebase=!0,n.knowledgebaseBackend=e.knowledgebaseBackend||"viking",(y=e.knowledgebaseIndex)!=null&&y.trim()&&(n.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((x=e.tracingExporters)!=null&&x.length)&&(n.tracing=!0,n.tracingExporters=[...e.tracingExporters]),t&&((O=e.harnessSidecar)!=null&&O.enabled)&&(n.harnessSidecar={enabled:!0,profile:e.harnessSidecar.profile,componentOverrides:{...e.harnessSidecar.componentOverrides}}),((w=e.cloudEnvironment)!=null&&w.environmentId||(k=e.cloudEnvironment)!=null&&k.environmentVersionId||(E=(S=e.cloudEnvironment)==null?void 0:S.cliTools)!=null&&E.length||((C=e.cloudEnvironment)==null?void 0:C.dockerfile)!==void 0)&&(n.cloudEnvironment={environmentId:e.cloudEnvironment.environmentId,environmentVersionId:e.cloudEnvironment.environmentVersionId,...(N=e.cloudEnvironment.cliTools)!=null&&N.length?{cliTools:[...e.cloudEnvironment.cliTools]}:{},...e.cloudEnvironment.dockerfile!==void 0?{dockerfile:e.cloudEnvironment.dockerfile}:{}}),(_=e.deployment)!=null&&_.feishuEnabled||(A=(j=e.deployment)==null?void 0:j.runtimeName)!=null&&A.trim()||(F=e.deployment)!=null&&F.runtimeNameCustomized||(P=(T=e.deployment)==null?void 0:T.modelApiKeyId)!=null&&P.trim()||(L=(R=e.deployment)==null?void 0:R.modelApiKeyName)!=null&&L.trim()||Object.keys(((M=e.deployment)==null?void 0:M.envValues)??{}).length>0){const W={feishuEnabled:!!((U=e.deployment)!=null&&U.feishuEnabled)};(H=(I=e.deployment)==null?void 0:I.runtimeName)!=null&&H.trim()&&(W.runtimeName=e.deployment.runtimeName.trim()),(K=e.deployment)!=null&&K.runtimeNameCustomized&&(W.runtimeNameCustomized=!0),(q=(Q=e.deployment)==null?void 0:Q.modelApiKeyId)!=null&&q.trim()&&(W.modelApiKeyId=e.deployment.modelApiKeyId.trim()),(ee=(B=e.deployment)==null?void 0:B.modelApiKeyName)!=null&&ee.trim()&&(W.modelApiKeyName=e.deployment.modelApiKeyName.trim()),Object.keys(((le=e.deployment)==null?void 0:le.envValues)??{}).length>0&&(W.envValues={...(se=e.deployment)==null?void 0:se.envValues}),n.deployment=W}return(re=e.selectedSkills)!=null&&re.length&&(n.selectedSkills=e.selectedSkills.map(W=>{const X={source:W.source,name:W.name,folder:W.folder};return W.description&&(X.description=W.description),W.source==="skillhub"?(X.slug=W.slug,X.namespace=W.namespace??"public"):W.source==="local"?X.localFiles=W.localFiles??[]:W.source==="skillspace"&&(X.skillSpaceId=W.skillSpaceId,X.skillSpaceName=W.skillSpaceName,X.skillId=W.skillId,W.version&&(X.version=W.version)),X})),(ge=e.subAgents)!=null&&ge.length&&(n.subAgents=e.subAgents.map(W=>XRe(W,!1))),n}function l7t(e,t=o7t){var s;const n=KE(e),i={...((s=n.draft.deployment)==null?void 0:s.envValues)??{},...n.envValues},r={...n.draft,deployment:{...n.draft.deployment??{feishuEnabled:!1},envValues:i}};return`# ${t.heading} +`).length:0,truncated:!1,updatedAt:Date.now(),pendingMessage:Qt==="running"?B("projectPreview.task.waitingGithubLog"):void 0},Ge},ds=()=>{if(!(_t!=="build"||!(we!=null&&we.text)))return we={...we,status:"error",updatedAt:Date.now()},we},$n=Sn=>_t==="build"&&(we!=null&&we.text)?qg(we.text,{preserveEnd:!0}):qg(Sn);try{let Sn=Ue;if(g&&(Ue!=null&&Ue.pipelineId)){_t="github";const si=zn(B("projectPreview.task.syncingGithub")),fs={level:"info",phase:"github",message:B("projectPreview.task.syncingGithub"),pct:0};Jn.current&&(Rt(hs=>({...hs,github:fs})),Z("github")),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.syncGithubCode"),message:fs.message,pct:0,githubDelivery:!0,githubLog:si});const or=await $0e({runtimeId:g,project:e});if(Sn=or,Jn.current&&(Ke(or),Rt(hs=>({...hs,github:{level:"success",phase:"github",message:B("projectPreview.task.githubSynced"),pct:100}})),Z(null)),(ca=or.cicd)!=null&&ca.enabled){O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"success",phase:"github",label:B("projectPreview.task.githubSubmitted"),message:B("projectPreview.task.githubUpdatingRuntime"),pct:100,githubDelivery:!0,githubLog:zn(B("projectPreview.task.githubUpdatingRuntime"),"complete")});return}}const Qt=await c(e,si=>{var or;si.runtimeName&&(Dt=si.runtimeName);const fs=iFt(_t,si.phase);si.buildLog?we=Z9t(we,si.buildLog):si.phase==="build"&&!we&&(we=Kn()),si.phase===fs&&(un=si.message,Nn=si.messageCode),_t=fs,Jn.current&&(Rt(hs=>({...hs,[si.phase]:si})),Z(_t)),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",phase:_t,label:((or=tn.find(hs=>hs.phase===_t))==null?void 0:or.label)??_t,message:un,messageCode:Nn,pct:si.pct,...we?{buildLog:we}:{}})},{taskId:Ye,runtimeName:_n,sessionStorage:W?"in-memory":"persistent",minInstance:Xi.min,maxInstance:Xi.max,...re?{}:{authentication:xs==="user_pool"?{type:"user_pool",userPoolUid:ia}:{type:"api_key"}},createEvaluationSets:Ua,...w?{im:{feishu:{enabled:!0}}}:{},envs:be,...re?{}:{resources:oi}});if(!g&&ft&&Qt.runtimeId){_t="github";const si=zn(B("projectPreview.task.initializingGithub")),fs={level:"info",phase:"github",message:B("projectPreview.task.initializingGithubBranch"),pct:0};Jn.current&&(Rt(or=>({...or,github:fs})),Z("github")),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.mountGithubDelivery"),message:fs.message,pct:0,githubDelivery:!0,githubLog:si});try{const or=await D0e({project:e,githubUrl:ft.githubUrl,githubToken:ft.githubToken,baseBranch:ft.baseBranch,runtimeName:Qt.agentName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,cloudProvider:ft.cloudProvider,projectPath:".",volcengineAccessKey:ft.volcengineAccessKey,volcengineSecretKey:ft.volcengineSecretKey,volcengineSessionToken:ft.volcengineSessionToken});Sn=or,Jn.current&&(Ke(or),ut(null),Rt(hs=>({...hs,github:{level:"success",phase:"github",message:B("projectPreview.task.githubBranchInitialized"),pct:100}})),Z(null)),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"running",phase:"github",label:B("projectPreview.task.githubDeliveryMounted"),message:B("projectPreview.task.githubBranchInitialized"),pct:100,githubDelivery:!0,githubLog:zn(B("projectPreview.task.githubBranchInitialized"),"complete")})}catch(or){const hs=zn(B("projectPreview.task.githubMountFailedDetail",{message:or instanceof Error?or.message:String(or)}),"error");throw O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId,region:Qt.region||L,startedAt:fn,status:"error",phase:"github",label:B("projectPreview.task.githubMountFailed"),message:B("projectPreview.task.githubMountFailedHint"),pct:100,githubDelivery:!0,githubLog:hs}),new Error(B("projectPreview.errors.deployedButGithubMountFailed",{message:or instanceof Error?or.message:String(or)}))}}else if(!g&&(Sn!=null&&Sn.pipelineId)&&Qt.runtimeId)try{const si=await n7({pipelineId:Sn.pipelineId,runtimeId:Qt.runtimeId,region:Qt.region||L,cloudProvider:Sn.cloudProvider??R});Sn=si,Jn.current&&Ke(si)}catch(si){Jn.current&&Mt(B("projectPreview.errors.deployedButGithubBindFailed",{message:si instanceof Error?si.message:String(si)}))}Jn.current&&(ye(Qt),Z(null)),On.succeed({runtimeId:String(Qt.runtimeId||g||"")}),O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId||g,region:Qt.region||L,startedAt:fn,status:"success",phase:"complete",label:B("projectPreview.task.deploymentComplete"),message:(lt=Qt.warnings)==null?void 0:lt.join(B("environmentCenter.listSeparator")),githubDelivery:!!(ft||Ge),...Ge?{githubLog:Ge}:{},...Ri("complete")});try{await(d==null?void 0:d(Qt))}catch(si){if(!(si instanceof Ds))throw si;O==null||O({id:Ye,agentName:Qt.agentName||Ct,runtimeName:Qt.runtimeName||Dt,runtimeId:Qt.runtimeId||g,region:Qt.region||L,startedAt:fn,status:"success",phase:"complete",label:B("projectPreview.task.deployedNotConnected"),message:si.message,...Ri("complete")})}}catch(Sn){const Qt=Sn instanceof Error?Sn.message:String(Sn);if(Sn instanceof DOMException&&Sn.name==="AbortError"){On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:qg(Sn)}),Jn.current&&(Mt(null),Z(null)),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"cancelled",label:B("projectPreview.task.cancelled"),message:B("projectPreview.task.cancelledHint"),...Ri("complete")});return}if(Pbe(Sn)){Jn.current&&(Mt(null),ye(null),cn(!0)),On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:qg(Sn)}),O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"running",statusUnconfirmed:!0,phase:_t,label:B("projectPreview.task.deploymentStatusUnconfirmed"),message:B("projectPreview.errors.deploymentStatusUnconfirmed"),...we?{buildLog:we}:{}});return}Jn.current&&Mt(Qt),Jn.current&&ye(null);const fs=ds();On.fail({failedPhase:OL(_t),...Wa(Sn,{phase:_t}),errorMessage:$n(Sn)});const or=!!fs,hs=_t==="github"&&!!Ge;O==null||O({id:Ye,agentName:Ct,runtimeName:Dt,runtimeId:g,region:L,startedAt:fn,status:"error",phase:_t,label:B("projectPreview.task.deploymentFailed"),message:or?B("projectPreview.task.buildFailedHint"):hs?B("projectPreview.task.githubMountFailedHint"):Qt,...fs?{buildLog:fs}:Ri("complete"),...hs?{githubDelivery:!0,githubLog:Ge}:{},retry:Hn})}finally{Jn.current&&Wt(!1)}}function nd(){jt(!1)}async function vc(){if(!(!$e||Bt)){Qe(!0),Mt(null);try{const{addConnection:be,addRuntimeConnection:Ye,remoteAppId:Ct,loadConnections:_n}=await Md(async()=>{const{addConnection:On,addRuntimeConnection:Y,remoteAppId:we,loadConnections:Ge}=await Promise.resolve().then(()=>pte);return{addConnection:On,addRuntimeConnection:Y,remoteAppId:we,loadConnections:Ge}},void 0),{probeRuntimeApps:Dt}=await Md(async()=>{const{probeRuntimeApps:On}=await Promise.resolve().then(()=>lUe);return{probeRuntimeApps:On}},void 0);let fn;if($e.runtimeId){const On=$e.region??L,Y=await Dt($e.runtimeId,On,{retryProbe:!0})??[];fn=Ye($e.runtimeId,$e.runtimeName,On,Y,Y.length>0?{[Y[0]]:$e.agentName}:void 0,$e.version)}else fn=await be($e.agentName,$e.url,$e.apikey,"");if(fn.apps.length===0)Mt(B("projectPreview.errors.noAgentAtEndpoint"));else{const On={[fn.apps[0]]:$e.agentName},Y={...fn,appLabels:{...fn.appLabels??{},...On}},Ge=_n().map(un=>un.id===fn.id?Y:un);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(Ge));const{registerConnections:_t}=await Md(async()=>{const{registerConnections:un}=await Promise.resolve().then(()=>pte);return{registerConnections:un}},void 0);if(_t(Ge),u){const un=Ct(fn.id,fn.apps[0]);await u(un,$e.agentName)}else alert(B("projectPreview.agentAdded",{name:$e.agentName}))}}catch(be){Mt(B("projectPreview.errors.addAgent",{message:be instanceof Error?be.message:String(be)}))}finally{Qe(!1)}}}function du(){const be=Hs(),Ye=oRe({agentId:be.agentId,deployAction:be.deployAction,deploySource:be.deploySource,createMode:be.createMode,aiAssisted:be.aiAssisted});try{const Ct=M9t(e.files),_n=URL.createObjectURL(Ct),Dt=document.createElement("a");Dt.href=_n,Dt.download=`${e.name||"project"}.zip`,document.body.appendChild(Dt),Dt.click(),document.body.removeChild(Dt),URL.revokeObjectURL(_n),Ye.succeed({fileCount:e.files.length,zipSizeBytes:Ct.size})}catch(Ct){throw Ye.fail({fileCount:e.files.length,...Wa(Ct)}),Ct}}const us=o.jsxs("div",{className:`pp-artifact-actions${t?" is-rail":""}`,"aria-label":B("projectPreview.artifactActions"),children:[K&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:K,children:[o.jsx(b7e,{className:"pp-ic"}),B("projectPreview.exportYaml")]}),se&&l&&o.jsx(iSt,{project:e,onChange:l,className:"pp-artifact-source",label:B("projectPreview.viewSource")}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:du,children:[o.jsx(Yj,{className:"pp-ic"}),B("projectPreview.downloadSource")]})]});function Tl(be,Ye,Ct){return yFt(be,Ye===0).map(_n=>{const Dt=Ct?`${Ct}/${_n.name}`:_n.name,fn=_n.path!==void 0,On={paddingLeft:8+Ye*14};if(fn){const we=_n.path===_e;return o.jsxs("button",{type:"button",className:`pp-row pp-file${we?" pp-active":""}`,style:On,onClick:()=>Ze(_n.path),title:_n.path,children:[o.jsx(x7e,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:_n.name})]},Dt)}const Y=at.has(Dt);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:On,onClick:()=>Go(Dt),children:[o.jsx(Uk,{className:`pp-ic pp-chevron${Y?"":" pp-open"}`}),o.jsx(O7e,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:_n.name})]}),!Y&&Tl(_n,Ye+1,Dt)]},Dt)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${Q?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(xFt,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[I&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:I,children:[o.jsx(kbe,{className:"pp-ic"}),le]}),o.jsxs("span",{className:"pp-toolbar-title",children:[B("projectPreview.deployTitle",{name:r||e.name||B("projectPreview.unnamedAgent")}),s&&s>1?B("projectPreview.additionalAgentCount",{count:s}):""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!Q&&o.jsx("section",{className:"pp-release-overview","aria-label":B("projectPreview.releaseOverview"),children:o.jsxs("div",{className:`pp-release-preview${t?" is-embedded":""}`,children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[i&&o.jsx(LS,{draft:i,direction:"horizontal",selectedPath:[],onSelect:pp,onAdd:pp,onInsert:pp,onDelete:pp,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>gt(!0),"aria-label":B("projectPreview.expandFlow"),title:B("projectPreview.expand"),children:o.jsx(Ky,{"aria-hidden":!0})})]}),t&&us,!t&&o.jsxs("div",{className:"pp-release-info",children:[o.jsx("div",{className:"pp-release-card-head",children:B("projectPreview.agentOverview")}),o.jsxs("div",{className:"pp-release-info-body",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:r||e.name||B("projectPreview.unnamedAgent")}),(i==null?void 0:i.description)&&o.jsx("p",{className:"pp-release-description",title:i.description,children:i.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.agentCount")}),o.jsx("dd",{children:s??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.model")}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("common.description")}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.systemPrompt")}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.optimizations")}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join(B("environmentCenter.listSeparator")):B("projectPreview.notEnabled")})]}),a.effectiveOptimizations&&a.effectiveOptimizations.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.effectiveCapabilities")}),o.jsx("dd",{children:a.effectiveOptimizations.join(B("environmentCenter.listSeparator"))})]}),a.autoAddedOptimizations&&a.autoAddedOptimizations.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.automaticProtection")}),o.jsx("dd",{children:a.autoAddedOptimizations.join(B("environmentCenter.listSeparator"))})]}),a.planHash&&o.jsxs("div",{children:[o.jsx("dt",{children:B("projectPreview.planHash")}),o.jsx("dd",{className:"pp-release-fact-long",children:a.planHash})]})]})]})]}),us]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:B("projectPreview.files.preview")}),se&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:B("projectPreview.files.new"),onClick:()=>{ve(!0),Je("")},children:o.jsx(y7e,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[Se&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:He,onChange:be=>Je(be.target.value),onBlur:bc,onKeyDown:be=>{be.key==="Enter"&&bc(),be.key==="Escape"&&(ve(!1),Je(""))}}),e.files.length===0&&!Se?o.jsx("div",{className:"pp-empty",children:B("projectPreview.files.empty")}):Tl(_s,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:Si==null?void 0:Si.path,children:(Si==null?void 0:Si.path)??B("projectPreview.files.noneSelected")}),o.jsx("div",{className:"pp-actions",children:se&&Si&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:B("projectPreview.files.rename"),onClick:uu,children:o.jsx(N7e,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:B("common.delete"),onClick:To,children:o.jsx(pm,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:Si==null?o.jsx("div",{className:"pp-placeholder",children:B("projectPreview.files.selectToView")}):se?o.jsx("div",{className:"pp-codemirror",children:o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:B("projectPreview.files.loadingEditor")}),children:o.jsx(rFt,{value:Si.content,path:Si.path,onChange:ed})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:fFt(Si.content,Si.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":B("projectPreview.deploymentConfiguration"),children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:B("projectPreview.deploymentConfiguration")})}),o.jsxs("div",{className:"pp-config-scroll",children:[Q,!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("label",{className:"pp-config-label",htmlFor:as,children:B("projectPreview.runtimeName")}),o.jsxs("div",{className:"pp-runtime-name-field",children:[o.jsx("input",{id:as,className:"pp-runtime-name-input",value:ke,disabled:Ce||Ie||re,maxLength:64,autoComplete:"off","aria-label":B("projectPreview.runtimeName"),"aria-invalid":!!De,"aria-describedby":`${Lr}${De?` ${_r}`:""}`,onChange:be=>{const Ye=be.currentTarget.value;Me(null),Mt(null),y?y(Ye):Oe(Ye)}}),o.jsx("p",{id:Lr,className:"pp-config-note",children:B(re?"projectPreview.runtimeNamePreserved":"projectPreview.runtimeNameHint")}),De&&o.jsx("p",{id:_r,className:"pp-runtime-name-error",role:"alert",children:De})]})]}),!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.releaseRegion")}),jr(!1)]}),!Q&&o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"pp-config-section pp-auth-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.accessAuthentication")}),re?o.jsx("p",{className:"pp-config-note pp-auth-preserved-note",children:B("projectPreview.authenticationPreserved")}):o.jsxs("div",{className:"pp-auth-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:B("projectPreview.authenticationMethod")}),o.jsx(VE,{ariaLabel:B("projectPreview.authenticationAriaLabel"),value:xs,placeholder:B("projectPreview.authenticationPlaceholder"),options:cFt(B),disabled:Ce,onChange:be=>{Mt(null),os(be)}})]}),xs==="user_pool"&&o.jsxs("label",{children:[o.jsx("span",{children:B("projectPreview.userPool.label")}),o.jsx(lFt,{value:ia,disabled:Ce,onChange:be=>{Mt(null),Nr(be)}})]})]})]}),o.jsx(nFt,{project:e,region:L,cloudProvider:R,runtimeId:g,binding:Ue,showSetup:!re,onPendingCicdChange:ut,onBindingChange:Sa,disabled:Ce||Pe||q||!!n})]}),!Q&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.messageChannels")}),o.jsx(W9t,{enabled:w,updating:Pe,disabled:Ce||Ie||!k||!F,agentName:r||e.name,appId:j.FEISHU_APP_ID??"",appSecret:j.FEISHU_APP_SECRET??"",appIdConfigured:ge.has("FEISHU_APP_ID"),appSecretConfigured:ge.has("FEISHU_APP_SECRET"),onToggle:ci,onCredentialsChange:(be,Ye)=>{F==null||F(be,Ye)}})]}),!re&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.instanceSettings")}),o.jsxs("div",{className:"pp-instance-fields",children:[o.jsxs("label",{htmlFor:"runtime-min-instance",children:[o.jsx("span",{children:B("projectPreview.minInstances")}),o.jsx("input",{id:"runtime-min-instance",type:"number",min:"0",step:"1",inputMode:"numeric",value:Yr,disabled:Ce||he,"aria-invalid":!Xi.valid,onChange:be=>ra(be.currentTarget.value)})]}),o.jsxs("label",{htmlFor:"runtime-max-instance",children:[o.jsx("span",{children:B("projectPreview.maxInstances")}),o.jsx("input",{id:"runtime-max-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:sa,disabled:Ce||he,"aria-invalid":!Xi.valid,onChange:be=>ls(be.currentTarget.value)})]})]}),(W||he)&&o.jsx("p",{className:"pp-instance-note",role:"note",children:B(he?"projectPreview.sidecarSingleInstance":"projectPreview.inMemorySingleInstance")}),!Xi.valid&&o.jsx("p",{className:"pp-instance-error",role:"alert",children:Xi.error})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.network")}),Q&&jr(!0),re&&o.jsx("p",{className:"pp-config-note",children:B("projectPreview.networkPreserved")}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":B("projectPreview.networkMode"),children:["public","private","both"].map(be=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:be,checked:la===be,onChange:()=>Gh(be),disabled:Ce||re||!P}),o.jsx("span",{children:be==="public"?B("projectPreview.networkModes.public"):be==="private"?"VPC":B("projectPreview.networkModes.both")})]},be))}),la!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(T==null?void 0:T.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:Ce||re,onChange:be=>ce({vpcId:be.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:[B("projectPreview.subnetId")," ",o.jsx("small",{children:B("projectPreview.subnetHint")})]}),o.jsx("input",{value:(T==null?void 0:T.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:Ce||re,onChange:be=>ce({subnetIds:be.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(T!=null&&T.enableSharedInternetAccess),disabled:Ce||re,onChange:be=>ce({enableSharedInternetAccess:be.target.checked})}),B("projectPreview.sharedInternetAccess")]})]})]})]}),ws&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.evaluationSets")}),o.jsxs("label",{className:"pp-evaluation-set-option",children:[o.jsx("input",{type:"checkbox",checked:va,disabled:Ce,onChange:be=>aa(be.currentTarget.checked)}),o.jsxs("span",{children:[o.jsx("strong",{children:B("projectPreview.createEvaluationSets")}),o.jsx("small",{children:B("projectPreview.createEvaluationSetsHint")})]})]})]}),!re&&o.jsxs("section",{className:"pp-config-section pp-resource-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.resourceConfiguration")}),o.jsx(Mje,{value:oi,agentName:r||e.name||"agentkit-app",runtimeName:ke,region:L,disabled:Ce,validationError:mi,onChange:be=>{Oi(be),bn(null)}})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsx("div",{className:"pp-env-head",children:o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:[B("projectPreview.environmentVariables"),o.jsx("span",{className:"pp-agent-child-count pp-env-count",children:B("projectPreview.itemCount",{count:cs})})]}),o.jsx("div",{className:"pp-env-sub",children:B("projectPreview.environmentVariablesHint")})]})}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:td,disabled:Ce,children:[o.jsx(Fo,{className:"pp-ic"}),B("projectPreview.addVariable")]}),(wa.length>0||C.length>0||tt.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[wa.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:B("projectPreview.componentGenerated")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:wa.length})})]}),wa.map(be=>{const Ye=be.readOnly||be.key.startsWith("ENABLE_"),Ct=be.serverManaged&&be.key==="MODEL_AGENT_API_KEY",_n=Ct?so?Vi.value:B("projectPreview.injectedByApiKey"):be.value,Dt=uz(be,j),fn=en[be.key],On=`deployment-env-${be.key.toLowerCase()}-error`,Y=kne(be)||be.help||be.comment,we=be.multiline||be.format==="json";return o.jsxs("div",{className:`pp-env-row pp-env-row-derived${we?" is-multiline":""}`,children:[o.jsxs("div",{className:"pp-env-key-fixed pp-env-key-cell","aria-label":B("projectPreview.envNameAriaLabel",{key:be.key}),"aria-disabled":Ce,children:[o.jsx("span",{title:be.key,children:be.key}),Y&&o.jsxs("span",{className:"pp-env-help",tabIndex:0,"data-help":Y,"aria-label":B("projectPreview.envDescriptionAriaLabel",{key:be.key,description:Y}),children:["?",o.jsx("span",{className:"pp-env-help-popover",role:"tooltip",children:Y})]}),be.link&&o.jsx("a",{className:"pp-env-link",href:be.link.url,target:"_blank",rel:"noopener noreferrer",title:B("projectPreview.openOpenViking",{label:be.link.label}),"aria-label":B("projectPreview.openOpenVikingAriaLabel",{key:be.key,label:be.link.label}),children:o.jsx(gb,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"pp-env-value-wrap",children:[we?o.jsx("textarea",{ref:Ge=>{Ge?wn.current.set(be.key,Ge):wn.current.delete(be.key)},className:"pp-env-value pp-env-json-value",value:be.value,placeholder:be.placeholder||(be.required?B("projectPreview.requiredEmpty"):B("projectPreview.optionalEmpty")),readOnly:Ye,disabled:Ce||!Ye&&!A,autoComplete:"off",spellCheck:!1,"aria-invalid":!!(fn||Dt),"aria-describedby":fn?On:void 0,"aria-label":B("projectPreview.envValueAriaLabel",{key:be.key}),onChange:Ge=>{const _t=Ge.currentTarget.value;A==null||A(be.key,_t),fn&&_t.trim()&&(Oa(be.key),Mt(null))}}):o.jsxs("div",{className:Ct?"pp-env-secret-control":void 0,children:[o.jsx("input",{ref:Ge=>{Ge?wn.current.set(be.key,Ge):wn.current.delete(be.key)},className:"pp-env-value",type:Ct?"text":be.secret?"password":"text",value:_n,placeholder:be.placeholder||(be.required?B("projectPreview.requiredEmpty"):B("projectPreview.optionalEmpty")),readOnly:Ye,disabled:Ce||!Ye&&!A,autoComplete:be.secret?"new-password":"off",spellCheck:be.secret?!1:void 0,"aria-invalid":!!(fn||Dt),"aria-describedby":fn?On:void 0,"aria-label":B("projectPreview.envValueAriaLabel",{key:be.key}),onChange:Ge=>{const _t=Ge.currentTarget.value;A==null||A(be.key,_t),fn&&_t.trim()&&(Oa(be.key),Mt(null))}}),Ct&&o.jsx("button",{type:"button",className:"pp-env-secret-toggle","aria-label":ao,title:ao,"aria-pressed":so,disabled:Vi.status==="loading"||!J,onClick:()=>{so?In():mr()},children:Vi.status==="loading"?o.jsx(fi,{className:"pp-env-secret-spinner","aria-hidden":"true"}):so?o.jsx(aFt,{}):o.jsx(sFt,{})})]}),fn&&o.jsx("span",{id:On,className:"pp-env-error",role:"alert",children:fn}),Dt&&o.jsx("span",{className:"pp-env-error",children:Dt}),Ct&&Vi.status==="error"&&o.jsx("span",{className:"pp-env-reveal-error",role:"alert",children:Vi.error})]}),o.jsx("span",{className:"pp-env-source",children:B(Ye?"projectPreview.automatic":"projectPreview.synced")})]},be.key)})]}),C.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:B("projectPreview.customModelCredentials")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:C.length})})]}),C.map(be=>{const Ye=pn===be.key,Ct=`${be.key.toLowerCase()}-error`;return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("label",{className:"pp-env-key-fixed pp-env-key-cell",htmlFor:be.key,title:be.label,children:o.jsx("span",{children:be.key})}),o.jsxs("div",{className:"pp-env-value-wrap",children:[o.jsx("input",{id:be.key,className:"pp-env-value",type:"password",value:Pt[be.key]??"",placeholder:B("projectPreview.releaseOnlySecret"),disabled:Ce,autoComplete:"new-password",spellCheck:!1,"aria-invalid":Ye,"aria-describedby":Ye?Ct:void 0,"aria-label":be.label,onChange:_n=>{const Dt=_n.currentTarget.value;_?_(be.key,Dt):Fe(fn=>({...fn,[be.key]:Dt})),Ye&&Dt.trim()&&(Jt(null),Mt(null))}}),Ye&&o.jsx("span",{id:Ct,className:"pp-env-error",role:"alert",children:B("projectPreview.errors.modelApiKeyRequired")})]}),o.jsx("span",{className:"pp-env-source",children:B("projectPreview.thisRelease")})]},be.key)})]}),tt.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:B("projectPreview.customVariables")}),o.jsx("small",{children:B("projectPreview.itemCount",{count:tt.length})})]}),tt.map(be=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:be.key,placeholder:B("common.name"),disabled:Ce,autoComplete:"off",onChange:Ye=>yc(be.id,{key:Ye.currentTarget.value})}),o.jsx("input",{type:"text",value:be.value,placeholder:B("projectPreview.value"),disabled:Ce,autoComplete:"off",onChange:Ye=>yc(be.id,{value:Ye.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:B("projectPreview.deleteVariable"),disabled:Ce,onClick:()=>Cl(be.id),children:o.jsx(Ba,{className:"pp-ic"})})]},be.id))]})]}),(Ce||$e||Object.keys(Gt).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:B("projectPreview.deploymentProgress")}),o.jsx("ol",{className:"pp-steps",children:tn.map((be,Ye)=>{const Ct=zt?tn.findIndex(On=>On.phase===zt):-1,_n=!!bt&&(Ct===-1?Ye===0:Ye===Ct),Dt=Gt[be.phase];let fn;return $e||(Dt==null?void 0:Dt.level)==="success"?fn="done":_n?fn="failed":Ct===-1?fn=Ce?"active":"pending":Yebe.phase===zt))==null?void 0:Al.label)??zt,message:bt}):bt,onRetry:Hn,retryLabel:B(re?"projectPreview.retryUpdate":"projectPreview.retryDeploy")}),ln&&o.jsxs("div",{className:"pp-status-unconfirmed",role:"status",children:[o.jsx("strong",{children:B("projectPreview.task.deploymentStatusUnconfirmed")}),o.jsx("span",{children:B("projectPreview.errors.deploymentStatusUnconfirmed")})]}),$e&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:B(re?"projectPreview.updateSucceeded":"projectPreview.deploySucceeded")}),o.jsxs("div",{className:"pp-deploy-result-body",children:[$e.warnings&&$e.warnings.length>0&&o.jsx("div",{className:"pp-deploy-result-warning",role:"status",children:$e.warnings.map(be=>o.jsx("span",{children:be},be))}),$e.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.region")}),o.jsx("code",{children:xh($e.region,R)})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.agentName")}),o.jsx("code",{children:$e.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.runtimeName")}),o.jsx("code",{children:$e.runtimeName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:B("projectPreview.apiEndpoint")}),o.jsx("code",{className:"pp-deploy-result-url",children:$e.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:vc,disabled:Bt,children:[Bt?o.jsx(fi,{className:"pp-ic spin"}):o.jsx(_be,{className:"pp-ic"}),B(Bt?"projectPreview.connecting":"projectPreview.chatNow")]}),$e.consoleUrl&&o.jsxs("a",{href:$e.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(gb,{className:"pp-ic"}),B("projectPreview.console")]})]})]})]}),o.jsx("div",{className:`pp-config-actions${oa?" is-external":""}`,children:oa?Li.createPortal(o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Hn,disabled:Ce||ln||Ie||Pe||q||!!n||!!De,title:n||De||void 0,children:Ce?B("projectPreview.actionInProgress",{action:ee}):ln?B("projectPreview.task.deploymentStatusUnconfirmed"):Ie?B("projectPreview.checkingName"):bt?B("projectPreview.retryAction",{action:ee}):ee}),oa):o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Hn,disabled:Ce||ln||Ie||Pe||q||!!n||!!De,title:n||De||void 0,children:Ce?B("projectPreview.actionInProgress",{action:ee}):ln?B("projectPreview.task.deploymentStatusUnconfirmed"):Ie?B("projectPreview.checkingName"):bt?B("projectPreview.retryAction",{action:ee}):ee})})]})]}),ot&&i&&Li.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:be=>{be.target===be.currentTarget&>(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":B("projectPreview.flowPreview"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:B("projectPreview.executionFlow")}),o.jsx("span",{children:B("projectPreview.flowPreviewHint")})]}),o.jsx("button",{type:"button",onClick:()=>gt(!1),"aria-label":B("projectPreview.closeFlowPreview"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(LS,{draft:i,direction:"horizontal",selectedPath:[],onSelect:pp,onAdd:pp,onInsert:pp,onDelete:pp,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(oFt,{open:Ot,isUpdate:re,...h,onCancel:nd,onConfirm:()=>void ji()})]})}const wFt=new Set(["MODEL_AGENT_API_KEY"]),OFt=new Set(["MODEL_AGENT_NAME","MODEL_NAME"]),SFt=new Set(["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY","VOLCENGINE_SESSION_TOKEN","BYTEPLUS_ACCESS_KEY","BYTEPLUS_SECRET_KEY","BYTEPLUS_SESSION_TOKEN","VEADK_DISABLE_EXPIRE_AT"]);function cb(e){return!SFt.has(e)}function kk(e){return wFt.has(e)||/(?:API_KEY|ACCESS_KEY|SECRET_KEY|PRIVATE_KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIAL)$/.test(e)}function kFt(e,t){const n={},i=new Set([...e.environment.required,...e.environment.optional]);for(const r of i){if(!cb(r)||kk(r))continue;const s=r==="MODEL_AGENT_API_BASE"?xl(t):OFt.has(r)?wh(t):e.environment.defaults[r];s!=null&&s.trim()&&(n[r]=s)}return n}function EFt({delivery:e,onBack:t,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,cloudProvider:a="volcengine",initialDeployRegion:l}){const{t:c}=Te("create"),[u,d]=p.useState(l??Ji(a)),[f,h]=p.useState(),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState(()=>({name:Yje(e.agentName),files:e.files??[]})),O=e.environment??{required:[],optional:[],defaults:{}},[w,k]=p.useState(()=>({...O.defaults})),S=O.required.filter(cb).filter(kk).map(j=>({key:j,label:j})),E=[...O.required.filter(cb).filter(j=>!kk(j)).map(j=>({key:j,required:!0,comment:j,placeholder:c("intelligentDeployment.env.requiredPlaceholder",{key:j})})),...O.optional.filter(cb).map(j=>({key:j,required:!1,comment:j,placeholder:c("intelligentDeployment.env.optionalPlaceholder",{key:j})}))],C=qE(y.name,j=>c(`validation.runtimeName.${j}`));p.useEffect(()=>{if(C){g(null);return}const j=new AbortController,A=window.setTimeout(()=>{v(!0),sR(y.name,u).then(F=>{j.signal.aborted||g(F.available===!0)}).catch(()=>{j.signal.aborted||g(null)}).finally(()=>{j.signal.aborted||v(!1)})},250);return()=>{window.clearTimeout(A),j.abort()}},[u,y.name,C]);const N={kind:"intelligentDevelopment",sessionId:e.sessionId,...e.projectId&&e.versionId?{projectId:e.projectId,versionId:e.versionId}:{},artifactSha256:e.artifactSha256,validationReportSha256:e.validationReportSha256,...e.verified?{}:{acknowledgeUnverified:!0}};async function _(j,A,F){const T=f&&f.mode!=="public"?{mode:f.mode,vpc_id:f.vpcId,subnet_ids:f.subnetIds,enable_shared_internet_access:f.enableSharedInternetAccess}:void 0;return Ax(j.name,[],{region:u,projectName:"default",network:T},{...F,onStage:A,runtimeName:j.name,source:N})}return o.jsx(WI,{cloudProvider:a,project:y,agentName:y.name,onDeploy:_,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,network:f,onNetworkChange:h,deployRegion:u,onDeployRegionChange:d,deploymentEnv:E,requiredSecretEnv:S,deploymentEnvValues:w,onDeploymentEnvChange:(j,A)=>k(F=>({...F,[j]:A})),deploymentActionLabel:c("common.deploy"),deployDisabled:!!C||m===!1||b,deployDisabledReason:C??(m===!1?c("intelligentDeployment.runtimeNameExists"):b?c("intelligentDeployment.checkingRuntimeName"):void 0),deploymentTelemetry:{source:"intelligent_development",createMode:"intelligent",aiAssisted:!0},onBack:t,backLabel:c("intelligentDeployment.back"),deploymentPrimaryPane:o.jsxs("section",{className:"trusted-source-pane","aria-label":e.verified?c("intelligentDeployment.verifiedSource"):c("intelligentDeployment.deployableSource"),children:[o.jsx("div",{className:"trusted-source-pane__badge",children:e.verified?c("intelligentDeployment.verifiedByCodex"):c("intelligentDeployment.deployableSource")}),o.jsx("h2",{children:e.agentName}),o.jsxs("label",{className:"trusted-source-pane__runtime-name",children:[o.jsx("span",{children:c("intelligentDeployment.runtimeName")}),o.jsx("input",{value:y.name,maxLength:64,onChange:j=>x(A=>({...A,name:j.target.value}))})]}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.files")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.artifact")}),o.jsx("dd",{children:o.jsx("code",{children:e.artifactSha256.slice(0,16)})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:c("intelligentDeployment.validationReport")}),o.jsx("dd",{children:o.jsx("code",{children:e.validationReportSha256.slice(0,16)})})]})]}),o.jsx("p",{children:e.verified?c("intelligentDeployment.verifiedHint"):c("intelligentDeployment.unverifiedHint")})]})})}const CFt="_Container_1tuad_1",TFt="_Checkbox_1tuad_22",AFt="_CheckMark_1tuad_92",_Ft="_Label_1tuad_162",O2={Container:CFt,Checkbox:TFt,CheckMark:AFt,Label:_Ft},fz=({className:e,label:t,id:n,disabled:i,orientation:r="left",...s})=>{const a=p.useId(),l=n??a;return o.jsxs("div",{"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-orientation":r,className:pi(e,O2.Container),children:[o.jsx(Lze,{className:O2.Checkbox,id:l,disabled:i,...s,children:o.jsx(Fze,{className:O2.CheckMark})}),t&&o.jsx("label",{htmlFor:l,className:O2.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},NFt="_RadioGroup_onrfm_1",jFt="_RadioLabel_onrfm_9",RFt="_RadioIndicatorWrapper_onrfm_26",IFt="_RadioItem_onrfm_43",PFt="_RadioIndicator_onrfm_26",Gw={RadioGroup:NFt,RadioLabel:jFt,RadioIndicatorWrapper:RFt,RadioItem:IFt,RadioIndicator:PFt},jRe=p.createContext(null),DFt=()=>{const e=p.use(jRe);if(!e)throw new Error("RadioGroup components must be wrapped in ");return e},Wg=({onChange:e,children:t,className:n,direction:i="row",disabled:r=!1,...s})=>{const a=p.useMemo(()=>({disabled:r,direction:i}),[r,i]);return o.jsx(jRe,{value:a,children:o.jsx(rWe,{className:pi(Gw.RadioGroup,n),"data-direction":i,onValueChange:e,disabled:r,...s,children:t})})},MFt=({value:e,disabled:t=!1,required:n,children:i,className:r,block:s=!1,...a})=>{const{disabled:l}=DFt(),c=l||t,u=p.useId(),d=`${e}-${u}`;return o.jsx("div",{className:"flex",...a,children:o.jsxs("label",{htmlFor:d,className:pi(Gw.RadioLabel,r),"data-disabled":c?"":void 0,"data-block":s?"":void 0,onMouseDown:f=>{!f.defaultPrevented&&f.detail>1&&f.preventDefault()},children:[o.jsx("div",{className:Gw.RadioIndicatorWrapper,children:o.jsx(lWe,{id:d,value:e,disabled:c,required:n,className:Gw.RadioItem,children:o.jsx(uWe,{className:Gw.RadioIndicator})})}),i]})})};Wg.Item=MFt;function LFt({className:e,...t}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),o.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}function uw(e,t){return{id:e,get label(){return $t(`traditional.agentTypes.${e}.fullLabel`)},get desc(){return $t(`traditional.agentTypes.${e}.description`)},icon:t}}const dw={llm:uw("llm",LFt),sequential:uw("sequential",S7e),parallel:uw("parallel",D7e),loop:uw("loop",Nbe),a2a:uw("a2a",Zj)},$Ft=[dw.llm,dw.sequential,dw.parallel,dw.loop,dw.a2a],RRe=e=>e==="sequential"||e==="parallel"||e==="loop",GI=e=>e==="a2a";function ub(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(i=>i==null?void 0:i.toLocaleLowerCase().includes(n)):!0}const IRe=new Set(["local","sqlite","mysql","postgresql"]),PRe=new Set(["local","opensearch","redis","viking","openviking","mem0"]),DRe=new Set(["opensearch","viking","context_search","openviking"]),MRe=new Set(["apmplus","cozeloop","tls"]),LRe=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),FFt=new Set(["llm","sequential","parallel","loop","a2a"]),BFt=new Set(["lark-cli","github-cli","pandoc"]),UFt=new Set(["default","ops"]);function En(e,t=""){return typeof e=="string"?e:t}function al(e){return e===!0}function QFt(e){return typeof e=="string"&&UFt.has(e)?e:"default"}function xv(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function zFt(e){return Array.from(new Set(xv(e).filter(t=>BFt.has(t))))}function VFt(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function $Re(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:En(t.name),description:En(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function wv(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function FRe(e){return typeof e=="string"&&FFt.has(e)?e:"llm"}function BRe(e){return e==="byteplus"?"byteplus":"volcengine"}function URe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function QRe(e){const t=e&&typeof e=="object"?e:{};return{enabled:al(t.enabled),registrySpaceId:En(t.registrySpaceId),registryTopK:En(t.registryTopK),registryRegion:En(t.registryRegion),registryEndpoint:En(t.registryEndpoint)}}function HFt(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=t.componentOverrides&&typeof t.componentOverrides=="object"?t.componentOverrides:{},i=Object.fromEntries(Ux.map(l=>[l,n[l]===!0])),r={enabled:Object.values(i).some(Boolean),profile:QFt(t.profile),componentOverrides:i},s=En(t.catalogVersion).trim(),a=En(t.planHash).trim();return s&&(r.catalogVersion=s),a&&(r.planHash=a),kB(r)}function zRe(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const i=n&&typeof n=="object"?n:{},r=BRe(i.cloudProvider??t),s=i.memory&&typeof i.memory=="object"?i.memory:{},a=QRe(i.a2aRegistry),l=FRe(i.agentType),c=a.enabled&&l==="llm"?"a2a":l;return{...oc(r),cloudProvider:r,name:En(i.name),description:En(i.description),instruction:En(i.instruction),agentType:c,maxIterations:URe(i.maxIterations),a2aUrl:En(i.a2aUrl),modelName:En(i.modelName),modelSource:i.modelSource==="custom"||i.modelSource==="ark"?i.modelSource:void 0,modelProvider:En(i.modelProvider),modelApiBase:En(i.modelApiBase),builtinTools:xv(i.builtinTools).filter(u=>LRe.has(u)),customTools:$Re(i.customTools),memory:{shortTerm:al(s.shortTerm),longTerm:al(s.longTerm)},shortTermBackend:wv(i.shortTermBackend,IRe,"local"),longTermBackend:wv(i.longTermBackend,PRe,"local"),longTermMemoryIndex:En(i.longTermMemoryIndex),autoSaveSession:al(i.autoSaveSession),knowledgebase:al(i.knowledgebase),knowledgebaseBackend:wv(i.knowledgebaseBackend,DRe,nm),knowledgebaseIndex:En(i.knowledgebaseIndex),tracing:al(i.tracing),tracingExporters:xv(i.tracingExporters).filter(u=>MRe.has(u)),a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,subAgents:zRe(i.subAgents,r),selectedSkills:VRe(i)}}):[]}function VRe(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const i=n&&typeof n=="object"?n:{},r=En(i.source),s=r==="local"||r==="skillspace"||r==="skillhub"||r==="runtime"?r:"skillhub",a=En(i.name)||En(i.slug)||En(i.skillName)||En(i.skillId)||"skill",l=En(i.folder)||a,c=En(i.description);if(s==="runtime"){if(l!==a)continue;t.push({source:s,folder:l,name:a,description:c});continue}if(s==="skillhub"){const f=En(i.slug);if(!f)continue;t.push({source:s,folder:l,name:a,description:c,slug:f,namespace:En(i.namespace)||"public"});continue}if(s==="local"){const h=(Array.isArray(i.localFiles)?i.localFiles:[]).map(m=>{const g=m&&typeof m=="object"?m:{},b=En(g.path),v=En(g.content);return b?{path:b,content:v}:null}).filter(m=>m!==null);if(h.length===0)continue;t.push({source:s,folder:l,name:a,description:c,localFiles:h});continue}const u=En(i.skillSpaceId),d=En(i.skillId);!u||!d||t.push({source:s,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:En(i.skillSpaceName),skillId:d,version:En(i.version)})}return t}function qFt(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},i=t.deployment&&typeof t.deployment=="object"?t.deployment:{},r=VFt(i.envValues),s=t.cloudEnvironment&&typeof t.cloudEnvironment=="object"?t.cloudEnvironment:{},a=QRe(t.a2aRegistry),l=FRe(t.agentType),c=a.enabled&&l==="llm"?"a2a":l,u=BRe(t.cloudProvider),d=Array.isArray(t.mcpTools)?t.mcpTools.map(f=>{const h=f&&typeof f=="object"?f:{},m=h.transport==="stdio"?"stdio":"http";return{name:En(h.name),transport:m,url:En(h.url),authToken:En(h.authToken),authTokenEnv:En(h.authTokenEnv),credentialConfigured:h.credentialConfigured===!0,command:En(h.command),args:xv(h.args)}}).filter(f=>f.transport==="http"?!!f.url:!!f.command):[];return{...oc(u),cloudProvider:u,name:En(t.name)||"my_agent",description:En(t.description),instruction:En(t.instruction)||"You are a helpful assistant.",dynamicAgentDelegation:al(t.dynamicAgentDelegation),agentType:c,maxIterations:URe(t.maxIterations),a2aUrl:En(t.a2aUrl),modelName:En(t.modelName),modelSource:t.modelSource==="custom"||t.modelSource==="ark"?t.modelSource:void 0,modelProvider:En(t.modelProvider),modelApiBase:En(t.modelApiBase),builtinTools:xv(t.builtinTools).filter(f=>LRe.has(f)),customTools:$Re(t.customTools),mcpTools:d,a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,memory:{shortTerm:al(n.shortTerm),longTerm:al(n.longTerm)},shortTermBackend:wv(t.shortTermBackend,IRe,"local"),longTermBackend:wv(t.longTermBackend,PRe,"local"),longTermMemoryIndex:En(t.longTermMemoryIndex),autoSaveSession:al(t.autoSaveSession),knowledgebase:al(t.knowledgebase),knowledgebaseBackend:wv(t.knowledgebaseBackend,DRe,nm),knowledgebaseIndex:En(t.knowledgebaseIndex),tracing:al(t.tracing),tracingExporters:xv(t.tracingExporters).filter(f=>MRe.has(f)),deployment:{feishuEnabled:al(i.feishuEnabled),runtimeName:En(i.runtimeName),runtimeNameCustomized:al(i.runtimeNameCustomized)||!!En(i.runtimeName).trim(),modelApiKeyId:En(i.modelApiKeyId),modelApiKeyName:En(i.modelApiKeyName),...Object.keys(r).length>0?{envValues:r}:{}},cloudEnvironment:{environmentId:En(s.environmentId),environmentVersionId:En(s.environmentVersionId),cliTools:zFt(s.cliTools),...typeof s.dockerfile=="string"?{dockerfile:s.dockerfile}:{}},harnessSidecar:HFt(t.harnessSidecar),subAgents:zRe(t.subAgents,u),selectedSkills:VRe(t)}}function HRe(e,t=e.cloudProvider??"volcengine"){const n=e.cloudProvider??t,i=new Set(bOe(n).map(r=>r.id));return{...e,builtinTools:(e.builtinTools??[]).filter(r=>i.has(r)),tracing:!1,tracingExporters:[],memory:{shortTerm:!1,longTerm:!1},shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebase:!1,knowledgebaseBackend:nm,knowledgebaseIndex:"",subAgents:e.subAgents.map(r=>HRe(r,n))}}const WFt=/^[A-Za-z_][A-Za-z0-9_]*$/,KI=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Ine(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function GFt(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function d1(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&WFt.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(KI))==null?void 0:r[1])??""}function dj(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)dj(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])dj(i.agent,t)}function qRe(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 KFt(e,t){let n=e.name.trim();if(!n){const i=qRe(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 WRe(e){const t=new Set,n=new Set;let i=null;const r=s=>{var a;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=KFt(l,c),d=qRe(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),(a=s.workflow)==null||a.nodes.forEach(l=>r(l.agent)))};return r(e),i}function XFt(e){const t=new Set;return dj(e,n=>{const i=d1(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function GRe(e){const t=new Set;return dj(e,n=>{const i=d1(n);i&&t.add(i)}),[...t]}function YFt(e,t){const n=new Set(GRe(t));return[...new Set(e)].filter(i=>!n.has(i))}function ZFt(e){if(e.credentialUpdate==="pending")return"";if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=d1(e);return t?`\${${t}}`:""}function JFt(e,t){if(!t){if(e.authToken){const r={...e,credentialConfigured:!1};return delete r.authToken,delete r.authTokenEnv,r}if(e.credentialConfigured){const r={...e};return delete r.authToken,r}const i={...e};return delete i.authToken,delete i.authTokenEnv,i}const n=t.trim().match(KI);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&d1(e)===n[1],...e.credentialSourceUrl?{credentialUpdate:"replace"}:{}};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1,...e.credentialSourceUrl?{credentialUpdate:"replace"}:{}}}function e7t(e){const t={...e,credentialConfigured:!1};return delete t.authToken,delete t.authTokenEnv,t}function t7t(e){if(!e.trim())return!1;try{return new URL(e).pathname.replace(/\/+$/,"")===""}catch{return!1}}function Pne(e){return(e??"").trim().replace(/\/+$/,"")}function KRe(e){return e.credentialUpdate==="pending"}function n7t(e,t){var s;const n=e.credentialSourceUrl??(e.credentialConfigured?((s=e.url)==null?void 0:s.trim())??"":""),i=e.credentialSourceAuthTokenEnv??(e.credentialConfigured?d1(e):"");if(!n||!i)return{...e,url:t};if(Pne(t)===Pne(n)){const a={...e,url:t,authTokenEnv:i,credentialConfigured:!0,credentialSourceUrl:n,credentialSourceAuthTokenEnv:i};return delete a.authToken,delete a.credentialUpdate,a}const r={...e,url:t,authTokenEnv:i,credentialConfigured:!1,credentialSourceUrl:n,credentialSourceAuthTokenEnv:i,credentialUpdate:"pending"};return delete r.authToken,r}function i7t(e){return e.credentialSourceAuthTokenEnv?{...e,authTokenEnv:e.credentialSourceAuthTokenEnv,credentialConfigured:!1,credentialUpdate:"reuse"}:e}function I8(e){const t={...e,credentialConfigured:!1,credentialUpdate:"replace"};return delete t.authToken,delete t.authTokenEnv,t}function r7t(e){const t=I8(e);return t.credentialUpdate="remove",t}function s7t(e){const t=KE(e),n={},i=a=>{var l,c;Object.assign(n,((l=a.deployment)==null?void 0:l.envValues)??{}),a.subAgents.forEach(i),(c=a.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=a=>{var l,c,u;for(const d of a.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:a.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}a.subAgents.forEach(s),(u=a.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function a7t(e){const t=[],n=i=>{var r,s,a;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||KI.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),(a=i.workflow)==null||a.nodes.forEach(l=>n(l.agent))};return n(e),t}function Dne(e){const t=[],n=i=>{var r,s,a;for(const l of i.mcpTools??[]){const c=((r=l.credentialSourceAuthTokenEnv)==null?void 0:r.trim())??"";l.transport==="http"&&l.credentialUpdate==="reuse"&&c&&t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",sourceAuthTokenEnv:c})}i.subAgents.forEach(n),(a=i.workflow)==null||a.nodes.forEach(l=>n(l.agent))};return n(e),t}function KE(e){const t=new Set,n={},i=r=>{var u;const s=Ine(r.name,"AGENT"),a=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,x;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((x=h.match(KI))==null?void 0:x[1])??"";let b=d1(d);if(!b&&h){const O=Ine(d.name,`TOOL_${f+1}`);b=GFt(`MCP_${s}_${O}_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,delete v.credentialUpdate,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,...a?{mcpTools:a}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const o7t={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"};function XRe(e,t=!0){var i,r,s,a,l,c,u,d,f,h,m,g,b,v,y,x,O,w,k,S,E,C,N,_,j,A,F,T,P,R,L,M,U,I,H,K,Q,q,B,ee,le,se,re,ge;const n={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((i=e.a2aRegistry)!=null&&i.enabled){const W=VR(e.cloudProvider??"volcengine"),X={enabled:!0};(r=e.a2aRegistry.registrySpaceId)!=null&&r.trim()&&(X.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),X.registryTopK=((s=e.a2aRegistry.registryTopK)==null?void 0:s.trim())||W.topK,X.registryRegion=((a=e.a2aRegistry.registryRegion)==null?void 0:a.trim())||W.region,X.registryEndpoint=((l=e.a2aRegistry.registryEndpoint)==null?void 0:l.trim())||W.endpoint,n.a2aRegistry=X}return n}if(n.name=e.name,n.description=e.description,n.instruction=e.instruction,e.agentType==="loop"&&(n.maxIterations=e.maxIterations??3),(c=e.modelName)!=null&&c.trim()&&(n.modelName=e.modelName.trim()),e.modelSource&&(n.modelSource=e.modelSource),e.modelSource!=="ark"&&((u=e.modelProvider)!=null&&u.trim()&&(n.modelProvider=e.modelProvider.trim()),(d=e.modelApiBase)!=null&&d.trim()&&(n.modelApiBase=e.modelApiBase.trim())),(f=e.builtinTools)!=null&&f.length&&(n.builtinTools=[...e.builtinTools]),(h=e.customTools)!=null&&h.length&&(n.customTools=e.customTools.map(W=>({name:W.name,description:W.description}))),(m=e.mcpTools)!=null&&m.length&&(n.mcpTools=e.mcpTools.map(W=>{var ae,ue,Oe,ke;const X={name:W.name,transport:W.transport};return(ae=W.url)!=null&&ae.trim()&&(X.url=W.url.trim()),(ue=W.authTokenEnv)!=null&&ue.trim()&&(X.authTokenEnv=W.authTokenEnv.trim()),(Oe=W.command)!=null&&Oe.trim()&&(X.command=W.command.trim()),(ke=W.args)!=null&&ke.length&&(X.args=W.args),X})),((g=e.memory)!=null&&g.shortTerm||(b=e.memory)!=null&&b.longTerm)&&(n.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(n.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(n.longTermBackend=e.longTermBackend||"local",(v=e.longTermMemoryIndex)!=null&&v.trim()&&(n.longTermMemoryIndex=e.longTermMemoryIndex.trim()),n.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(n.knowledgebase=!0,n.knowledgebaseBackend=e.knowledgebaseBackend||"viking",(y=e.knowledgebaseIndex)!=null&&y.trim()&&(n.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((x=e.tracingExporters)!=null&&x.length)&&(n.tracing=!0,n.tracingExporters=[...e.tracingExporters]),t&&((O=e.harnessSidecar)!=null&&O.enabled)&&(n.harnessSidecar={enabled:!0,profile:e.harnessSidecar.profile,componentOverrides:{...e.harnessSidecar.componentOverrides}}),((w=e.cloudEnvironment)!=null&&w.environmentId||(k=e.cloudEnvironment)!=null&&k.environmentVersionId||(E=(S=e.cloudEnvironment)==null?void 0:S.cliTools)!=null&&E.length||((C=e.cloudEnvironment)==null?void 0:C.dockerfile)!==void 0)&&(n.cloudEnvironment={environmentId:e.cloudEnvironment.environmentId,environmentVersionId:e.cloudEnvironment.environmentVersionId,...(N=e.cloudEnvironment.cliTools)!=null&&N.length?{cliTools:[...e.cloudEnvironment.cliTools]}:{},...e.cloudEnvironment.dockerfile!==void 0?{dockerfile:e.cloudEnvironment.dockerfile}:{}}),(_=e.deployment)!=null&&_.feishuEnabled||(A=(j=e.deployment)==null?void 0:j.runtimeName)!=null&&A.trim()||(F=e.deployment)!=null&&F.runtimeNameCustomized||(P=(T=e.deployment)==null?void 0:T.modelApiKeyId)!=null&&P.trim()||(L=(R=e.deployment)==null?void 0:R.modelApiKeyName)!=null&&L.trim()||Object.keys(((M=e.deployment)==null?void 0:M.envValues)??{}).length>0){const W={feishuEnabled:!!((U=e.deployment)!=null&&U.feishuEnabled)};(H=(I=e.deployment)==null?void 0:I.runtimeName)!=null&&H.trim()&&(W.runtimeName=e.deployment.runtimeName.trim()),(K=e.deployment)!=null&&K.runtimeNameCustomized&&(W.runtimeNameCustomized=!0),(q=(Q=e.deployment)==null?void 0:Q.modelApiKeyId)!=null&&q.trim()&&(W.modelApiKeyId=e.deployment.modelApiKeyId.trim()),(ee=(B=e.deployment)==null?void 0:B.modelApiKeyName)!=null&&ee.trim()&&(W.modelApiKeyName=e.deployment.modelApiKeyName.trim()),Object.keys(((le=e.deployment)==null?void 0:le.envValues)??{}).length>0&&(W.envValues={...(se=e.deployment)==null?void 0:se.envValues}),n.deployment=W}return(re=e.selectedSkills)!=null&&re.length&&(n.selectedSkills=e.selectedSkills.map(W=>{const X={source:W.source,name:W.name,folder:W.folder};return W.description&&(X.description=W.description),W.source==="skillhub"?(X.slug=W.slug,X.namespace=W.namespace??"public"):W.source==="local"?X.localFiles=W.localFiles??[]:W.source==="skillspace"&&(X.skillSpaceId=W.skillSpaceId,X.skillSpaceName=W.skillSpaceName,X.skillId=W.skillId,W.version&&(X.version=W.version)),X})),(ge=e.subAgents)!=null&&ge.length&&(n.subAgents=e.subAgents.map(W=>XRe(W,!1))),n}function l7t(e,t=o7t){var s;const n=KE(e),i={...((s=n.draft.deployment)==null?void 0:s.envValues)??{},...n.envValues},r={...n.draft,deployment:{...n.draft.deployment??{feishuEnabled:!1},envValues:i}};return`# ${t.heading} # ${t.importHint} `+FU(XRe(r))}const c7t={missing_http_tool:"helpers.mcpGateway.missingHttpTool",missing_url:"helpers.mcpGateway.missingUrl"};function Mne(e){return{ok:!1,reason:e,message:$t(c7t[e])}}function u7t(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function d7t(e){var a;const t=[],n=new Set,i=l=>{var c;n.has(l)||(n.add(l),t.push(l),l.subAgents.forEach(i),(c=l.workflow)==null||c.nodes.forEach(u=>i(u.agent)))};i(e);const r=t.flatMap(l=>(l.mcpTools??[]).filter(c=>c.transport==="http"));if(r.length===0)return Mne("missing_http_tool");const s=[];for(const l of r){const c=((a=l.url)==null?void 0:a.trim())??"";if(!c||!u7t(c))return Mne("missing_url");s.push(c)}return{ok:!0,urls:s}}const P8="__default_environment__";function f7t(e){return{value:P8,label:e("cloudEnvironment.defaultLabel"),description:e("cloudEnvironment.defaultDescription")}}function h7t(e){const t=e instanceof Error?e.message:String(e);return t.includes("HTTP 503")&&t.includes("管理员未配置持久化存储")}const p7t={preparing:"cloudEnvironment.status.preparing",queued:"cloudEnvironment.status.queued",building:"cloudEnvironment.status.building",scanning:"cloudEnvironment.status.scanning",available:"cloudEnvironment.status.available",failed:"cloudEnvironment.status.failed"};function Lne(e,t){return e.latestVersion?t(p7t[e.latestVersion.status]):t("cloudEnvironment.status.notBuilt")}function m7t(e){var t,n;return((t=e.latestVersion)==null?void 0:t.status)==="available"?"success":((n=e.latestVersion)==null?void 0:n.status)==="failed"?"danger":e.latestVersion?"warning":"secondary"}function YRe({value:e,onChange:t,disabled:n=!1,controlSize:i="lg",controlClassName:r,optionClassName:s}){var C,N;const{t:a}=Te("ui"),l=p.useId(),c=p.useRef(t),[u,d]=p.useState([]),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,x]=p.useState(0);p.useEffect(()=>{c.current=t},[t]),p.useEffect(()=>{const _=new AbortController;return h(!0),g(""),v(!1),Vk(_.signal).then(j=>{_.signal.aborted||d(j)}).catch(j=>{!_.signal.aborted&&(j==null?void 0:j.name)!=="AbortError"&&(h7t(j)?(d([]),v(!0),c.current({environmentId:"",environmentVersionId:""})):g(j instanceof Error?j.message:String(j)))}).finally(()=>{_.signal.aborted||h(!1)}),()=>_.abort()},[y]);const O=p.useMemo(()=>[f7t(a),...u.map(_=>{var j;return{value:_.id,label:_.name,description:`${O6(_.operatingSystem)} · ${oh(_.language)} · ${Lne(_,a)}`,disabled:((j=_.latestVersion)==null?void 0:j.status)!=="available",environment:_}})],[u,a]),w=u.find(_=>_.id===e.environmentId),k=((C=w==null?void 0:w.latestVersion)==null?void 0:C.versionId)===e.environmentVersionId?w.latestVersion:null,S=w?AB.flatMap(_=>_.options).filter(_=>w.optionIds.includes(_.id)).map(_=>_.label):[],E=_=>{var A;if(_.value===P8||!_.environment){t({environmentId:"",environmentVersionId:""});return}const j=((A=_.environment.latestVersion)==null?void 0:A.versionId)??"";t({environmentId:_.value,environmentVersionId:j})};return f&&u.length===0?o.jsx("div",{className:"cloud-env-state",role:"status",children:o.jsx(xn,{duration:1.25,children:a("cloudEnvironment.loading")})}):m&&u.length===0?o.jsxs("div",{className:"cloud-env-state cloud-env-state--error",role:"alert",children:[o.jsxs("div",{children:[o.jsx("strong",{children:a("cloudEnvironment.loadFailed")}),o.jsx("p",{children:m})]}),o.jsx(Ht,{color:"secondary",variant:"soft",size:"sm",onClick:()=>x(_=>_+1),children:a("common.retry")})]}):o.jsxs("section",{className:"cloud-env-config","aria-labelledby":`${l}-title`,children:[o.jsxs("label",{className:"cloud-env-field",id:`${l}-title`,htmlFor:l,children:[o.jsx("span",{children:a("cloudEnvironment.label")}),o.jsx(Ls,{id:l,value:e.environmentId||P8,options:O,size:i,triggerClassName:r,optionClassName:s,pill:!1,disabled:n,placeholder:a("cloudEnvironment.placeholder"),searchPlaceholder:a("cloudEnvironment.search"),searchEmptyMessage:a("cloudEnvironment.noMatches"),onChange:E}),o.jsx("small",{children:a("cloudEnvironment.selectionHint")})]}),w?o.jsxs("div",{className:"cloud-env-summary","aria-live":"polite",children:[o.jsxs("div",{className:"cloud-env-summary__head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:w.name}),w.description?o.jsx("p",{children:w.description}):null]}),o.jsx(ba,{color:m7t(w),variant:"soft",size:"sm",children:Lne(w,a)})]}),o.jsxs("dl",{className:"cloud-env-details",children:[o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.operatingSystem")}),o.jsx("dd",{children:O6(w.operatingSystem)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.language")}),o.jsx("dd",{children:oh(w.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.tools")}),o.jsx("dd",{children:S.length?S.join(a("environmentCenter.listSeparator")):a("cloudEnvironment.noExtraTools")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.skills")}),o.jsx("dd",{children:(N=w.selectedSkills)!=null&&N.length?w.selectedSkills.map(_=>_.name).join(a("environmentCenter.listSeparator")):a("cloudEnvironment.noSkills")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.imageVersion")}),o.jsx("dd",{children:(k==null?void 0:k.versionId)||e.environmentVersionId||a("cloudEnvironment.unavailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("cloudEnvironment.image")}),o.jsx("dd",{title:(k==null?void 0:k.image)||"",children:(k==null?void 0:k.image)||a("cloudEnvironment.versionMissing")})]})]}),k?null:o.jsx("p",{className:"cloud-env-version-warning",role:"alert",children:a("cloudEnvironment.versionChanged")})]}):e.environmentId?o.jsx("div",{className:"cloud-env-version-warning",role:"alert",children:a("cloudEnvironment.selectionUnavailable")}):o.jsx("p",{className:`cloud-env-guidance ${b?"cloud-env-guidance--fallback":""}`,children:b?a("cloudEnvironment.persistenceFallback"):u.length===0?a("cloudEnvironment.emptyFallback"):a("cloudEnvironment.defaultGuidance")})]})}const Vf="new-agent-workbench__select-option";function g7t({label:e,metadata:t}){return o.jsx("span",{className:"new-agent-workbench__model-option-view",children:o.jsxs("span",{className:"new-agent-workbench__model-option-copy",children:[o.jsx("span",{className:"new-agent-workbench__model-option-label",children:e}),t?o.jsx("span",{className:"new-agent-workbench__model-option-metadata",children:t}):null]})})}function b7t(e,t){var i,r;const n=t.trim().toLocaleLowerCase();return n?[e.label,e.metadata,(i=e.model)==null?void 0:i.name,(r=e.model)==null?void 0:r.vendorName].some(s=>s==null?void 0:s.toLocaleLowerCase().includes(n)):!0}const y7t=["local","sqlite","mysql","postgresql"];function $ne(e){return y7t.includes(e)}function v7t(e){return e==="local"?"in-memory":"persistent"}const S2=[{id:"agent"},{id:"environment"},{id:"deployment"}];function x7t({cloudProvider:e,source:t,value:n,apiKeyId:i,apiKeyName:r,provider:s,apiBase:a,customApiKey:l,onSourceChange:c,onApiKeyChange:u,onModelNameChange:d,onProviderChange:f,onApiBaseChange:h,onCustomApiKeyChange:m,onLoadingChange:g}){const{t:b}=Te("create"),[v,y]=p.useState([]),[x,O]=p.useState([]),[w,k]=p.useState(!0),[S,E]=p.useState(!1),[C,N]=p.useState(null),[_,j]=p.useState("");p.useEffect(()=>{const P=new AbortController;if(t==="ark")return k(!0),j(""),HF(P.signal).then(R=>{if(P.signal.aborted)return;y(R.keys);const L=R.keys.find(M=>M.id===i)??R.keys.find(M=>M.name===r)??R.keys.find(M=>M.id===R.defaultKeyId)??R.keys[0];L&&L.id!==i&&u(L)}).catch(R=>{P.signal.aborted||j(R instanceof Error?R.message:b("workbench.model.credentialsLoadError"))}).finally(()=>{P.signal.aborted||k(!1)}),()=>P.abort()},[i,r,e,u,t,b]),p.useEffect(()=>{if(t!=="ark"||!i){O([]),E(!1),N(null);return}const P=new AbortController;return E(!0),N(null),j(""),Ex({apiKeyId:i,signal:P.signal}).then(R=>{P.signal.aborted||O(R.models)}).catch(R=>{P.signal.aborted||j(R instanceof Error?R.message:b("workbench.model.modelsLoadError"))}).finally(()=>{P.signal.aborted||(E(!1),N(i))}),()=>P.abort()},[i,e,t,b]),p.useEffect(()=>{g(t==="ark"&&(w||!!i&&(S||C!==i)))},[i,C,w,S,g,t]);const A=[{value:"ark",label:e==="byteplus"?"BytePlus ModelArk":b("workbench.model.volcengineArk")},{value:"custom",label:b("workbench.model.custom")},{value:"gateway",label:b("workbench.model.gateway"),description:b("workbench.model.comingSoon"),disabled:!0}],F=v.map(P=>({value:P.id,label:P.name}));i&&!F.some(P=>P.value===i)&&F.unshift({value:i,label:r||b("workbench.model.currentApiKey")});const T=p.useMemo(()=>{const P=x.filter(R=>R.available||R.lifecycleStatus==="Retiring").map(R=>({value:R.id,label:R.displayName||R.name||R.id,metadata:R.vendorName?`${R.id} | ${R.vendorName}`:R.id,model:R}));return n&&!P.some(R=>R.value===n)&&P.unshift({value:n,label:n,metadata:n}),P},[x,n]);return o.jsxs("div",{className:"new-agent-workbench__model-group",children:[o.jsx("span",{className:"new-agent-workbench__model-group-label",children:b("workbench.model.label")}),o.jsxs("div",{className:"new-agent-workbench__model-fields",children:[o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsx("span",{className:"new-agent-workbench__model-field-label",children:b("workbench.model.source")}),o.jsx(Ls,{value:t,options:A,size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,onChange:P=>c(P.value)})]}),t==="ark"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsxs("span",{className:"new-agent-workbench__model-field-label",children:["API Key",o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Ls,{value:i??"",options:F,loading:w,loadingPlaceholder:b("workbench.model.loadingApiKeys"),placeholder:b("workbench.model.selectApiKey"),searchPlaceholder:b("workbench.model.searchApiKeys"),searchEmptyMessage:b("workbench.model.noApiKeys"),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,onChange:P=>{const R=v.find(L=>L.id===P.value);R&&(g(!0),u(R))}})]}),o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsxs("span",{className:"new-agent-workbench__model-field-label",children:[b("workbench.model.label"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Ls,{value:n,options:T,loading:S,loadingPlaceholder:b("workbench.model.loadingModels"),placeholder:b("workbench.model.selectModel"),searchPlaceholder:b("workbench.model.searchModels"),searchEmptyMessage:b("workbench.model.noModels"),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:`${Vf} new-agent-workbench__model-option`,OptionView:g7t,searchPredicate:b7t,pill:!1,disabled:!i,onChange:P=>d(P.value)})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsxs("span",{className:"new-agent-workbench__model-field-label",children:[b("workbench.model.name"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(qr,{value:n,size:"xl",gutterSize:"md",pill:!1,onChange:P=>d(P.currentTarget.value)})]}),o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsx("span",{className:"new-agent-workbench__model-field-label",children:b("workbench.model.provider")}),o.jsx(qr,{value:s,placeholder:"openai",size:"xl",gutterSize:"md",pill:!1,onChange:P=>f(P.currentTarget.value)})]}),o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsx("span",{className:"new-agent-workbench__model-field-label",children:"API Base"}),o.jsx(qr,{value:a,placeholder:xl(e),size:"xl",gutterSize:"md",pill:!1,onChange:P=>h(P.currentTarget.value)})]}),o.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[o.jsxs("span",{className:"new-agent-workbench__model-field-label",children:["API Key",o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(qr,{type:"password",value:l,placeholder:b("workbench.model.apiKeyPlaceholder"),autoComplete:"new-password",size:"xl",gutterSize:"md",pill:!1,onChange:P=>m(P.currentTarget.value)})]})]}),_?o.jsx("p",{className:"new-agent-workbench__error",role:"alert",children:_}):null]})]})}function w7t({value:e,disabled:t,onChange:n}){const{t:i}=Te("create"),[r,s]=p.useState([]),[a,l]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(0);p.useEffect(()=>{const g=new AbortController;return l(!0),u(""),aR(g.signal).then(b=>{g.signal.aborted||s(b)}).catch(b=>{!g.signal.aborted&&(b==null?void 0:b.name)!=="AbortError"&&(s([]),u(b instanceof Error?b.message:String(b)))}).finally(()=>{g.signal.aborted||l(!1)}),()=>g.abort()},[d]);const h=p.useMemo(()=>[...r].sort((g,b)=>Number(b.isCurrent)-Number(g.isCurrent)).map(g=>({value:g.uid,label:g.name.trim()||i("workbench.identity.unnamedPool"),description:g.isCurrent?i("workbench.identity.currentPool",{value:g.domain||g.uid}):g.domain||g.uid})),[r,i]),m=r.find(g=>g.uid===e);return o.jsxs("div",{className:"new-agent-workbench__field",children:[o.jsxs("span",{children:[i("workbench.identity.userPool"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Ls,{value:e,options:h,loading:a,loadingPlaceholder:i("workbench.identity.loading"),placeholder:i("workbench.identity.placeholder"),searchPlaceholder:i("workbench.identity.search"),searchEmptyMessage:i("workbench.identity.empty"),size:"xl",pill:!1,disabled:t||!!c,triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,onChange:g=>n(g.value)}),c?o.jsxs("div",{className:"new-agent-workbench__inline-error",role:"alert",children:[o.jsx("span",{children:c}),o.jsx(Ht,{color:"secondary",variant:"ghost",size:"sm",pill:!1,onClick:()=>f(g=>g+1),children:i("common.retry")})]}):m!=null&&m.isCurrent?o.jsx("small",{className:"new-agent-workbench__helper-text",children:i("workbench.identity.currentHint")}):m?o.jsx("small",{className:"new-agent-workbench__error",children:i("workbench.identity.mismatchHint")}):o.jsx("small",{className:"new-agent-workbench__helper-text",children:i("workbench.identity.selectionHint")})]})}function Fne({name:e,value:t,required:n=!1,placeholder:i,locked:r=!1,onRename:s,onValueChange:a,onRemove:l}){const{t:c}=Te("create"),[u,d]=p.useState(e);p.useEffect(()=>d(e),[e]);const f=()=>{const h=u.trim().toUpperCase();if(!h){d(e);return}d(h),h!==e&&s(e,h)};return o.jsxs("div",{className:`new-agent-workbench__env-row${r?" is-locked":""}`,role:"row",children:[o.jsx("div",{className:"new-agent-workbench__env-cell",role:"cell",children:o.jsx(qr,{"aria-label":c("workbench.environmentVariables.nameAriaLabel"),value:u,title:r?e:void 0,size:"xl",gutterSize:"md",pill:!1,disabled:r,onChange:h=>d(h.currentTarget.value),onBlur:f,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()}})}),o.jsx("div",{className:"new-agent-workbench__env-cell",role:"cell",children:o.jsx(qr,{"aria-label":c("workbench.environmentVariables.valueAriaLabel",{name:e}),value:t,size:"xl",gutterSize:"md",pill:!1,type:/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)?"password":"text",placeholder:i,required:n,onChange:h=>a(h.currentTarget.value)})}),o.jsx("div",{className:"new-agent-workbench__env-action",role:"cell",children:r?n?o.jsx("span",{className:"new-agent-workbench__required","aria-label":c("common.required"),children:"*"}):null:o.jsx(Ht,{color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,"aria-label":c("workbench.environmentVariables.deleteNamed",{name:e}),onClick:l,children:o.jsx(e7e,{"aria-hidden":!0})})})]})}function O7t({draft:e,cloudProvider:t,deployRegion:n,runtimeName:i,isRuntimeUpdate:r=!1,deploying:s,deployStage:a,deployError:l,deploySucceeded:c,showErrors:u,onBack:d,onDraftPatch:f,onDeploymentPatch:h,onModelApiKeyChange:m,customModelApiKey:g,onCustomModelApiKeyChange:b,onSelectedSkillsChange:v,onCloudEnvironmentChange:y,onDeployRegionChange:x,onRuntimeNameChange:O,onNetworkChange:w,onDeploy:k}){var $e,ye,Ue,Ke,ft,ut,Gt,Rt,zt;const{t:S}=Te("create"),E=RF(),[C,N]=p.useState("agent"),[_,j]=p.useState(!1),A=p.useRef(null),[F,T]=p.useState(!1),[P,R]=p.useState(!1),[L,M]=p.useState(!0),[U,I]=p.useState("api_key"),[H,K]=p.useState(""),[Q,q]=p.useState(()=>{const Z=e.shortTermBackend||"local";return e.memory.shortTerm&&$ne(Z)?Z:"local"}),B=v7t(Q),[ee,le]=p.useState("1"),[se,re]=p.useState(B==="in-memory"?"1":"5"),[ge,W]=p.useState(!1),[X,ae]=p.useState(Ije),[ue,Oe]=p.useState(""),[ke,st]=p.useState(null),[Le,Me]=p.useState({top:!1,bottom:!1}),Ie=p.useRef(null),qe=S2.findIndex(Z=>Z.id===C),Ae={...S2[qe],label:S(`workbench.steps.${C}.label`),title:S(`workbench.steps.${C}.title`),description:S(`workbench.steps.${C}.description`)},ze=WE(e.name,Z=>S(`validation.agentName.${Z}`)),Ee=ze!==null,De=!e.description.trim(),J=!e.instruction.trim(),he=Im(e,t),_e=!(($e=e.modelName)!=null&&$e.trim()),Ze=he==="ark"&&!((Ue=(ye=e.deployment)==null?void 0:ye.modelApiKeyId)!=null&&Ue.trim()),at=Ee||De||J||_e||Ze,wt=((ft=(Ke=e.deployment)==null?void 0:Ke.network)==null?void 0:ft.mode)??"public",Se=(ut=e.deployment)==null?void 0:ut.network,ve=Iu(t),He=((Gt=e.deployment)==null?void 0:Gt.envValues)??{},Je=iv.find(Z=>Z.id===Q)??iv[0],Ce=((Je==null?void 0:Je.env)??[]).filter(Z=>!Z.hidden),Wt=new Set(Ce.map(Z=>Z.key)),ln=Object.entries(He).filter(([Z])=>Z!=="FEISHU_APP_ID"&&Z!=="FEISHU_APP_SECRET"&&!Wt.has(Z)),cn=(Z,Bt)=>{h({envValues:{...He,[Z]:Bt}})},Ot=(Z,Bt)=>{const Qe=Object.fromEntries(Object.entries(He).map(([tt,ht])=>tt===Z?[Bt,ht]:[tt,ht]));h({envValues:Qe})},jt=Z=>{const Bt={...He};delete Bt[Z],h({envValues:Bt})},ot=()=>{let Z=ln.length+1,Bt=`CUSTOM_ENV_${Z}`;for(;Bt in He;)Bt=`CUSTOM_ENV_${++Z}`;cn(Bt,"")};p.useEffect(()=>{const Z=Ie.current;if(!Z)return;const Bt=()=>{const pe={top:Z.scrollTop>1,bottom:Z.scrollTop+Z.clientHeightWe.top===pe.top&&We.bottom===pe.bottom?We:pe)};Z.scrollTo({top:0,behavior:"auto"}),Z.addEventListener("scroll",Bt,{passive:!0});const Qe=new ResizeObserver(Bt);Qe.observe(Z);const tt=new MutationObserver(Bt);tt.observe(Z,{childList:!0,subtree:!0});const ht=window.requestAnimationFrame(Bt);return()=>{window.cancelAnimationFrame(ht),Z.removeEventListener("scroll",Bt),Qe.disconnect(),tt.disconnect()}},[C]),p.useEffect(()=>{le("1"),re(B==="in-memory"?"1":"5")},[B]);const gt=()=>{if(qe===0){if(_)return;if(E){d();return}A.current=d,j(!0);return}N(S2[qe-1].id)},Pe=()=>{if(!_)return;const Z=A.current;A.current=null,Z==null||Z()},Et=()=>{if(C==="agent"){if(T(!0),at)return;N("environment");return}if(C==="environment"){N("deployment");return}const Z=Number(ee),Bt=Number(se);if(!ee.trim()||!se.trim()||!Number.isSafeInteger(Z)||Z<0||!Number.isSafeInteger(Bt)||Bt<1){Oe(S("workbench.validation.instanceIntegers"));return}if(Z>Bt){Oe(S("workbench.validation.instanceOrder"));return}if(U==="user_pool"&&!H){Oe(S("workbench.validation.userPoolRequired"));return}const Qe=Dje(X);if(Qe){st(Qe),Oe(Qe);return}st(null),Oe(""),k({authentication:U==="user_pool"?{type:"user_pool",userPoolUid:H}:{type:"api_key"},sessionStorage:B,sessionBackend:Q,minInstance:Z,maxInstance:Bt,createEvaluationSets:t==="byteplus"?!1:ge,resources:X})},bt=u||F,Mt=bt||P;return o.jsxs(pr.div,{className:`new-agent-workbench${_?" is-leaving":""}`,initial:E?!1:{opacity:0},animate:{opacity:_?0:1},transition:{duration:_?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:Pe,children:[o.jsx("main",{className:"new-agent-workbench__main","aria-label":S("workbench.ariaLabel"),children:o.jsxs("section",{className:"new-agent-workbench__form","aria-labelledby":"new-agent-workbench-title",children:[o.jsx(Ru,{mode:"wait",initial:!1,children:o.jsxs(pr.div,{className:"new-agent-workbench__heading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[o.jsx("h1",{id:"new-agent-workbench-title",children:Ae.title}),o.jsx("p",{children:Ae.description})]},`heading-${C}`)}),o.jsxs("div",{className:"new-agent-workbench__panel-frame",children:[o.jsx("div",{ref:Ie,className:"new-agent-workbench__panel",children:o.jsxs(Ru,{mode:"wait",initial:!1,children:[C==="agent"?o.jsxs(pr.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"name",children:[o.jsxs("span",{className:"new-agent-workbench__field-heading",children:[o.jsxs("span",{children:[S("common.name"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsxs("small",{children:[e.name.length,"/50"]})]}),o.jsx(qr,{value:e.name,maxLength:50,size:"xl",gutterSize:"md",pill:!1,invalid:Mt&&Ee,placeholder:S("workbench.agent.namePlaceholder"),"aria-describedby":Mt&&ze?"new-agent-workbench-name-error":void 0,onBlur:()=>R(!0),onChange:Z=>{R(!0),f({name:Z.currentTarget.value})}}),Mt&&ze?o.jsx("small",{id:"new-agent-workbench-name-error",className:"new-agent-workbench__error",role:"alert",children:ze}):null]}),o.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"description",children:[o.jsxs("span",{children:[S("common.description"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Rm,{value:e.description,rows:4,maxRows:8,autoResize:!0,size:"xl",gutterSize:"md",invalid:bt&&De,placeholder:S("workbench.agent.descriptionPlaceholder"),onChange:Z=>f({description:Z.currentTarget.value})}),bt&&De?o.jsx("small",{className:"new-agent-workbench__error",children:S("workbench.validation.descriptionRequired")}):null]}),o.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"instruction",children:[o.jsxs("span",{children:[S("workbench.agent.prompt"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Rm,{value:e.instruction,rows:10,maxRows:18,autoResize:!0,size:"xl",gutterSize:"md",invalid:bt&&J,placeholder:S("workbench.agent.promptPlaceholder"),onChange:Z=>f({instruction:Z.currentTarget.value})}),bt&&J?o.jsx("small",{className:"new-agent-workbench__error",children:S("workbench.validation.promptRequired")}):null]}),o.jsx(x7t,{cloudProvider:t,source:he,value:e.modelName??"",apiKeyId:(Rt=e.deployment)==null?void 0:Rt.modelApiKeyId,apiKeyName:(zt=e.deployment)==null?void 0:zt.modelApiKeyName,provider:e.modelProvider??"",apiBase:e.modelApiBase??"",customApiKey:g,onSourceChange:Z=>{var Bt;M(Z==="ark"),f({modelSource:Z,modelName:Z==="custom"&&he==="ark"?"":Z==="ark"&&!((Bt=e.modelName)!=null&&Bt.trim())?wh(t):e.modelName})},onApiKeyChange:m,onModelNameChange:Z=>f({modelName:Z}),onProviderChange:Z=>f({modelProvider:Z}),onApiBaseChange:Z=>f({modelApiBase:Z}),onCustomApiKeyChange:b,onLoadingChange:M}),bt&&_e?o.jsx("p",{className:"new-agent-workbench__error",role:"alert",children:S("workbench.validation.modelRequired")}):null,o.jsxs("div",{className:"new-agent-workbench__field",children:[o.jsx("span",{children:S("workbench.agent.skills")}),o.jsx(ZQ,{selected:e.selectedSkills??[],onChange:v,cloudProvider:t,disabled:s,addLabel:S("workbench.agent.addSkill"),showSelectedCount:!1})]})]},"agent"):null,C==="environment"?o.jsx(pr.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:o.jsx("div",{className:"new-agent-workbench__environment",children:o.jsx(YRe,{value:e.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:y,disabled:s,controlSize:"xl",controlClassName:"new-agent-workbench__select-trigger",optionClassName:Vf})})},"environment"):null,C==="deployment"?o.jsxs(pr.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsxs("span",{children:[S("workbench.deployment.runtimeName"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(qr,{value:i,disabled:s||r,size:"xl",gutterSize:"md",pill:!1,placeholder:"agent-runtime",onChange:Z=>O(Z.currentTarget.value)}),o.jsx("small",{className:"new-agent-workbench__helper-text",children:S(r?"workbench.deployment.runtimeNameUpdateHint":"workbench.deployment.runtimeNameHint")})]}),o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsxs("span",{children:[S("workbench.deployment.region"),o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(Ls,{value:n,options:ve,size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,disabled:s||r,onChange:Z=>x(Z.value)})]}),o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{children:S("workbench.deployment.authentication")}),o.jsx(Ls,{value:U,options:[{value:"api_key",label:"API Key",description:S("workbench.deployment.apiKeyDescription")},{value:"user_pool",label:S("workbench.identity.userPool"),description:S("workbench.deployment.userPoolDescription")}],size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,disabled:s,onChange:Z=>{I(Z.value),Oe("")}})]}),U==="user_pool"?o.jsx(w7t,{value:H,disabled:s,onChange:Z=>{K(Z),Oe("")}}):null]}),o.jsx("div",{className:"new-agent-workbench__deployment-section",children:o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{children:S("workbench.deployment.sessionStorage")}),o.jsx(Ls,{value:Q,options:iv.map(Z=>({value:Z.id,label:Z.id==="local"?S("workbench.deployment.inMemoryStorage"):S(`workbench.deployment.backends.${Z.id}`,{defaultValue:Z.label})})),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,disabled:s,onChange:Z=>{$ne(Z.value)&&(q(Z.value),f({memory:{...e.memory,shortTerm:Z.value!=="local"},shortTermBackend:Z.value}),Oe(""))}})]})}),o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsx("strong",{className:"new-agent-workbench__section-title",children:S("workbench.deployment.instances")}),o.jsxs("div",{className:"new-agent-workbench__instance-fields",children:[o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{className:"new-agent-workbench__model-field-label",children:S("workbench.deployment.minInstances")}),o.jsx(qr,{type:"number",min:0,step:1,value:ee,size:"xl",gutterSize:"md",pill:!1,disabled:s,onChange:Z=>{le(Z.currentTarget.value),Oe("")}})]}),o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{className:"new-agent-workbench__model-field-label",children:S("workbench.deployment.maxInstances")}),o.jsx(qr,{type:"number",min:1,step:1,value:se,size:"xl",gutterSize:"md",pill:!1,disabled:s,onChange:Z=>{re(Z.currentTarget.value),Oe("")}})]})]}),B==="in-memory"?o.jsx("small",{className:"new-agent-workbench__helper-text",children:S("workbench.deployment.inMemoryHint")}):null]}),o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{children:S("workbench.deployment.networkMode")}),o.jsx(Ls,{value:wt,options:[{value:"public",label:S("workbench.deployment.network.public")},{value:"private",label:S("workbench.deployment.network.private")},{value:"both",label:S("workbench.deployment.network.both")}],size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:Vf,pill:!1,onChange:Z=>w(Z.value==="public"?void 0:{...Se??{},mode:Z.value})})]}),wt!=="public"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"new-agent-workbench__field-row",children:[o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsxs("span",{children:["VPC ID",o.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),o.jsx(qr,{value:(Se==null?void 0:Se.vpcId)??"",size:"xl",gutterSize:"md",pill:!1,placeholder:"vpc-xxx",onChange:Z=>w({...Se??{mode:wt},vpcId:Z.currentTarget.value})})]}),o.jsxs("label",{className:"new-agent-workbench__field",children:[o.jsx("span",{children:S("workbench.deployment.subnetIds")}),o.jsx(qr,{value:(Se==null?void 0:Se.subnetIds)??"",size:"xl",gutterSize:"md",pill:!1,placeholder:"subnet-xxx",onChange:Z=>w({...Se??{mode:wt},subnetIds:Z.currentTarget.value})})]})]}),o.jsxs("div",{className:"new-agent-workbench__switch-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:S("workbench.deployment.sharedInternet")}),o.jsx("span",{children:S("workbench.deployment.sharedInternetHint")})]}),o.jsx(C8,{checked:!!(Se!=null&&Se.enableSharedInternetAccess),onCheckedChange:Z=>w({...Se??{mode:wt},enableSharedInternetAccess:Z}),"aria-label":S("workbench.deployment.sharedInternet")})]})]}):null]}),t!=="byteplus"?o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsx("strong",{className:"new-agent-workbench__section-title",children:S("workbench.deployment.evaluationSets")}),o.jsxs("div",{className:"new-agent-workbench__switch-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:S("workbench.deployment.createEvaluationSets")}),o.jsx("span",{children:S("workbench.deployment.evaluationSetsHint")})]}),o.jsx(C8,{checked:ge,onCheckedChange:W,"aria-label":S("workbench.deployment.createEvaluationSets")})]})]}):null,o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsx("strong",{className:"new-agent-workbench__section-title",children:S("workbench.deployment.resources")}),o.jsx(Mje,{value:X,agentName:e.name||"agentkit-app",runtimeName:i,region:n,disabled:s,validationError:ke,onChange:Z=>{ae(Z),st(null),Oe("")}})]}),o.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[o.jsxs("div",{className:"new-agent-workbench__env-head",children:[o.jsx("strong",{className:"new-agent-workbench__section-title",children:S("workbench.environmentVariables.title")}),o.jsxs(Ht,{color:"secondary",variant:"ghost",size:"sm",pill:!1,onClick:ot,children:[o.jsx(xbe,{"aria-hidden":!0}),S("workbench.environmentVariables.add")]})]}),o.jsxs("div",{className:"new-agent-workbench__env-table",role:"table","aria-label":S("workbench.environmentVariables.title"),children:[o.jsxs("div",{className:"new-agent-workbench__env-table-head",role:"row",children:[o.jsx("span",{role:"columnheader",children:S("common.name")}),o.jsx("span",{role:"columnheader",children:S("common.value")}),o.jsx("span",{role:"columnheader",children:S("common.actions")})]}),o.jsxs("div",{className:"new-agent-workbench__env-table-body",role:"rowgroup",children:[Ce.map(Z=>o.jsx(Fne,{name:Z.key,value:He[Z.key]??Z.defaultValue??"",required:Z.required,placeholder:Z.placeholder,locked:!0,onRename:()=>{},onValueChange:Bt=>cn(Z.key,Bt),onRemove:()=>{}},Z.key)),ln.map(([Z,Bt])=>o.jsx(Fne,{name:Z,value:Bt,onRename:Ot,onValueChange:Qe=>cn(Z,Qe),onRemove:()=>jt(Z)},Z)),!Ce.length&&!ln.length?o.jsx("div",{className:"new-agent-workbench__empty-row new-agent-workbench__env-table-empty",role:"row",children:o.jsx("span",{role:"cell",children:S("common.none")})}):null]})]})]}),ue?o.jsx(Lb,{message:ue,defaultExpanded:!0}):l?o.jsx(Lb,{message:l,defaultExpanded:!0}):a||c?o.jsxs("div",{className:"new-agent-workbench__deploy-status",role:"status",children:[c?o.jsx(ybe,{"aria-hidden":!0}):null,o.jsx("span",{children:(a?$I(a):"")||S(c?"workbench.deployment.complete":"workbench.deployment.preparing")}),typeof(a==null?void 0:a.pct)=="number"?o.jsxs("strong",{children:[Math.round(a.pct),"%"]}):null]}):null]},"deployment"):null]})}),o.jsx("span",{className:`new-agent-workbench__scroll-fade is-top${Le.top?" is-visible":""}`,"aria-hidden":"true"}),o.jsx("span",{className:`new-agent-workbench__scroll-fade is-bottom${Le.bottom?" is-visible":""}`,"aria-hidden":"true"})]}),o.jsx(Ru,{mode:"wait",initial:!1,children:o.jsxs(pr.div,{className:"new-agent-workbench__actions",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs(Ht,{color:"secondary",variant:"outline",size:"lg",pill:!1,disabled:s,onClick:gt,children:[o.jsx(DFe,{"aria-hidden":!0}),S(qe===0?"common.back":"common.previous")]}),o.jsx(Ht,{color:"primary",size:"lg",pill:!1,loading:s,disabled:s||C==="agent"&&L,onClick:Et,children:S(C==="deployment"?c?r?"workbench.actions.updateAgain":"workbench.actions.deployAgain":r?"workbench.actions.updateAndPublish":"common.deploy":"common.next")})]},`actions-${C}`)})]})}),o.jsx("footer",{className:"new-agent-workbench__footer",children:o.jsx("div",{className:"new-agent-workbench__footer-inner",children:o.jsx("nav",{"aria-label":S("workbench.progress"),children:o.jsx("ol",{className:"new-agent-workbench__progress",children:S2.map((Z,Bt)=>o.jsx("li",{className:Bt===qe?"is-active":"","aria-current":Bt===qe?"step":void 0,"aria-label":S(`workbench.steps.${Z.id}.label`),title:S(`workbench.steps.${Z.id}.label`),children:o.jsx("span",{"aria-hidden":"true"})},Z.id))})})})})]})}async function S7t(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(t.status===409)throw new Error($t("helpers.a2aSpaces.credentialsMissing"));if(t.status===401)throw new Error($t("helpers.a2aSpaces.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error($t("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function k7t(e={}){const t=new URLSearchParams({page_size:String(e.pageSize??100),project:e.project||"default"});return e.region&&t.set("region",e.region),(await S7t(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function E7t(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(t.status===409)throw new Error($t("helpers.vikingKnowledge.credentialsMissing"));if(t.status===401)throw new Error($t("helpers.vikingKnowledge.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error($t("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function C7t(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await E7t(`/web/viking-knowledgebases${n?`?${n}`:""}`)).items||[]}async function T7t(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(t.status===409)throw new Error($t("helpers.vikingMemory.credentialsMissing"));if(t.status===401)throw new Error($t("helpers.vikingMemory.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error($t("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function A7t(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await T7t(`/web/viking-memories${n?`?${n}`:""}`)).items||[]}const Bne=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function kL(e){let t=0;for(let n=0;n>>0;return Bne[t%Bne.length]}const _7t=2,N7t=1500;function j7t(e){return e.includes("HTTP 425")||e.includes("仍在采集中")?"collecting":e.includes("HTTP 404")||e.includes("未开启链路观测")?"disabled":/HTTP 40[13]/.test(e)||e.includes("无权限读取 APMPlus")?"forbidden":"error"}function R7t(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,i=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):i.push(u);const r=(u,d)=>u.start_time-d.start_time,s=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(r).map(f=>s(f,d+1))}),a=i.sort(r).map(u=>s(u,0)),l=e.length?Math.min(...e.map(u=>u.start_time)):0,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:l,total:c-l||1}}function I7t(e,t){const n=[],i=r=>{n.push(r),t.has(r.span.span_id)||r.children.forEach(i)};return e.forEach(i),n}function Une(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const P7t=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function Qne(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const i=String(n);return{key:P7t(t),value:i,long:i.length>80||i.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function ZRe({appName:e,testRunId:t,sessionId:n,endTimeMs:i,onClose:r,title:s}){const{t:a}=Te("conversation"),[l,c]=p.useState(null),[u,d]=p.useState("loading"),[f,h]=p.useState(0),[m,g]=p.useState(new Set),[b,v]=p.useState(null),y=p.useRef(0),x=`${e??""}:${t??""}:${n}:${i??""}`,O=p.useRef(x);p.useEffect(()=>{O.current!==x&&(O.current=x,y.current=0),c(null),d("loading");let A=!1,F,T;if(t)T=cye(t,n);else if(e)T=L_(e,n,i);else{d("error");return}return T.then(P=>{A||(c(P),d("ready"),v(P.length?P.reduce((R,L)=>R.start_time<=L.start_time?R:L).span_id:null))}).catch(P=>{if(A)return;const R=j7t(P instanceof Error?P.message:String(P));d(R),R==="collecting"&&y.current<_7t&&(y.current+=1,F=window.setTimeout(()=>h(L=>L+1),N7t))}),()=>{A=!0,F!==void 0&&window.clearTimeout(F)}},[e,i,f,n,x,t]);const w=()=>{y.current=0,h(A=>A+1)},{rootNodes:k,min:S,total:E}=p.useMemo(()=>R7t(l??[]),[l]),C=p.useMemo(()=>I7t(k,m),[k,m]),N=(l==null?void 0:l.find(A=>A.span_id===b))??null,_=E/1e6,j=A=>g(F=>{const T=new Set(F);return T.has(A)?T.delete(A):T.add(A),T});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s??a("trace.title")}),o.jsx("div",{className:"drawer-sub",children:u==="ready"&&l?a("trace.callCount",{count:l.length,duration:_.toFixed(1)}):a(`trace.statuses.${u}`)})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":a("trace.close"),children:o.jsx(Ba,{className:"icon"})})]}),u==="loading"&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(fi,{className:"icon spin"})," ",a("trace.loading")]}),u==="collecting"&&o.jsxs("div",{className:"drawer-loading",role:"status","aria-live":"polite",children:[o.jsx(fi,{className:"icon spin"}),o.jsx("span",{children:a("trace.errors.collecting")}),o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:w,children:a("trace.retryNow")})]}),(u==="disabled"||u==="forbidden"||u==="error")&&o.jsxs("div",{className:"drawer-empty trace-state",role:"alert",children:[o.jsx("span",{children:a(`trace.errors.${u}`)}),u==="error"&&o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:w,children:a("trace.reload")})]}),u==="ready"&&l&&l.length===0&&o.jsx("div",{className:"drawer-empty",children:a("trace.empty")}),C.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:C.map(A=>{const F=A.span,T=(F.start_time-S)/E*100,P=Math.max((F.end_time-F.start_time)/E*100,.6),R=A.children.length>0;return o.jsxs("button",{className:`trace-row ${b===F.span_id?"active":""}`,onClick:()=>v(F.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:A.depth*14},children:[o.jsx("span",{className:`trace-caret ${R?"":"hidden"} ${m.has(F.span_id)?"":"open"}`,onClick:L=>{L.stopPropagation(),R&&j(F.span_id)},children:o.jsx(Uk,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:kL(F.name)}}),o.jsx("span",{className:"trace-name",title:F.name,children:F.name})]}),o.jsx("span",{className:"trace-dur",children:Une(F.end_time-F.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${T}%`,width:`${P}%`,background:kL(F.name)}})})]},F.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:N?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:N.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:kL(N.name)}}),Une(N.end_time-N.start_time)]}),o.jsx("div",{className:"td-section",children:a("trace.attributes")}),o.jsx("div",{className:"td-props",children:Qne(N).filter(A=>!A.long).map(A=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:A.key}),o.jsx("span",{className:"td-val",children:A.value})]},A.key))}),Qne(N).filter(A=>A.long).map(A=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:A.key}),o.jsx("pre",{className:"td-pre",children:A.value})]},A.key))]}):o.jsx("div",{className:"drawer-empty",children:a("trace.selectCall")})})]})]})]})}const D7t=p.lazy(()=>Md(()=>import("../chunks/MarkdownPromptEditor-C4VlPACI.js"),__vite__mapDeps([2,3]))),D8="veadk.generatedAgentTestRuns",EL=4;function hz(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(D8)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function JRe(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(D8,JSON.stringify(t)):window.sessionStorage.removeItem(D8)}catch{}}function M7t(e){JRe([...hz(),e])}function fw(e){JRe(hz().filter(t=>t!==e))}function L7t(e,t,n="text/plain"){const i=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),r=document.createElement("a");r.href=i,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)}const $7t=[{id:"type",label:"traditional.sections.type.label",hint:"traditional.sections.type.hint",icon:P7e,required:!0},{id:"basic",label:"traditional.sections.basic.label",hint:"traditional.sections.basic.hint",icon:Wd,required:!0},{id:"model",label:"traditional.sections.model.label",hint:"traditional.sections.model.hint",icon:m7e},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:L7e},{id:"skills",label:"traditional.sections.skills.label",hint:"traditional.sections.skills.hint",icon:mS},{id:"knowledge",label:"traditional.sections.knowledge.label",hint:"traditional.sections.knowledge.hint",icon:Y2},{id:"memory",label:"traditional.sections.memory.label",hint:"traditional.sections.memory.hint",icon:Abe},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:l7e},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:I7e}];function F7t({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function zne({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25h14.5"}),o.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),o.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),o.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function pz({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function mz({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const B7t={llm:"traditional.agentTypes.llm.label",sequential:"traditional.agentTypes.sequential.label",parallel:"traditional.agentTypes.parallel.label",loop:"traditional.agentTypes.loop.label",a2a:"traditional.agentTypes.a2a.label"},Vne={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},eIe="REGISTRY_SPACE_ID",U7t=gOe.filter(e=>e.key!==eIe);function tIe(e,t,n="volcengine"){var s,a,l;if(!(e!=null&&e.enabled))return{};const i=VR(n),r={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(r.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||i.topK,r.REGISTRY_REGION=((a=e.registryRegion)==null?void 0:a.trim())||i.region,r.REGISTRY_ENDPOINT=((l=e.registryEndpoint)==null?void 0:l.trim())||i.endpoint):(r.REGISTRY_TOP_K=e.registryTopK??"",r.REGISTRY_REGION=e.registryRegion??"",r.REGISTRY_ENDPOINT=e.registryEndpoint??""),r}function cy(e,t){if(t!=="byteplus")return e;const n=VR(t);return e.map(i=>i.key==="REGISTRY_REGION"?{...i,placeholder:n.region}:i.key==="REGISTRY_ENDPOINT"?{...i,placeholder:n.endpoint}:i.key==="MODEL_EMBEDDING_NAME"?{...i,placeholder:LBe(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:xl(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:FBe(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:BBe(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:UBe(t)}:i.key==="MODEL_IMAGE_API_BASE"||i.key==="MODEL_EDIT_API_BASE"||i.key==="MODEL_VIDEO_API_BASE"?{...i,placeholder:xl(t)}:i)}function Q7t({items:e,selected:t,onToggle:n,scrollRows:i}){const{t:r}=Te("create");return o.jsx("div",{className:`cw-checklist ${i?"cw-checklist-tools":""}`,style:i?{"--cw-checklist-max-height":`${i*40+(i-1)*8}px`}:void 0,children:e.map(s=>{const a=t.includes(s.id);return o.jsx(fz,{id:`cw-check-${s.id}`,className:`cw-check ${a?"is-on":""}`,checked:a,onCheckedChange:l=>{l!==a&&n(s.id)},label:o.jsx("span",{className:"cw-check-text",children:o.jsx("span",{className:"cw-check-title",children:r(`traditional.catalog.${s.id}.label`,{defaultValue:s.label})})})},s.id)})})}function CL({options:e,value:t,onChange:n,translationGroup:i}){const{t:r}=Te("create");return o.jsx("div",{className:"cw-segmented",children:e.map(s=>{var l;const a=(t??((l=e[0])==null?void 0:l.id))===s.id;return o.jsx("button",{type:"button",className:`cw-seg ${a?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":a,children:o.jsx("span",{className:"cw-seg-title",children:r(`traditional.backends.${i}.${s.id}.label`,{defaultValue:s.label})})},s.id)})})}function z7t(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function hw({env:e,values:t,onChange:n,renderAfterField:i}){const{t:r}=Te("create"),s=e.filter(a=>!a.hidden);return s.length===0?o.jsx("p",{className:"cw-env-empty",children:r("traditional.env.noAdditionalParameters")}):o.jsx("div",{className:"cw-env-fields",children:s.map(a=>{const l=t[a.key]??a.defaultValue??"",c=uz(a,t,r("traditional.env.invalidJson")),u=`cw-env-${a.key}`;return o.jsxs(p.Fragment,{children:[o.jsxs("label",{className:"cw-env-field",htmlFor:u,children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-title",children:[o.jsxs("span",{className:"cw-env-field-label",children:[a.comment||a.key,a.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),a.help&&o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":a.help,"aria-label":r("traditional.env.helpAriaLabel",{label:a.comment||a.key,help:a.help}),children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:a.help})]}),a.link&&o.jsx("a",{className:"cw-env-link",href:a.link.url,target:"_blank",rel:"noopener noreferrer",title:r("traditional.env.openOpenViking",{label:a.link.label}),"aria-label":r("traditional.env.openOpenViking",{label:a.link.label}),onClick:d=>d.stopPropagation(),children:o.jsx(gb,{"aria-hidden":"true"})})]}),a.comment&&o.jsx("code",{title:a.key,children:a.key})]}),a.multiline||a.format==="json"?o.jsx("textarea",{id:u,className:"cw-input cw-env-textarea",value:l,placeholder:a.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":!!c,onChange:d=>n(a.key,d.currentTarget.value)}):o.jsx("input",{id:u,className:"cw-input",type:z7t(a.key)?"password":"text",value:l,placeholder:a.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off","aria-invalid":!!c,onChange:d=>n(a.key,d.currentTarget.value)}),c&&o.jsx("span",{className:"cw-env-error",children:c})]}),i==null?void 0:i(a)]},a.key)})})}function V7t({value:e,onChange:t}){const{t:n}=Te("create"),i="cw-openviking-knowledge-index",r=n("traditional.env.openVikingIndexHelp");return o.jsxs("label",{className:"cw-env-field",htmlFor:i,children:[o.jsx("span",{className:"cw-env-field-head",children:o.jsxs("span",{className:"cw-env-field-title",children:[o.jsx("span",{className:"cw-env-field-label",children:n("traditional.env.openVikingIndex")}),o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":r,"aria-label":n("traditional.env.openVikingIndexAriaLabel",{help:r}),children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:r})]})]})}),o.jsx("input",{id:i,className:"cw-input",value:e,placeholder:"",autoComplete:"off",onChange:s=>t(s.currentTarget.value)})]})}function TL(e,t=$t("traditional.resources.unnamedAgentCenter")){return e.name.trim()||t}function Hne(e,t=$t("traditional.resources.unnamedKnowledgeBase")){const n=e.name.trim()||e.id||t,i=[e.sourceLabel,e.projectName].filter(Boolean);return i.length?`${n} · ${i.join(" · ")}`:n}function qne(e,t=$t("traditional.resources.unnamedMemory")){return e.name.trim()||e.id||t}function H7t(e){return e.available?"traditional.model.available":e.lifecycleStatus==="Retiring"?"traditional.model.retiring":e.activationState&&e.activationState!=="Available"?"traditional.model.notActivated":"traditional.model.unavailable"}function q7t(e){return e.available||e.lifecycleStatus==="Retiring"}function Wne({selectedLabel:e,placeholder:t,disabled:n,triggerAriaLabel:i,menuAriaLabel:r,searchAriaLabel:s,searchValue:a,searchPlaceholder:l,onSearchChange:c,empty:u,emptyLabel:d,triggerClassName:f="",optionsClassName:h="",renderOptions:m}){const[g,b]=p.useState(!1),v=p.useRef(null),y=p.useRef(null),x=p.useRef(null),O=p.useId(),[w,k]=p.useState(null);p.useEffect(()=>{if(!g)return;const C=_=>{var A;const j=_.target;j instanceof Node&&v.current&&!v.current.contains(j)&&!((A=x.current)!=null&&A.contains(j))&&b(!1)},N=_=>{var j;_.key==="Escape"&&(b(!1),(j=y.current)==null||j.focus())};return window.addEventListener("pointerdown",C),window.addEventListener("keydown",N),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",N)}},[g]),p.useEffect(()=>{if(!g){k(null);return}const C=()=>{const N=y.current;if(!N)return;const _=N.getBoundingClientRect(),j=12,A=6,F=window.innerHeight-_.bottom-j-A,T=_.top-j-A,P=F<300&&T>F,R=Math.max(96,P?T:F),L=Math.min(_.width,window.innerWidth-j*2),M=Math.min(Math.max(j,_.left),window.innerWidth-j-L);k({...P?{bottom:window.innerHeight-_.top+A}:{top:_.bottom+A},left:M,width:L,maxHeight:R,opensUp:P})};return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[g]);const S=()=>b(!1),E=C=>{var A,F;if(!["ArrowDown","ArrowUp","Home","End"].includes(C.key))return;const N=Array.from(((A=x.current)==null?void 0:A.querySelectorAll('[role="option"]:not(:disabled)'))??[]);if(!N.length)return;C.preventDefault();const _=N.findIndex(T=>T===document.activeElement),j=C.key==="Home"?0:C.key==="End"?N.length-1:C.key==="ArrowUp"?_<=0?N.length-1:_-1:_<0||_===N.length-1?0:_+1;(F=N[j])==null||F.focus()};return o.jsxs("div",{className:`cw-a2a-space-select-wrap cw-catalog-select${g?" is-open":""}`,ref:v,children:[o.jsxs("button",{ref:y,type:"button",className:`cw-a2a-space-trigger ${f}`.trim(),disabled:n,"aria-haspopup":"listbox","aria-controls":g?O:void 0,"aria-expanded":g,"aria-label":i,title:e,onClick:()=>{g||c(""),b(C=>!C)},children:[o.jsx("span",{className:t?"is-placeholder":void 0,children:e}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),g&&w&&Li.createPortal(o.jsxs("div",{ref:x,className:`cw-a2a-space-menu cw-catalog-menu cw-catalog-menu-portal${w.opensUp?" is-up":""}`,style:{top:w.top??"auto",bottom:w.bottom??"auto",left:w.left,width:w.width,maxHeight:w.maxHeight},onKeyDown:E,children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:a,autoFocus:!0,autoComplete:"off","aria-label":s,placeholder:l,onChange:C=>c(C.currentTarget.value)})}),o.jsxs("div",{id:O,className:`cw-picker-options cw-catalog-options ${h}`.trim(),role:"listbox","aria-label":r,children:[m(S),u&&o.jsx("div",{className:"cw-picker-empty",children:d})]})]}),document.body)]})}function W7t({value:e,cloudProvider:t,apiKeyId:n,apiKeyName:i,onApiKeyChange:r,onChange:s}){const{t:a}=Te("create"),[l,c]=p.useState([]),[u,d]=p.useState(!1),[f,h]=p.useState([]),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState(null),[O,w]=p.useState(0),[k,S]=p.useState(0),[E,C]=p.useState(""),[N,_]=p.useState("");p.useEffect(()=>{const q=new AbortController;return d(!0),x(null),HF(q.signal,O>0).then(B=>{if(q.signal.aborted)return;c(B.keys);const ee=B.keys.find(le=>le.id===n)??B.keys.find(le=>le.name===i)??B.keys.find(le=>le.id===B.defaultKeyId)??B.keys[0];ee&&r(ee)}).catch(B=>{q.signal.aborted||x(B instanceof Error?B.message:a("traditional.model.apiKeyLoadError"))}).finally(()=>{q.signal.aborted||d(!1)}),()=>q.abort()},[t,O,a]),p.useEffect(()=>{if(!n){h([]);return}const q=new AbortController;return v(!0),x(null),g(null),Ex({signal:q.signal,apiKeyId:n,refresh:O>0||k>0}).then(B=>{q.signal.aborted||(h(B.models),g(n))}).catch(B=>{q.signal.aborted||x(B instanceof Error?B.message:a("traditional.model.loadError"))}).finally(()=>{q.signal.aborted||v(!1)}),()=>q.abort()},[n,t,k,O,a]);const j=e.trim(),A=m===n,F=A?f:[],T=l.find(q=>q.id===n),P=T?T.name:n?a("traditional.model.currentApiKey"):u?a("traditional.model.loadingApiKeys"):l.length===0?a("traditional.model.noApiKeys"):a("traditional.model.selectApiKey"),R=p.useMemo(()=>l.filter(q=>ub(E,[q.name])),[E,l]),L=F.find(q=>q.id===j),M=b&&!A?a("traditional.model.refreshing"):L?`${L.displayName} (${L.id})`:j||a("traditional.model.selectModel"),U=p.useMemo(()=>F.filter(q=>ub(N,[q.displayName,q.id,q.name,q.vendorName,q.activationState,q.lifecycleStatus])),[N,F]),I=!!(j&&!L&&ub(N,[j])),H=F.filter(q=>q.available).length,K=t==="byteplus"?"BytePlus ModelArk":a("traditional.model.volcengineArk"),Q=MBe(t);return o.jsxs("div",{className:"cw-a2a-space-picker cw-model-picker",children:[o.jsxs("div",{className:"cw-model-picker-stack",children:[o.jsxs("div",{className:"cw-model-picker-field",children:[o.jsx("span",{className:"cw-model-picker-label",children:"API Key"}),o.jsx(Wne,{selectedLabel:P,placeholder:!n,disabled:u,triggerAriaLabel:a("traditional.model.selectApiKey"),menuAriaLabel:a("traditional.model.apiKeyList"),searchAriaLabel:a("traditional.model.searchApiKey"),searchValue:E,searchPlaceholder:a("traditional.model.searchApiKeyName"),onSearchChange:C,empty:R.length===0,emptyLabel:a("traditional.model.noMatchingApiKey"),optionsClassName:"cw-model-key-options",renderOptions:q=>R.map(B=>{const ee=B.id===n;return o.jsx("button",{type:"button",role:"option","aria-selected":ee,className:`cw-a2a-space-option cw-model-key-option ${ee?"is-selected":""}`,title:B.name,onClick:()=>{S(le=>le+1),r(B),q()},children:o.jsx("span",{children:B.name})},B.id)})})]}),o.jsxs("div",{className:"cw-model-picker-field",children:[o.jsx("span",{className:"cw-model-picker-label",children:a("traditional.model.label")}),o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsx(Wne,{selectedLabel:M,placeholder:!j,disabled:b,triggerAriaLabel:a("traditional.model.selectProviderModel",{provider:K}),menuAriaLabel:a("traditional.model.providerModels",{provider:K}),searchAriaLabel:a("traditional.model.search"),searchValue:N,searchPlaceholder:a("traditional.model.searchPlaceholder"),onSearchChange:_,empty:!I&&U.length===0,emptyLabel:a("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:q=>o.jsxs(o.Fragment,{children:[I&&o.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{s(j),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:a("traditional.model.currentConfiguration")}),o.jsx("small",{children:j})]}),o.jsx("span",{className:"cw-model-status is-unknown",children:a("traditional.model.unknownStatus")})]}),U.map(B=>{const ee=B.id===j,le=q7t(B);return!le&&B.activationState!=="Available"?o.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:a("traditional.model.activate",{provider:K,model:B.displayName}),onClick:()=>{window.open(Q,"_blank","noopener,noreferrer"),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:B.displayName}),o.jsxs("small",{children:[B.id,B.vendorName?` · ${B.vendorName}`:""]})]}),o.jsx("span",{className:"cw-model-status is-unavailable",children:a("traditional.model.activateAction")})]},B.id):o.jsxs("button",{type:"button",role:"option","aria-selected":ee,disabled:!le,className:`cw-a2a-space-option cw-model-option ${ee?"is-selected":""}`,title:`${B.displayName} (${B.id})`,onClick:()=>{s(B.id),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:B.displayName}),o.jsxs("small",{children:[B.id,B.vendorName?` · ${B.vendorName}`:""]})]}),o.jsx("span",{className:`cw-model-status ${B.available?"is-available":B.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:a(H7t(B))})]},B.id)})]})}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:a("traditional.model.refresh"),"aria-label":a("traditional.model.refresh"),disabled:b||u,onClick:()=>w(q=>q+1),children:b||u?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]})]})]}),y?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",role:"alert",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:y})]}):b?o.jsxs("span",{className:"cw-help cw-a2a-space-status","aria-live":"polite",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),a("traditional.model.loading")]}):F.length===0?o.jsx("span",{className:"cw-help",children:a("traditional.model.empty")}):o.jsx("span",{className:"cw-help",children:a("traditional.model.loaded",{count:F.length,available:H})})]})}function G7t({value:e,region:t,invalid:n,onChange:i}){const{t:r}=Te("create"),s=t.trim()||nv.region,[a,l]=p.useState([]),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState(0),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(null);p.useEffect(()=>{let _=!1;return u(!0),f(null),k7t({region:s}).then(j=>{_||l(j)}).catch(j=>{_||(l([]),f(j instanceof Error?j.message:r("traditional.resources.loadError")))}).finally(()=>{_||u(!1)}),()=>{_=!0}},[s,h,r]);const O=!e||a.some(_=>_.id===e.trim()),w=a.find(_=>_.id===e.trim()),k=w?TL(w,r("traditional.resources.unnamedAgentCenter")):r(e&&!O?"traditional.resources.selectedAgentCenter":"traditional.resources.selectAgentCenter"),S=c&&a.length===0,E=p.useMemo(()=>a.filter(_=>ub(v,[TL(_,r("traditional.resources.unnamedAgentCenter")),_.id,_.projectName])),[v,a,r]),C=!!(e&&!O&&ub(v,[r("traditional.resources.selectedAgentCenter"),e]));p.useEffect(()=>{if(!g)return;const _=A=>{const F=A.target;F instanceof Node&&x.current&&!x.current.contains(F)&&b(!1)},j=A=>{A.key==="Escape"&&b(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",j)}},[g]);const N=_=>{i(_),b(!1)};return o.jsxs("div",{className:`cw-a2a-space-picker${g?" is-open":""}`,ref:x,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":g,"aria-label":r("traditional.resources.selectAgentKitCenter"),onClick:()=>{y(""),b(_=>!_)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:k}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),g&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:v,autoFocus:!0,autoComplete:"off","aria-label":r("traditional.resources.searchAgentKitCenter"),placeholder:r("traditional.resources.searchNameOrId"),onChange:_=>y(_.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":r("traditional.resources.agentKitCenter"),children:[C&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>N(e),children:r("traditional.resources.selectedAgentCenter")}),E.map(_=>{const j=TL(_,r("traditional.resources.unnamedAgentCenter")),A=_.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:`${j} (${_.id})`,onClick:()=>N(_.id),children:j},_.id)}),!C&&E.length===0&&o.jsx("div",{className:"cw-picker-empty",children:r("traditional.resources.noMatchingAgentCenters")})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:r("traditional.resources.refreshAgentCenters"),"aria-label":r("traditional.resources.refreshAgentCenters"),disabled:c,onClick:()=>m(_=>_+1),children:c?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:d})]}):c?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),r("traditional.resources.loadingAgentCenters")]}):a.length===0?o.jsx("span",{className:"cw-help",children:r("traditional.resources.noAgentCenters")}):o.jsx("span",{className:"cw-help",children:r("traditional.resources.agentCentersLoaded",{count:a.length})})]})}function nIe({value:e,items:t,loading:n,error:i,pickerClassName:r,selectLabel:s,searchLabel:a,listLabel:l,placeholder:c,emptyMessage:u,loadedMessage:d,refreshLabel:f,noMatchesMessage:h,getLabel:m,getSearchFields:g,getKey:b,getOptionIds:v,makeUnknownItem:y,onChange:x,onRefresh:O}){const{t:w}=Te("create"),[k,S]=p.useState(!1),[E,C]=p.useState(""),N=p.useRef(null),_=!e||t.some(L=>L.id===e.trim()),j=t.find(L=>L.id===e.trim()),A=j?m(j):e&&!_?e:c,F=n&&t.length===0,T=p.useMemo(()=>t.filter(L=>ub(E,g(L))),[g,t,E]),P=!!(e&&!_&&ub(E,[e]));p.useEffect(()=>{if(!k)return;const L=U=>{const I=U.target;I instanceof Node&&N.current&&!N.current.contains(I)&&S(!1)},M=U=>{U.key==="Escape"&&S(!1)};return window.addEventListener("pointerdown",L),window.addEventListener("keydown",M),()=>{window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",M)}},[k]);const R=L=>{x(L),S(!1)};return n&&t.length===0?o.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),w("common.loading")]}):o.jsxs("div",{className:`cw-a2a-space-picker ${r}${k?" is-open":""}`,ref:N,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:F,"aria-haspopup":"listbox","aria-expanded":k,"aria-label":s,onClick:()=>{C(""),S(L=>!L)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:A}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),k&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:E,autoFocus:!0,autoComplete:"off","aria-label":a,placeholder:w("traditional.resources.searchNameOrId"),onChange:L=>C(L.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":l,children:[P&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>R(y(e)),children:e}),T.map(L=>{const M=m(L),U=L.id===e,I=v(L).filter(Boolean).join(" / ");return o.jsx("button",{type:"button",role:"option","aria-selected":U,className:`cw-a2a-space-option ${U?"is-selected":""}`,title:I?`${M} (${I})`:M,onClick:()=>R(L),children:M},b(L))}),!P&&T.length===0&&o.jsx("div",{className:"cw-picker-empty",children:h})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:f,"aria-label":f,disabled:n,onClick:O,children:n?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]}),i?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i})]}):t.length===0?o.jsx("span",{className:"cw-help",children:u}):o.jsx("span",{className:"cw-help",children:d(t.length)})]})}function K7t({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return a(!0),c(null),C7t().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||a(!1)}),()=>{f=!0}},[u,n]),o.jsx(nIe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-kb-picker",selectLabel:n("traditional.resources.selectKnowledgeBase"),searchLabel:n("traditional.resources.searchKnowledgeBase"),listLabel:n("traditional.resources.knowledgeBaseList"),placeholder:n("traditional.resources.knowledgeBasePlaceholder"),emptyMessage:n("traditional.resources.noKnowledgeBases"),loadedMessage:f=>n("traditional.resources.knowledgeBasesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshKnowledgeBases"),noMatchesMessage:n("traditional.resources.noMatchingKnowledgeBases"),getLabel:f=>Hne(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Hne(f,n("traditional.resources.unnamedKnowledgeBase")),f.id,f.description,f.projectName,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId,f.sourceLabel],getKey:f=>f.id,getOptionIds:f=>[f.id,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),onChange:t,onRefresh:()=>d(f=>f+1)})}function X7t({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return a(!0),c(null),A7t().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||a(!1)}),()=>{f=!0}},[u,n]),o.jsx(nIe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-memory-picker",selectLabel:n("traditional.resources.selectMemory"),searchLabel:n("traditional.resources.searchMemory"),listLabel:n("traditional.resources.memoryList"),placeholder:n("traditional.resources.memoryPlaceholder"),emptyMessage:n("traditional.resources.noMemories"),loadedMessage:f=>n("traditional.resources.memoriesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshMemories"),noMatchesMessage:n("traditional.resources.noMatchingMemories"),getLabel:f=>qne(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[qne(f,n("traditional.resources.unnamedMemory")),f.id,f.description,f.projectName,f.region,f.resourceId,...f.memoryTypes??[]],getKey:f=>`${f.projectName}:${f.region}:${f.id}`,getOptionIds:f=>[f.id,f.resourceId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",resourceId:"",memoryTypes:[]}),onChange:t,onRefresh:()=>d(f=>f+1)})}function Y7t({tools:e,conflict:t,showConflict:n,onChange:i}){const{t:r}=Te("create"),s=p.useId(),a=n?t:null,l=(d,f)=>i(e.map((h,m)=>m===d?{...h,...f}:h)),c=d=>i(e.filter((f,h)=>h!==d)),u=()=>i([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(Ru,{initial:!1,children:e.map((d,f)=>o.jsxs(pr.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${d.transport==="http"?"is-on":""}`,onClick:()=>l(f,{transport:"http"}),"aria-pressed":d.transport==="http",children:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${d.transport==="stdio"?"is-on":""}`,onClick:()=>l(f,{transport:"stdio"}),"aria-pressed":d.transport==="stdio",children:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>c(f),"aria-label":r("traditional.mcp.removeTool"),children:o.jsx(pm,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input","data-validation-field":"mcp-name","aria-invalid":a==="duplicateName","aria-describedby":a==="duplicateName"?s:void 0,value:d.name,placeholder:r("traditional.mcp.namePlaceholder"),onChange:h=>l(f,{name:h.target.value})}),d.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input","data-validation-field":"mcp-url","aria-invalid":a==="duplicateUrl","aria-describedby":a==="duplicateUrl"?s:void 0,value:d.url??"",placeholder:r("traditional.mcp.urlPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?n7t(m,h.target.value):m))}),t7t(d.url??"")&&o.jsxs("p",{className:"cw-mcp-warning",children:[o.jsx(Wd,{"aria-hidden":"true"}),o.jsx("span",{children:r("traditional.mcp.pathWarning")})]}),o.jsx("input",{className:"cw-input","aria-invalid":KRe(d),value:ZFt(d),placeholder:d.credentialConfigured&&!d.authToken?r("traditional.mcp.configuredPlaceholder"):r("traditional.mcp.tokenPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?JFt(m,h.target.value):m))}),d.credentialUpdate==="pending"&&o.jsxs("div",{className:"cw-mcp-auth-state is-warning",role:"alert",children:[o.jsx("span",{children:r("traditional.mcp.changedUrlWarning")}),o.jsxs("div",{className:"cw-mcp-auth-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?i7t(h):h)),children:r("traditional.mcp.reuseCredential")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?I8(h):h)),children:r("traditional.mcp.replaceCredential")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?r7t(h):h)),children:r("traditional.mcp.noAuth")})]})]}),d.credentialUpdate==="reuse"&&o.jsxs("div",{className:"cw-mcp-auth-state",role:"status",children:[o.jsx("span",{children:r("traditional.mcp.reuseHint")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?I8(h):h)),children:r("traditional.mcp.changeToReplace")})]}),d.credentialConfigured&&!d.authToken&&!d.credentialUpdate&&o.jsxs("div",{className:"cw-mcp-auth-state",role:"status",children:[o.jsx("span",{children:r("traditional.mcp.credentialConfigured")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?e7t(h):h)),children:r("traditional.mcp.removeCredential")})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:d.command??"",placeholder:r("traditional.mcp.commandPlaceholder"),onChange:h=>l(f,{command:h.target.value})}),o.jsx("input",{className:"cw-input",value:(d.args??[]).join(" "),placeholder:r("traditional.mcp.argsPlaceholder"),onChange:h=>l(f,{args:h.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:r("traditional.mcp.stdioHint")})]})]},f))})}),a&&o.jsx("p",{className:"cw-error-text",id:s,role:"alert",children:r(a==="duplicateName"?"traditional.validation.mcpDuplicateName":"traditional.validation.mcpDuplicateUrl")}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:u,children:[o.jsx(Fo,{className:"cw-i"}),r("traditional.mcp.addTool")]})]})}function k2({checked:e,onChange:t,title:n,desc:i,showDescription:r=!1}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),r&&o.jsx("span",{className:"cw-toggle-help",children:i})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(pr.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Z7t(e,t){var i;let n=e;for(const r of t)if(n=(i=n.subAgents)==null?void 0:i[r],!n)return!1;return!0}function E2(e,t){let n=e;for(const i of t)n=n.subAgents[i];return n}function XE(e,t,n){if(t.length===0)return n(e);const[i,...r]=t,s=e.subAgents.slice();return s[i]=XE(s[i],r,n),{...e,subAgents:s}}function J7t(e,t,n="volcengine"){return XE(e,t,i=>({...i,subAgents:[...i.subAgents,oc(n)]}))}function eBt(e,t,n,i="volcengine"){return XE(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,oc(i)),{...r,subAgents:s}})}function tBt(e,t){if(t.length===0)return e;const n=t.slice(0,-1),i=t[t.length-1];return XE(e,n,r=>({...r,subAgents:r.subAgents.filter((s,a)=>a!==i)}))}const M8=e=>!GI(e.agentType),Gne=3;function nBt(e,t,n=!1){var r;if(GI(e.agentType))return n?"remoteRoot":(r=e.a2aRegistry)!=null&&r.registrySpaceId.trim()?null:"missingRegistry";const i=WE(e.name,s=>`name.${s}`);return i||(t.has(e.name)?"duplicateName":e.description.trim().length===0?"missingDescription":(e.mcpTools??[]).some(KRe)?"mcpAuthRequired":RRe(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function iIe(e,t,n=[]){const i=[];if(n.length===0){const a=WRe(e);a&&i.push({path:n,name:e.name.trim(),agentType:e.agentType,problem:a==="duplicateName"?"mcpDuplicateName":"mcpDuplicateUrl"})}const r=GI(e.agentType),s=nBt(e,t,n.length===0);return s&&i.push({path:n,name:r?"":e.name.trim(),agentType:e.agentType,problem:s}),M8(e)&&e.subAgents.forEach((a,l)=>i.push(...iIe(a,t,[...n,l]))),i}function iBt(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function rIe(e){return 1+e.subAgents.reduce((t,n)=>t+rIe(n),0)}function L8(e,t=!1){const n=KE(e),i=aN(n.draft).includes("mcp_resilience"),r=[],s={...n.envValues},a=n.draft.cloudProvider??"volcengine",l=Ust(n.draft).map(mA);let c=!1,u="";for(const h of kRe(n.draft,xl(a))){const m=[{key:h.apiKeyKey,required:!0,comment:h.label}];h.providerKey&&(m.push({key:h.providerKey,required:!0}),s[h.providerKey]=h.provider),h.apiBaseKey&&(m.push({key:h.apiBaseKey,required:!0}),s[h.apiBaseKey]=h.apiBase),r.push({env:m})}const d=h=>{var m,g,b,v;h.agentType==="llm"&&Im(h,a)==="ark"&&(c=!0,u||(u=(h.modelName??"").trim()));for(const y of h.builtinTools??[]){const x=Bx.find(O=>O.id===y);x&&r.push({env:cy(x.env,a)})}for(const y of h.mcpTools??[])y.authTokenEnv&&r.push({env:[{key:y.authTokenEnv,required:!1,comment:`${y.name.trim()||"MCP"} Bearer Token`,secret:!0,readOnly:i,serverManaged:i,hidden:i}]});if((m=h.a2aRegistry)!=null&&m.enabled&&(r.push({env:cy(gOe,a)}),Object.assign(s,tIe(h.a2aRegistry,{includeDefaults:!0},a))),h.memory.shortTerm&&r.push({env:cy(((g=iv.find(y=>y.id===(h.shortTermBackend??"local")))==null?void 0:g.env)??[],a)}),h.memory.longTerm&&r.push({env:cy(((b=v6.find(y=>y.id===(h.longTermBackend??"local")))==null?void 0:b.env)??[],a)}),h.knowledgebase&&r.push({env:cy(((v=x6.find(y=>y.id===(h.knowledgebaseBackend??nm)))==null?void 0:v.env)??[],a)}),h.tracing)for(const y of h.tracingExporters??[]){const x=Rst.find(O=>O.id===y);x&&r.push({env:x.env,enableFlag:x.enableFlag})}h.subAgents.forEach(d)};if(d(n.draft),c){r.push({env:[{key:"MODEL_AGENT_PROVIDER",required:!0},{key:"MODEL_AGENT_API_BASE",required:!0},{key:"MODEL_AGENT_API_KEY",required:!0,comment:"Ark API Key",placeholder:$t("helpers.deploymentEnv.selectedApiKeyPlaceholder"),secret:!0,readOnly:!0,serverManaged:!0,requiredBy:l}]}),s.MODEL_AGENT_PROVIDER="openai",s.MODEL_AGENT_API_BASE=xl(a);const h=u||wh(a);s.MODEL_AGENT_NAME=h,s.MODEL_NAME=h}if(i){if(t){r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:$t("helpers.deploymentEnv.mcpInjectedComment"),placeholder:$t("helpers.deploymentEnv.restoredPlaceholder"),help:$t("helpers.deploymentEnv.restoredHelp"),readOnly:!0,serverManaged:!0,hidden:!0,requiredBy:[mA("mcp_resilience")]}]});const g=j8(r);return{specs:g.specs,fixedValues:{...g.fixedValues,...s}}}const h=d7t(n.draft),m=h.ok?void 0:h.message;r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:$t("helpers.deploymentEnv.mcpInjectedComment"),placeholder:$t(t?"helpers.deploymentEnv.restoredPlaceholder":"helpers.deploymentEnv.generatedMcpPlaceholder"),help:$t("helpers.deploymentEnv.mergedMcpHelp"),secret:!0,readOnly:!0,serverManaged:h.ok,hidden:!0,requiredBy:[mA("mcp_resilience")],missingError:m}]})}const f=j8(r);return{specs:f.specs,fixedValues:{...f.fixedValues,...s}}}function sIe(e,t){var i;if(e.id==="baseline")return t("traditional.debug.baseline");const n=(i=/^variant-(\d+)$/.exec(e.id))==null?void 0:i[1];return n?t("traditional.debug.comparison",{count:Number(n)}):e.name}function rBt(e,t){const n=i=>(i??"").trim().replace(/\/+$/,"");return n(e)===n(t)}function sBt(e,t,n){const i=(e??"").trim();return!i||i===wh(t)?!0:i===wh(n)?!1:n==="byteplus"&&i.includes("doubao-")}function Ig(e,t){const n=e.cloudProvider??"volcengine",i=Im(e,n),r=e.subAgents.map(u=>Ig(u,t)),s=i==="ark"&&sBt(e.modelName,n,t)?wh(t):e.modelName,l=rBt(e.modelApiBase,xl(n))||t==="byteplus"&&(e.modelApiBase??"").includes("volces.com")?xl(t):e.modelApiBase;return e.cloudProvider!==t||s!==e.modelName||l!==e.modelApiBase||r.some((u,d)=>u!==e.subAgents[d])?{...e,cloudProvider:t,modelName:s,modelApiBase:l,subAgents:r}:e}function aBt(e,t){var l;const n=Ig(e,t),i=ERe(n,xl(t)),r=new Set(i.map(({key:c})=>c)),s=((l=n.deployment)==null?void 0:l.envValues)??{},a=Object.fromEntries(Object.entries(s).filter(([c,u])=>r.has(c)&&!!u.trim()));return Object.keys(a).length===0?{draft:n,customModelSecretValues:a}:{draft:{...n,deployment:{...n.deployment??{feishuEnabled:!1},envValues:Object.fromEntries(Object.entries(s).filter(([c])=>!r.has(c)))}},customModelSecretValues:a}}function Kw(e){var i,r,s;const t=KE(e).draft;return{...ARe(t,t.cloudProvider??"volcengine"),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),modelApiKeyId:((r=e.deployment)==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:((s=e.deployment)==null?void 0:s.modelApiKeyName)??""}}}function $8(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const i of e.subAgents){const r=$8(i);if(r)return r}return""}function aIe(e,t={}){var r,s,a,l;const n=L8(e),i={...((r=e.deployment)==null?void 0:r.envValues)??{},...t,...n.fixedValues};return{...Kw(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),modelApiKeyId:((a=e.deployment)==null?void 0:a.modelApiKeyId)??"",modelApiKeyName:((l=e.deployment)==null?void 0:l.modelApiKeyName)??"",envValues:Object.fromEntries(cz(n.specs,i).map(({key:c,value:u})=>[c,u]))}}}function oBt(e,t={}){return JSON.stringify(aIe(e,t))}function fj(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction})}function By(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim()})}function lBt({enabled:e,disabledReason:t,variants:n,draftSnapshot:i,input:r,onInput:s,onSend:a,onStartVariant:l,onUseVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:m,onOpenTrace:g}){const{t:b}=Te("create"),v=n.filter(O=>O.phase!=="ready"?!1:O.runtimeSnapshot===fj(i,O)),y=n.some(O=>O.phase==="sending"),x=v.length>0&&!y;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":b("traditional.debug.ariaLabel"),children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((O,w)=>{const k=sIe(O,b),S=O.modelName.trim(),E=O.description.trim(),C=O.instruction.trim(),N=By(O),_=!!(S&&E&&C&&n.findIndex(I=>By(I)===N)!==w),j=!S||!E||!C||_,A=!!(O.runtimeSnapshot&&O.runtimeSnapshot!==fj(i,O)),F=O.phase==="starting",T=O.phase==="ready"&&!A,P=F||O.phase==="sending",R=T&&O.phase!=="sending"&&O.messages.some(I=>I.role==="assistant"),L=P||O.configOpen||j,M=S?E?C?_?b("traditional.debug.duplicateConfiguration"):"":b("traditional.debug.enterPrompt"):b("traditional.debug.enterDescription"):b("traditional.debug.selectModel"),U=F?b("traditional.debug.starting"):A?b("traditional.debug.applyAndRestart"):T||O.phase==="error"?b("traditional.debug.restart"):b("traditional.debug.start");return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${O.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":O.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:k}),o.jsx("span",{children:O.modelName||b("traditional.debug.defaultModel")})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:O.configOpen||P,onClick:()=>f(O.id),children:b("traditional.debug.testConfiguration")}),O.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),disabled:O.configOpen||P,onClick:()=>d(O.id),children:o.jsx(zne,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:O.error?o.jsx(Lb,{message:O.error,className:"cw-debug-error-detail",defaultExpanded:!0}):F?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(fi,{className:"cw-i cw-spin"}),o.jsx("span",{children:b("traditional.debug.creatingEnvironment")})]}):A?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:b("traditional.debug.configurationChanged")})}):O.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:T?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:b("traditional.debug.ready")}),o.jsx("span",{className:"cw-ab-launch-hint",children:b("traditional.debug.readyHint")})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:M||b("traditional.debug.startHint")})}):O.messages.map((I,H)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${I.role}`,children:o.jsx("div",{className:"cw-debug-content",children:I.role==="user"?I.content:I.error?o.jsx(Lb,{message:I.error,className:"cw-debug-msg-error",defaultExpanded:!0}):I.blocks&&I.blocks.length>0?o.jsx(TE,{blocks:I.blocks,onAction:()=>{}}):I.content?I.content:H===O.messages.length-1&&O.phase==="sending"?o.jsx(PCe,{}):null})},H))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!R,title:R?b("traditional.debug.viewTraceNamed",{name:k}):b("traditional.debug.traceUnavailable"),onClick:()=>g(O.id),children:b("traditional.debug.trace")}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:L,title:M||void 0,onClick:()=>l(O.id),children:[T||A||O.phase==="error"?o.jsx(R7e,{className:"cw-i"}):o.jsx(F7t,{className:"cw-i cw-debug-run-icon"}),U]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:P||!S,onClick:()=>c(O.id),children:b("traditional.debug.useConfiguration")})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!O.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:b("traditional.debug.testConfiguration")}),o.jsx("span",{children:k})]}),o.jsxs("div",{className:"cw-ab-config-head-actions",children:[O.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),title:b("traditional.debug.deleteVariantGroup"),disabled:P,onClick:()=>d(O.id),children:o.jsx(zne,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:`cw-ab-config-done-wrap${M?" is-disabled":""}`,tabIndex:M?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!O.configOpen||j,onClick:()=>h(O.id),children:O.id==="baseline"?b("traditional.debug.finishConfiguration"):b("traditional.debug.finishAndStart")}),M&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:M})]})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:b("traditional.model.label")}),o.jsx("input",{value:O.modelName,placeholder:b("traditional.debug.currentAgentModel"),disabled:!O.configOpen,onChange:I=>m(O.id,"modelName",I.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:b("common.description")}),o.jsx("textarea",{rows:2,value:O.description,disabled:!O.configOpen,onChange:I=>m(O.id,"description",I.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:b("traditional.basic.systemPrompt")}),o.jsx("textarea",{rows:5,value:O.instruction,disabled:!O.configOpen,onChange:I=>m(O.id,"instruction",I.target.value)})]}),o.jsx("p",{children:b("traditional.debug.configurationHint")})]})]})]})},O.id)})}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsxs("div",{className:"cw-ab-composer",children:[o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:r,placeholder:b(x?"traditional.debug.messagePlaceholder":"traditional.debug.startOneFirst"),disabled:!x,onChange:O=>s(O.target.value),onKeyDown:O=>{VI(O.nativeEvent)||O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:b("common.send"),disabled:!x||!r.trim(),onClick:a,children:y?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(a7e,{className:"cw-i"})})]}),e&&n.length<3&&o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[o.jsx(Fo,{className:"cw-i"}),b("traditional.debug.addVariant")]})]})]})}function cBt({profile:e,optimizations:t,unavailableMessage:n,onProfileChange:i,onOptimizationChange:r}){const{t:s}=Te("create");return o.jsx("section",{className:"cw-optimize-workspace","aria-label":s("traditional.optimization.ariaLabel"),children:o.jsxs("div",{className:"cw-optimize-panel",children:[n?o.jsxs("div",{className:"cw-banner",role:"alert",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:n})]}):null,o.jsxs("fieldset",{className:"cw-optimize-section",children:[o.jsx("legend",{children:s("traditional.optimization.scenario")}),o.jsx(Wg,{className:"cw-optimize-profile-options","aria-label":s("traditional.optimization.scenario"),value:e,onChange:i,children:OB.map(a=>o.jsx("div",{className:`cw-optimize-profile-option${e===a.id?" is-on":""}`,children:o.jsx(Wg.Item,{value:a.id,block:!0,className:"cw-optimize-profile-control",children:o.jsxs("span",{className:"cw-optimize-profile-copy",children:[o.jsx("strong",{children:s(`traditional.optimization.profiles.${a.id}.label`)}),o.jsx("small",{children:s(`traditional.optimization.profiles.${a.id}.description`)})]})})},a.id))})]}),o.jsxs("fieldset",{className:"cw-optimize-section",children:[o.jsx("legend",{children:s("traditional.optimization.components")}),o.jsx("div",{className:"cw-optimize-option-list",children:Ist.map(a=>o.jsxs("section",{className:"cw-optimize-option-group","aria-labelledby":`cw-optimize-group-${a.id}`,children:[o.jsx("h3",{id:`cw-optimize-group-${a.id}`,className:"cw-optimize-option-group-title",children:s(`traditional.optimization.groups.${a.id}`)}),o.jsx("div",{className:"cw-optimize-option-group-items",children:a.componentIds.map(l=>{const c=wB.find(d=>d.id===l);if(!c)return null;const u=t.includes(c.id);return o.jsx(fz,{checked:u,onCheckedChange:d=>{const f=!!d;f!==u&&r(c.id,f)},label:o.jsxs("span",{className:"cw-optimize-option-copy",children:[o.jsx("strong",{children:s(`traditional.optimization.options.${c.id}.label`)}),o.jsx("small",{children:s(`traditional.optimization.options.${c.id}.description`)})]}),className:"cw-optimize-option"},c.id)})})]},a.id))})]})]})})}const C2=[{id:"build",label:"traditional.workspace.modes.build"},{id:"validate",label:"traditional.workspace.modes.validate"},{id:"optimize",label:"traditional.workspace.modes.optimize"},{id:"environment",label:"traditional.workspace.modes.environment"},{id:"publish",label:"traditional.workspace.modes.publish"}],uBt={build:"traditional.workspace.titles.build",validate:"traditional.workspace.titles.validate",optimize:"traditional.workspace.titles.optimize",environment:"traditional.workspace.titles.environment",publish:"traditional.workspace.titles.publish"};function dBt({mode:e}){const{t}=Te("create");return o.jsx("header",{className:"cw-workspace-header",children:o.jsx("h1",{children:t(uBt[e])})})}function fBt({mode:e,busy:t,onChange:n,assistant:i,accessory:r}){const{t:s}=Te("create"),a=C2.findIndex(u=>u.id===e),l=C2[a-1],c=C2[a+1];return o.jsxs("footer",{className:"cw-workspace-footer",children:[r?o.jsx("div",{className:"cw-workspace-footer-accessory",children:r}):null,o.jsxs("div",{className:`cw-workspace-nav-actions${i?" has-assistant":""}`,children:[o.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!l||t,onClick:()=>l&&n(l.id),children:s("common.previous")}),o.jsx("span",{"aria-hidden":"true"}),i?o.jsx("div",{className:"cw-workspace-ai-slot",children:i}):null,e==="publish"?o.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):o.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!c||t,onClick:()=>c&&n(c.id),children:s("common.next")})]}),o.jsx("nav",{className:"cw-workspace-progress","aria-label":s("traditional.workspace.progress"),children:C2.map((u,d)=>{const f=u.id===e;return o.jsx("button",{type:"button",className:`${f?"is-active":""}${dn(u.id),children:o.jsx("span",{"aria-hidden":"true"})},u.id)})})]})}function hBt({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:i,features:r,onDeploymentTaskChange:s,createMode:a="custom",freshCreationSurface:l="traditional",workspaceDraftId:c,deploymentTarget:u,cloudProvider:d="volcengine",initialDeployRegion:f=Ji(d),onDeploymentComplete:h,onDeploymentStarted:m,onDraftChange:g,onDiscard:b}){var ji,nd,vc,du,us,Tl,xc,Sr,Qn,za,rf,Al,be,Ye,Ct,_n,Dt,fn,On;const{t:v}=Te("create"),y=a==="custom"&&l==="vulcan",x=y&&!i,[O]=p.useState(()=>{const Y=i??oc(d),we=x?{...Y,name:Y.name.trim()?Y.name:"assistant",dynamicAgentDelegation:!0}:Y;return aBt(we,d)}),[w,k]=p.useState(O.draft),S=y,[E,C]=p.useState(O.customModelSecretValues),N=((ji=w.deployment)==null?void 0:ji.runtimeName)??"",_=u?u.name:D4t(w.name,N,(nd=w.deployment)==null?void 0:nd.runtimeNameCustomized),j=E;p.useEffect(()=>{k(Y=>Ig(Y,d))},[d]);const[A,F]=p.useState(""),[T,P]=p.useState(!1),[R,L]=p.useState(!1),[M,U]=p.useState(!1),[I,H]=p.useState(null),K=A.trim(),Q=K.length>0&&K.length{se.current=g},[g]),p.useEffect(()=>{var Y;ee!==B.current&&(B.current=ee,(Y=se.current)==null||Y.call(se,Ig(w,d),le))},[d,w,le,ee]);const[re,ge]=p.useState("build"),[W,X]=p.useState(!1),[ae,ue]=p.useState(()=>new Set),[Oe,ke]=p.useState(0),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),[qe,Ae]=p.useState((u==null?void 0:u.region)??f),ze=(r==null?void 0:r.generatedAgentTestRun)===!0,Ee=(r==null?void 0:r.generatedAgentTestRunDisabledReason)||v("traditional.debug.unavailable"),[De,J]=p.useState(()=>{const Y=Ig(i??oc(d),d);return[{id:"baseline",name:v("traditional.debug.baseline"),modelName:$8(Y),description:Y.description,instruction:Y.instruction,configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]}),[he,_e]=p.useState("baseline"),Ze=p.useRef(1),at=p.useRef(!1),wt=p.useRef(new Map),[Se,ve]=p.useState(0),[He,Je]=p.useState(""),[Ce,Wt]=p.useState(null),[ln,cn]=p.useState(!1),[Ot,jt]=p.useState(!1),ot=p.useRef(null),[gt,Pe]=p.useState(""),[Et,bt]=p.useState(!1),[Mt,$e]=p.useState(null),[ye,Ue]=p.useState(""),[Ke,ft]=p.useState(!1),[ut,Gt]=p.useState(!1),[Rt,zt]=p.useState([]),Z=p.useRef(null),Bt=p.useRef({});async function Qe(){const Y=new Set([...wt.current.values()].map(({run:Ge})=>Ge.runId)),we=hz().filter(Ge=>!Y.has(Ge));we.length&&await Promise.all(we.map(async Ge=>{try{await ey(Ge),fw(Ge)}catch(_t){console.warn("Failed to clean up stale debug run",_t)}}))}p.useEffect(()=>(Qe(),()=>{for(const{run:Y}of wt.current.values())ey(Y.runId).then(()=>fw(Y.runId)).catch(we=>console.warn("Failed to clean up debug run",we));wt.current.clear()}),[]),p.useEffect(()=>()=>{var Y;(Y=ot.current)==null||Y.call(ot,!1),ot.current=null},[]);const tt=p.useRef(null);tt.current||(tt.current=({meta:Y,children:we})=>o.jsxs("section",{ref:Ge=>{Bt.current[Y.id]=Ge},id:`cw-sec-${Y.id}`,"data-step-id":Y.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsx("h2",{className:"cw-sec-title",children:v(Y.label)})}),o.jsx("div",{className:"cw-sec-body",children:we})]}));const ht=Z7t(w,Rt)?Rt:[],pe=E2(w,ht),We=ht.length===0,vt=ht.join(".")||"root",vn=()=>{ue(Y=>Y.has(vt)?Y:new Set(Y).add(vt))},Ki=`cw-a2a-registry-advanced-${ht.join("-")||"root"}`,Fe=Y=>k(we=>XE(we,ht,Ge=>({...Ge,...Y}))),Pt=Y=>k(we=>{var Ge;return{...we,deployment:{...we.deployment??{feishuEnabled:!1},envValues:{...((Ge=we.deployment)==null?void 0:Ge.envValues)??{},...Y}}}}),pn=(Y,we)=>Pt({[Y]:we}),Jt=Y=>Fe({a2aRegistry:{...pe.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Y}}),en=(Y,we)=>{if(!(Y in Vne))return;const Ge=Vne[Y];Jt({[Ge]:we}),pn(Y,we)},Un=Y=>{if(!(We&&Y==="a2a")){if(Y==="a2a"){Fe({agentType:Y,a2aRegistry:{...pe.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}Fe({agentType:Y,a2aRegistry:pe.a2aRegistry?{...pe.a2aRegistry,enabled:!1}:void 0})}},wn=(Y,we)=>{k(Y),we&&zt(we)},oi=async()=>{const Y=A.trim();if(!(!Y||T)&&!(Y.length{const we=E2(w,Y);if(!M8(we)||Y.length>=Gne)return;const Ge=J7t(w,Y,d),_t=E2(Ge,Y).subAgents.length-1;wn(Ge,[...Y,_t])},mi=(Y,we)=>{const Ge=E2(w,Y);if(!M8(Ge)||Y.length>=Gne)return;const _t=Math.max(0,Math.min(we,Ge.subAgents.length)),un=eBt(w,Y,_t,d);wn(un,[...Y,_t])},bn=()=>{window.confirm(v("traditional.actions.clearRootConfirmation"))&&(k(oc(d)),zt([]),X(!1))},qi=Y=>{if(Y.length===0){bn();return}wn(tBt(w,Y),Y.slice(0,-1))},ri=pe.builtinTools??[],zi=p.useMemo(()=>bOe(d),[d]),as=p.useMemo(()=>new Set(zi.map(Y=>Y.id)),[zi]),Lr=pe.mcpTools??[],_r=We?WRe(w):null,xs=pe.selectedSkills??[],os=Y=>{as.has(Y)&&Fe({builtinTools:ri.includes(Y)?ri.filter(we=>we!==Y):[...ri,Y]})},ia=RRe(pe.agentType),Nr=GI(pe.agentType),As=VR(d),Vs=Im(pe,d),Yr=Y=>{var Ge;const we=Y==="custom"&&Vs==="ark"?"":Y==="ark"&&!((Ge=pe.modelName)!=null&&Ge.trim())?wh(d):pe.modelName;Fe({modelSource:Y,modelName:we})},ra=p.useMemo(()=>x$t(w),[w]),sa=Nr?null:WE(pe.name,Y=>v(`validation.agentName.${Y}`))??(ra.has(pe.name)?v("traditional.validation.duplicateName"):null),ls=sa!==null,va=W||ae.has(vt),aa=!Nr&&pe.description.trim().length===0,ws=pe.instruction.trim().length===0,Ua=Nr&&!((vc=pe.a2aRegistry)!=null&&vc.registrySpaceId.trim()),oa=(Y,we=W)=>we&&Y?`is-error cw-error-shake-${Oe%2}`:"",Qa=p.useMemo(()=>iIe(w,ra),[w,ra]),Jn=Qa.length===0,Ni=p.useMemo(()=>Ig(w,d),[d,w]),Eo=Bst(w),xa=aN(w),Xi=Pst(d),Co=p.useMemo(()=>oBt(Ni,j),[Ni,j]),xe=De.find(Y=>Y.id===he)??De[0],Xe=p.useMemo(()=>L8(Ni,(u==null?void 0:u.editMode)==="source-preserving"),[u==null?void 0:u.editMode,Ni]),Yt=p.useMemo(()=>ERe(Ni,xl(d)),[d,Ni]),tn=Yt.find(Y=>Y.label===$t("helpers.customModel.apiKeyLabel",{name:pe.name.trim()||$t("helpers.customModel.fallbackName")})),In=p.useCallback(Y=>{k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},modelApiKeyId:Y.id,modelApiKeyName:Y.name}}))},[]);function mr(Y){const we=Y.problem==="mcpDuplicateName"||Y.problem==="mcpDuplicateUrl"?"tools":Y.problem==="missingSubagent"?"type":"basic",Ge=Bt.current[we];Ge==null||Ge.scrollIntoView({behavior:"smooth",block:"start"});const _t=Y.problem==="mcpDuplicateName"?"mcp-name":Y.problem==="mcpDuplicateUrl"?"mcp-url":Y.problem==="missingDescription"?"description":Y.problem==="missingPrompt"?"instruction":Y.problem==="missingRegistry"?"a2a-registry":Y.problem==="missingSubagent"||Y.problem==="remoteRoot"?null:"name",un=_t?Ge==null?void 0:Ge.querySelector(`[data-validation-field="${_t}"]`):Ge,Nn=un!=null&&un.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?un:un==null?void 0:un.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Nn==null||Nn.focus({preventScroll:!0})}const jr=()=>Jn?!0:(X(!0),ke(Y=>Y+1),Qa[0]&&(zt(Qa[0].path),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>mr(Qa[0]))})),!1),_s=async()=>{Wt(null);const Y=[...wt.current.values()];wt.current.clear(),ve(0),J(we=>we.map(Ge=>({...Ge,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(Y.map(async({run:we})=>{try{await ey(we.runId),fw(we.runId)}catch(Ge){console.warn("Failed to clean up debug run",Ge)}}))},Si=async Y=>{const we=wt.current.get(Y);if(we){wt.current.delete(Y),ve(wt.current.size);try{await ey(we.run.runId),fw(we.run.runId)}catch(Ge){console.warn("Failed to clean up debug run",Ge)}}},la=Y=>{const we=wt.current.get(Y),Ge=De.find(_t=>_t.id===Y);!we||!Ge||Wt({runId:we.run.runId,sessionId:we.sessionId,variantName:sIe(Ge,v)})},Hs=Y=>{const we=ot.current;ot.current=null,we==null||we(Y)},$r=()=>{Ot||(cn(!1),Hs(!1))},wa=async()=>{if(!Ot){jt(!0);try{await _s(),cn(!1),Hs(!0)}finally{jt(!1)}}},cs=async()=>re!=="validate"||Se===0?!0:ot.current?!1:new Promise(Y=>{ot.current=Y,cn(!0)}),Vi=async Y=>{if(await cs()){if(!jr()){ge("build");return}Y&&_e(Y),ge("environment")}},so=async Y=>{var Ge,_t;if(Pe(""),!jr()){ge("build");return}if((Ge=Ni.harnessSidecar)!=null&&Ge.enabled&&Xi){Pe(Xi),ge("optimize");return}const we=R8(Xe.specs,((_t=Ni.deployment)==null?void 0:_t.envValues)??{});if(we){Pe(`${we.spec.comment||we.spec.key}:${we.error}`),ge("build");return}Ie(!0);try{const un=Y?De.find(Ri=>Ri.id===Y):xe;un&&_e(un.id);const Nn=un?Fst(Ni,un):Ni,Yi=await wO(Kw(Nn));k(Nn),Le(Yi),ge("publish")}catch(un){Pe(un instanceof Error?un.message:String(un))}finally{Ie(!1)}},ao=async()=>{if(await cs()){if(!jr()){ge("build");return}ge("optimize")}},Go=async Y=>{if(!ze||Me||!jr())return;const we=De.find(lt=>lt.id===Y);if(!we||we.phase==="starting"||we.phase==="sending")return;const Ge=we.modelName.trim(),_t=we.description.trim(),un=we.instruction.trim(),Nn=By(we),Yi=De.findIndex(lt=>lt.id===Y),Ri=De.findIndex(lt=>By(lt)===Nn);if(!Ge||!_t||!un||Ri!==Yi)return;const Kn=fj(Co,we);J(lt=>lt.map(Sn=>Sn.id===Y?{...Sn,configOpen:!1,phase:"starting",messages:[],error:null}:Sn)),Je("");let zn=null,ds="unknown";const $n=Y==="baseline"?"baseline":"comparison",ca=y$t({agentId:String(Ni.name||"unknown"),variantType:$n});try{await Si(Y),await Qe();const lt={...Ni,modelName:we.modelName||Ni.modelName,description:we.description,instruction:we.instruction};ds="create_test_run",zn=await oye(aIe(lt,j),u?{runtimeId:u.runtimeId,region:u.region,mcpCredentialReuses:Dne(lt)}:void 0),M7t(zn.runId),ds="create_test_session";const Sn=await lye(zn.runId,"test_user");wt.current.set(Y,{run:zn,sessionId:Sn}),ve(wt.current.size),J(Qt=>Qt.map(si=>si.id===Y?{...si,phase:"ready",runtimeSnapshot:Kn}:si)),ca.succeed({debugRunId:String(zn.runId)})}catch(lt){if(zn)try{await ey(zn.runId),fw(zn.runId)}catch(Sn){console.warn("Failed to clean up debug run",Sn)}J(Sn=>Sn.map(Qt=>Qt.id===Y?{...Qt,phase:"error",runtimeSnapshot:"",error:lt instanceof Error?lt.message:String(lt)}:Qt)),ca.fail({failedPhase:ds,...Wa(lt,{phase:ds})})}},oo=async()=>{const Y=He.trim(),we=De.filter(_t=>_t.phase==="ready"&&_t.runtimeSnapshot===fj(Co,_t)&&wt.current.has(_t.id));if(!Y||we.length===0)return;Je("");const Ge=new Set(we.map(_t=>_t.id));J(_t=>_t.map(un=>Ge.has(un.id)?{...un,phase:"sending",messages:[...un.messages,{role:"user",content:Y},{role:"assistant",content:"",blocks:[]}]}:un)),await Promise.all(we.map(async _t=>{const un=wt.current.get(_t.id);if(un)try{let Nn=I4();for await(const Yi of uye({runId:un.run.runId,userId:"test_user",sessionId:un.sessionId,text:Y})){const Ri=Yi.error||Yi.errorMessage||Yi.error_message;if(Ri||(Nn=Sye(Nn,Yi)),J(Kn=>Kn.map(zn=>{if(zn.id!==_t.id)return zn;const ds=[...zn.messages],$n={...ds[ds.length-1]};return Ri?$n.error=String(Ri):($n.content=Nn.blocks.filter(ca=>ca.kind==="text").map(ca=>ca.text).join(""),$n.blocks=Nn.blocks),ds[ds.length-1]=$n,{...zn,messages:ds}})),Ri)break}}catch(Nn){J(Yi=>Yi.map(Ri=>{if(Ri.id!==_t.id)return Ri;const Kn=[...Ri.messages],zn={...Kn[Kn.length-1]};return zn.error=Nn instanceof Error?Nn.message:String(Nn),Kn[Kn.length-1]=zn,{...Ri,messages:Kn}}))}finally{J(Nn=>Nn.map(Yi=>Yi.id===_t.id?{...Yi,phase:"ready"}:Yi))}}))},ed=()=>{J(Y=>{if(Y.length>=3)return Y;const we=Ze.current++,Ge=`variant-${we}`;return[...Y,{id:Ge,name:v("traditional.debug.comparison",{count:we}),modelName:w.modelName??"",description:w.description,instruction:w.instruction,configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},bc=async Y=>{await Si(Y),J(we=>we.filter(Ge=>Ge.id!==Y)),he===Y&&_e("baseline")},uu=(Y,we)=>J(Ge=>Ge.map(_t=>_t.id===Y?{..._t,...we}:_t)),To=(Y,we)=>{if(we&&Xi){Pe(Xi);return}const Ge=we?[...new Set([...xa,Y])]:xa.filter(un=>un!==Y),_t=Eo==="ops"?"default":Eo;k(un=>({...un,harnessSidecar:Lg(Ge,_t)})),Pe(""),Le(null)},yc=Y=>{const we=SB(Y);if(we.length>0&&Xi){Pe(Xi);return}k(Ge=>({...Ge,harnessSidecar:Lg(we,Y)})),Pe(""),Le(null)},Cl=(Y,we,Ge)=>{Y==="baseline"&&we==="modelName"&&(at.current=!0),uu(Y,{[we]:Ge}),!(he!==Y||Y==="baseline")&&_e("baseline")},td=Y=>{const we=De.find(Kn=>Kn.id===Y);if(!we)return;const Ge=we.modelName.trim(),_t=we.description.trim(),un=we.instruction.trim(),Nn=By(we),Yi=De.findIndex(Kn=>Kn.id===Y),Ri=De.findIndex(Kn=>By(Kn)===Nn);if(!(!Ge||!_t||!un||Ri!==Yi)){if(Y==="baseline"){uu(Y,{configOpen:!1});return}Go(Y)}},Oa=async(Y,we,Ge)=>{var Ri,Kn,zn;const _t=(u==null?void 0:u.editMode)==="source-preserving",un=aN(w).includes("mcp_resilience"),Nn=(Ri=w.deployment)==null?void 0:Ri.network,Yi=Nn&&Nn.mode&&Nn.mode!=="public"?{mode:Nn.mode,vpc_id:Nn.vpcId,subnet_ids:Nn.subnetIds,enable_shared_internet_access:Nn.enableSharedInternetAccess}:void 0;return Ax(Y.name,Y.files,{region:(u==null?void 0:u.region)??qe,projectName:"default",network:Yi},{...Ge,onStage:we,runtimeId:u==null?void 0:u.runtimeId,runtimeName:(Ge==null?void 0:Ge.runtimeName)??_,appName:u==null?void 0:u.appName,editMode:u==null?void 0:u.editMode,draft:u||un?Kw(w):void 0,updateEtag:u==null?void 0:u.etag,baseRuntimeVersion:u==null?void 0:u.currentVersion,envs:_t?[]:Ge==null?void 0:Ge.envs,mcpSecretValues:_t?a7t(w):un?s7t(w):void 0,mcpCredentialReuses:u?Dne(w):void 0,removeRuntimeEnvKeys:u?[...YFt(u.configuredMcpEnvKeys??[],w),...(Kn=w.deployment)!=null&&Kn.feishuEnabled?[]:["FEISHU_APP_ID","FEISHU_APP_SECRET"]]:void 0,description:w.description,harnessSidecar:w.harnessSidecar,environment:(zn=w.cloudEnvironment)!=null&&zn.environmentId?{environmentId:w.cloudEnvironment.environmentId,environmentVersionId:w.cloudEnvironment.environmentVersionId}:void 0})},Wh=()=>{jr()&&(J(Y=>Y.map(we=>we.id==="baseline"&&!wt.current.has(we.id)?{...we,modelName:at.current?we.modelName:$8(Ni),description:Ni.description,instruction:Ni.instruction}:we)),ge("validate"))},Gh=async Y=>{if(Y==="publish"){if(!await cs())return;await so();return}if(Y==="validate"){Wh();return}if(Y==="optimize"){await ao();return}if(Y==="environment"){Vi();return}await cs()&&ge(Y)},ce=Y=>{k(we=>({...we,cloudEnvironment:Y})),Pe(""),Le(null)},li=async Y=>{var $n,ca,lt,Sn,Qt,si,fs,or,hs,wc,Oc,Kh;if(Et||(Ue(""),ft(!1),!jr()))return;const we=qE(_.trim());if(we){Ue(we);return}const Ge={...Ni,memory:{...Ni.memory,shortTerm:Y.sessionBackend!=="local"},shortTermBackend:Y.sessionBackend},_t=L8(Ge,(u==null?void 0:u.editMode)==="source-preserving"),un=($n=Ge.deployment)==null?void 0:$n.network;if((un==null?void 0:un.mode)!==void 0&&un.mode!=="public"&&!((ca=un.vpcId)!=null&&ca.trim())){Ue(v("traditional.deployment.vpcRequired"));return}if(Im(Ge,d)==="ark"&&!((Sn=(lt=Ge.deployment)==null?void 0:lt.modelApiKeyId)!=null&&Sn.trim())){Ue(v("traditional.deployment.apiKeyRequired"));return}const Nn={...((Qt=Ge.deployment)==null?void 0:Qt.envValues)??{},...E,..._t.fixedValues},Yi=Object.keys(Nn).find(Ko=>Ko&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Ko));if(Yi){Ue(v("traditional.deployment.invalidEnvName",{key:Yi}));return}const Ri=(si=Ge.deployment)!=null&&si.feishuEnabled?[..._t.specs,...Mw]:_t.specs,Kn=R9t(Ri,Nn);if(Kn){Ue(v("traditional.deployment.requiredEnv",{name:Kn.comment||Kn.key}));return}const zn=R8(Ri,Nn);if(zn){Ue(`${zn.spec.comment||zn.spec.key}:${zn.error}`);return}bt(!0),$e({level:"info",phase:"prepare",message:v("traditional.deployment.generatingConfiguration"),pct:0});let ds=null;try{if(!u&&!(await sR(_.trim(),qe)).available)throw new Error(v("traditional.deployment.runtimeNameExists"));const Ko=await wO(Kw(Ge));Le(Ko);const fu=crypto.randomUUID(),sf=Date.now();let af="prepare",Sc=v("traditional.deployment.preparing"),Xo=v("traditional.deployment.generatingConfiguration");const lo={id:fu,...c?{draftId:c}:{},agentName:Ge.name,runtimeName:_.trim(),region:qe,startedAt:sf,agentDraft:Ge},ka={...lo,status:"running",phase:af,label:Sc,message:Xo,pct:0};ds=ka,s==null||s(ka),m==null||m(ka);const _l=new Map(Object.entries(Nn).map(([Fr,cf])=>[Fr.trim(),cf]).filter(([Fr,cf])=>Fr&&cf.trim()));for(const Fr of cz(Ri,Nn))_l.set(Fr.key,Fr.value);const of=(or=(fs=Ge.deployment)==null?void 0:fs.modelApiKeyId)==null?void 0:or.trim(),qm=(wc=(hs=Ge.deployment)==null?void 0:hs.modelApiKeyName)==null?void 0:wc.trim();of&&_l.set("MODEL_AGENT_API_KEY_ID",of),qm&&_l.set("MODEL_AGENT_API_KEY_NAME",qm);const lf=await Oa(Ko,Fr=>{af=Fr.phase,Sc=Fr.phase==="build"?v("traditional.deployment.stages.build"):Fr.phase==="deploy"?v("traditional.deployment.stages.deploy"):Fr.phase==="publish"?v("traditional.deployment.stages.publish"):v("traditional.deployment.stages.running"),Xo=Fr.message,$e(Fr),s==null||s({...lo,runtimeName:Fr.runtimeName||lo.runtimeName,status:"running",phase:af,label:Sc,message:Xo,messageCode:Fr.messageCode,pct:Fr.pct,...Fr.buildLog?{buildLog:Fr.buildLog}:{}})},{taskId:fu,runtimeName:_.trim(),sessionStorage:Y.sessionStorage,minInstance:Y.minInstance,maxInstance:Y.maxInstance,authentication:Y.authentication,createEvaluationSets:Y.createEvaluationSets,resources:Y.resources,...(Oc=Ge.deployment)!=null&&Oc.feishuEnabled?{im:{feishu:{enabled:!0}}}:{},envs:[..._l].map(([Fr,cf])=>({key:Fr,value:cf}))});ft(!0),$e({level:"success",phase:"complete",message:v("traditional.deployment.complete"),pct:100}),s==null||s({...lo,runtimeName:lf.runtimeName||lo.runtimeName,runtimeId:lf.runtimeId,region:lf.region||qe,status:"success",phase:"complete",label:v("traditional.deployment.complete"),message:(Kh=lf.warnings)==null?void 0:Kh.join(";"),pct:100}),await(h==null?void 0:h(lf))}catch(Ko){const fu=Ko instanceof Error?Ko.message:String(Ko);Ue(fu),$e(null);const sf={...ds??{id:crypto.randomUUID(),agentName:Ni.name||v("traditional.basic.unnamedAgent"),runtimeName:_.trim(),region:qe,startedAt:Date.now()},status:"error",phase:ds==null?void 0:ds.phase,label:v("traditional.deployment.failed"),message:fu,retry:()=>li(Y)};s==null||s(sf)}finally{bt(!1)}},ci=tt.current,Sa=Y=>$7t.find(we=>we.id===Y),Hn=o.jsx("section",{className:`cw-ai-compose${T?" is-generating":""}${R?" is-success":""}`,"aria-label":v("traditional.ai.ariaLabel"),children:o.jsx(Ru,{initial:!1,mode:"wait",children:R?o.jsxs(pr.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:v("traditional.ai.success")}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>L(!1),children:v("traditional.ai.regenerate")})]},"success"):o.jsxs(pr.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:Y=>{Y.preventDefault(),oi()},children:[o.jsx("input",{type:"text",value:A,maxLength:8e3,disabled:T,placeholder:v("traditional.ai.placeholder",{model:$Be(d)}),"aria-invalid":!!Q,"aria-describedby":Q?"ai-requirement-error":void 0,onChange:Y=>F(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),oi())}}),o.jsx("button",{type:"submit",disabled:T||!K||!!Q,"aria-label":v(T?"traditional.ai.generating":"traditional.ai.generate"),children:T?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):v("traditional.ai.generate")})]}),Q&&o.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:Q})]},"compose")})});return S?o.jsx(O7t,{draft:Ni,cloudProvider:d,deployRegion:qe,runtimeName:_,isRuntimeUpdate:!!u,deploying:Et,deployStage:Mt,deployError:ye,deploySucceeded:Ke,showErrors:W,onBack:e,onDraftPatch:Y=>{k(we=>({...we,...Y})),Le(null),Pe("")},onDeploymentPatch:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},...Y}})),onModelApiKeyChange:In,customModelApiKey:tn?E[tn.key]??"":"",onCustomModelApiKeyChange:Y=>{tn&&C(we=>({...we,[tn.key]:Y}))},onSelectedSkillsChange:Y=>k(we=>({...we,selectedSkills:Y})),onCloudEnvironmentChange:ce,onDeployRegionChange:Ae,onRuntimeNameChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},runtimeName:Y,runtimeNameCustomized:!0}})),onNetworkChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},network:Y}})),onDeploy:Y=>void li(Y)}):o.jsxs("div",{className:`cw-root is-${re}`,children:[o.jsx(dBt,{mode:re}),gt&&o.jsx(Lb,{className:"cw-workspace-alert",message:gt}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[re==="build"&&o.jsx("div",{className:"cw-build-workspace",children:o.jsxs("div",{className:"cw-editor",children:[o.jsx(LS,{draft:w,direction:"horizontal",selectedPath:ht,onSelect:zt,onAdd:Oi,onInsert:mi,onDelete:qi}),o.jsx("div",{className:"cw-detail",children:o.jsx("div",{className:"cw-detail-scroll",ref:Z,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsx("div",{className:"cw-lower",children:o.jsxs("div",{className:"cw-form-col",children:[o.jsxs(ci,{meta:Sa("type"),children:[o.jsx(Wg,{className:"cw-agent-type-options","aria-label":v("traditional.agentTypes.ariaLabel"),value:pe.agentType??"llm",onChange:Un,children:$Ft.map(Y=>{const we=(pe.agentType??"llm")===Y.id,Ge=We&&Y.id==="a2a",_t=Ge?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("div",{"data-agent-type":Y.id,className:`cw-agent-type-option ${we?"is-on":""} ${Ge?"is-disabled":""}`,tabIndex:Ge?0:void 0,"aria-describedby":_t,children:[o.jsx(Wg.Item,{value:Y.id,disabled:Ge,block:!0,className:"cw-agent-type-control",children:o.jsx("span",{className:"cw-agent-type-copy",children:o.jsx("strong",{children:v(B7t[Y.id])})})}),Ge&&o.jsx("span",{id:_t,className:"cw-agent-type-disabled-hint",role:"tooltip",children:v("traditional.agentTypes.remoteChildOnly")})]},Y.id)})}),W&&ia&&pe.subAgents.length===0&&o.jsx("span",{className:"cw-error-text",children:iBt({name:pe.name.trim(),agentType:pe.agentType},v)})]}),o.jsx(ci,{meta:Sa("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Nr&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[v(We?"traditional.basic.agentName":"traditional.basic.name"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${oa(ls,va)}`,"data-validation-field":"name",value:pe.name,placeholder:"assistant","aria-invalid":va&&ls,"aria-describedby":va&&sa?"cw-agent-name-error":void 0,onBlur:vn,onChange:Y=>{vn(),Fe({name:Y.target.value})}}),va&&sa?o.jsx("span",{id:"cw-agent-name-error",role:"alert",className:"cw-error-text",children:sa}):o.jsx("span",{className:"cw-help",children:v("traditional.basic.nameHelp")})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[v(We?"common.description":"traditional.basic.agentDescription"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${oa(aa)}`,"data-validation-field":"description",value:pe.description,placeholder:v("traditional.basic.descriptionPlaceholder"),"aria-invalid":W&&aa,"aria-describedby":W&&aa?"cw-agent-description-error":void 0,onChange:Y=>Fe({description:Y.target.value})}),W&&aa?o.jsx("span",{id:"cw-agent-description-error",role:"alert",className:"cw-error-text",children:v("traditional.validation.missingDescription")}):o.jsx("span",{className:"cw-help",children:v(We?"traditional.basic.rootDescriptionHelp":"traditional.basic.descriptionHelp")})]})]}),ia?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:v("traditional.basic.orchestratorHelp")}),pe.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.basic.maxIterations")}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:pe.maxIterations??3,onChange:Y=>Fe({maxIterations:Math.max(1,Number(Y.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:v("traditional.basic.maxIterationsHelp")})]})]}):Nr?o.jsxs("div",{className:"cw-field cw-remote-center-fields","data-validation-field":"a2a-registry",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:[v("traditional.basic.agentCenter"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:v("traditional.basic.agentCenterHelp")})]}),o.jsx(G7t,{value:((du=pe.a2aRegistry)==null?void 0:du.registrySpaceId)??"",region:((us=pe.a2aRegistry)==null?void 0:us.registryRegion)||As.region,invalid:W&&Ua,onChange:Y=>en(eIe,Y)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ut,"aria-controls":Ki,onClick:()=>Gt(Y=>!Y),children:[o.jsx("span",{children:v("traditional.basic.moreOptions")}),o.jsx(Uk,{className:`cw-more-options-chevron ${ut?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Ru,{initial:!1,children:ut&&o.jsx(pr.div,{id:Ki,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:o.jsx(hw,{env:cy(U7t,d),values:tIe(pe.a2aRegistry,{includeDefaults:!1},d),onChange:en})})}),W&&Ua&&o.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingRegistry")})]}):o.jsxs("div",{className:"cw-field","data-validation-field":"instruction",children:[o.jsxs("label",{className:"cw-label",children:[v("traditional.basic.systemPrompt"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:v("traditional.basic.loadingMarkdown")}),children:o.jsx(D7t,{value:pe.instruction,invalid:ws,onChange:Y=>Fe({instruction:Y})})}),W&&ws?o.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingPrompt")}):o.jsx("span",{className:"cw-help",children:v("traditional.basic.markdownHelp")})]})]})}),!ia&&!Nr&&o.jsxs(o.Fragment,{children:[o.jsx(ci,{meta:Sa("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field cw-model-source-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.source")}),o.jsx(Wg,{className:"cw-model-source-options","aria-label":v("traditional.model.source"),value:Vs,onChange:Y=>{Y!=="gateway"&&Yr(Y)},children:[{value:"ark",label:v(d==="byteplus"?"traditional.model.bytePlusModelArk":"traditional.model.volcanoArk")},{value:"custom",label:v("traditional.model.custom")},{value:"gateway",label:v("traditional.model.gateway"),disabled:!0}].map(Y=>o.jsx("div",{className:`cw-model-source-option ${Vs===Y.value?"is-on":""}${Y.disabled?" is-disabled":""}`,children:o.jsxs(Wg.Item,{value:Y.value,disabled:Y.disabled,block:!0,className:"cw-model-source-control",children:[o.jsx("span",{children:Y.label}),Y.disabled&&o.jsx("span",{className:"cw-model-source-coming-soon",children:v("traditional.model.comingSoon")})]})},Y.value))})]}),Vs==="ark"?o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.configuration")}),o.jsx(W7t,{value:pe.modelName??"",cloudProvider:d,apiKeyId:(Tl=w.deployment)==null?void 0:Tl.modelApiKeyId,apiKeyName:(xc=w.deployment)==null?void 0:xc.modelApiKeyName,onApiKeyChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},modelApiKeyId:Y.id,modelApiKeyName:Y.name}})),onChange:Y=>Fe({modelName:Y})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.name")}),o.jsx("input",{className:"cw-input",value:pe.modelName??"",onChange:Y=>Fe({modelName:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label cw-label-with-link",children:[o.jsx("span",{children:v("traditional.model.provider")}),o.jsxs("a",{href:"https://docs.litellm.ai/docs/providers",target:"_blank",rel:"noopener noreferrer",onClick:Y=>Y.stopPropagation(),children:[v("traditional.model.liteLlmProviders"),o.jsx(gb,{"aria-hidden":"true"})]})]}),o.jsx("input",{className:"cw-input",value:pe.modelProvider??"",placeholder:"openai",onChange:Y=>Fe({modelProvider:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:pe.modelApiBase??"",placeholder:xl(d),onChange:Y=>Fe({modelApiBase:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Key"}),o.jsx("input",{className:"cw-input",type:"password",value:tn?E[tn.key]??"":"",placeholder:v("traditional.model.apiKeyPlaceholder"),autoComplete:"new-password",onChange:Y=>{if(!tn)return;const we=Y.currentTarget.value;C(Ge=>({...Ge,[tn.key]:we}))}})]})]})]})}),o.jsx(ci,{meta:Sa("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.tools.builtIn")}),o.jsx("span",{className:"cw-help",children:v("traditional.tools.builtInHelp")}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(Q7t,{items:zi,selected:ri,onToggle:os,scrollRows:6})}),o.jsx(Ru,{initial:!1,children:ri.includes("run_code")&&o.jsxs(pr.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:v("traditional.tools.codeExecution")}),o.jsx("span",{className:"cw-help",children:v("traditional.tools.codeExecutionHelp")})]}),o.jsx(hw,{env:((Sr=Bx.find(Y=>Y.id==="run_code"))==null?void 0:Sr.env)??[],values:((Qn=w.deployment)==null?void 0:Qn.envValues)??{},onChange:pn})]})})]}),o.jsxs("div",{className:"cw-field cw-mcp-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.tools.mcp")}),o.jsx(Y7t,{tools:Lr,conflict:_r,showConflict:W,onChange:Y=>Fe({mcpTools:Y})})]})]})}),o.jsx(ci,{meta:Sa("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(ZQ,{selected:xs,onChange:Y=>Fe({selectedSkills:Y}),cloudProvider:d})})}),o.jsx(ci,{meta:Sa("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(k2,{checked:pe.knowledgebase,onChange:Y=>Fe({knowledgebase:Y}),title:v("traditional.knowledge.title"),desc:v("traditional.knowledge.description"),icon:Y2}),pe.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.knowledge.backend")}),o.jsx(CL,{options:x6,value:pe.knowledgebaseBackend,translationGroup:"knowledge",onChange:Y=>Fe({knowledgebaseBackend:Y,knowledgebaseIndex:Y==="viking"||Y==="openviking"?pe.knowledgebaseIndex:""})}),(pe.knowledgebaseBackend??nm)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.knowledge.vikingDatabase")}),o.jsx(K7t,{value:pe.knowledgebaseIndex??"",onChange:Y=>{Fe({knowledgebaseIndex:Y.id}),Y.projectName&&pn("DATABASE_VIKING_PROJECT",Y.projectName),Y.region&&pn("DATABASE_VIKING_REGION",Y.region),Y.sourceKind&&pn("DATABASE_VIKING_COLLECTION_KIND",Y.sourceKind),pn("DATABASE_VIKING_RESOURCE_ID",Y.resourceId??"")}})]}),o.jsx(hw,{env:((za=x6.find(Y=>Y.id===(pe.knowledgebaseBackend??nm)))==null?void 0:za.env)??[],values:((rf=w.deployment)==null?void 0:rf.envValues)??{},onChange:pn,renderAfterField:(pe.knowledgebaseBackend??nm)==="openviking"?Y=>Y.key==="DATABASE_OPENVIKING_USER_ID"?o.jsx(V7t,{value:pe.knowledgebaseIndex??"",onChange:we=>Fe({knowledgebaseIndex:we})}):null:void 0})]})]})}),We&&o.jsx(ci,{meta:Sa("memory"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(k2,{checked:pe.memory.shortTerm,onChange:Y=>Fe({memory:{...pe.memory,shortTerm:Y}}),title:v("traditional.memory.shortTerm"),desc:v("traditional.memory.shortTermDescription"),showDescription:!0,icon:Abe}),pe.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.shortTermBackend")}),o.jsx(CL,{options:iv,value:pe.shortTermBackend,translationGroup:"shortTerm",onChange:Y=>Fe({shortTermBackend:Y})}),o.jsx(hw,{env:((Al=iv.find(Y=>Y.id===(pe.shortTermBackend??"local")))==null?void 0:Al.env)??[],values:((be=w.deployment)==null?void 0:be.envValues)??{},onChange:pn})]}),o.jsx(k2,{checked:pe.memory.longTerm,onChange:Y=>Fe({memory:{...pe.memory,longTerm:Y}}),title:v("traditional.memory.longTerm"),desc:v("traditional.memory.longTermDescription"),showDescription:!0,icon:Y2}),pe.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.longTermBackend")}),o.jsx(CL,{options:v6,value:pe.longTermBackend,translationGroup:"longTerm",onChange:Y=>Fe({longTermBackend:Y,longTermMemoryIndex:Y==="viking"?pe.longTermMemoryIndex:""})}),(pe.longTermBackend??"local")==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.vikingDatabase")}),o.jsx(X7t,{value:pe.longTermMemoryIndex??"",onChange:Y=>{Fe({longTermMemoryIndex:Y.id}),pn("DATABASE_VIKINGMEM_PROJECT",Y.projectName),pn("DATABASE_VIKING_REGION",Y.region),pn("DATABASE_VIKINGMEM_MEMORY_TYPE",(Y.memoryTypes??[]).join(","))}})]}),o.jsx(hw,{env:((Ye=v6.find(Y=>Y.id===(pe.longTermBackend??"local")))==null?void 0:Ye.env)??[],values:((Ct=w.deployment)==null?void 0:Ct.envValues)??{},onChange:pn}),o.jsx(k2,{checked:!!pe.autoSaveSession,onChange:Y=>Fe({autoSaveSession:Y}),title:v("traditional.memory.autoSave"),desc:v("traditional.memory.autoSaveDescription"),icon:Y2})]})]})})]})]})})})})})]})}),re==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(lBt,{enabled:ze,disabledReason:Ee,variants:De,draftSnapshot:Co,input:He,onInput:Je,onSend:oo,onStartVariant:Go,onUseVariant:Y=>void Vi(Y),onAddVariant:ed,onRemoveVariant:bc,onToggleConfig:Y=>{const we=De.find(Ge=>Ge.id===Y);we&&uu(Y,{configOpen:!we.configOpen})},onCompleteConfig:td,onConfigChange:Cl,onOpenTrace:la})})}),re==="optimize"&&o.jsx(cBt,{profile:Eo,optimizations:xa,unavailableMessage:Xi,onProfileChange:yc,onOptimizationChange:To}),re==="environment"&&o.jsx("div",{className:"cw-environment-workspace",children:o.jsx(YRe,{value:w.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:ce,disabled:Me})}),re==="publish"&&o.jsx("div",{className:"cw-preview-body",children:st?o.jsx(WI,{embedded:!0,cloudProvider:d,project:st,agentDraft:w,agentName:w.name||v("traditional.basic.unnamedAgent"),agentCount:rIe(w),releaseConfiguration:xe?{modelName:xe.modelName||w.modelName||v("traditional.debug.defaultModel"),description:xe.description,instruction:xe.instruction,optimizations:[v("traditional.optimization.releaseScenario",{profile:v(`traditional.optimization.profiles.${Eo}.label`)}),...xa.map(Y=>v(`traditional.optimization.options.${Y}.label`))]}:void 0,onChange:Le,onDeploy:Oa,onAgentAdded:n,onDeploymentTaskChange:s,deploymentActionLabel:v(u?"traditional.deployment.updateAndPublish":"common.deploy"),deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:u==null?void 0:u.runtimeId,deploymentRuntimeName:_,deploymentRuntimeNameCustomized:!!u||!!((_n=w.deployment)!=null&&_n.runtimeNameCustomized),onDeploymentRuntimeNameChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},runtimeName:Y,runtimeNameCustomized:!0}})),onDeploymentStarted:m,onDeploymentComplete:h,feishuEnabled:!!((Dt=w.deployment)!=null&&Dt.feishuEnabled),configuredRuntimeEnvKeys:u==null?void 0:u.configuredRuntimeEnvKeys,onFeishuEnabledChange:async Y=>{const we={...w,deployment:{...w.deployment??{feishuEnabled:!1},feishuEnabled:Y}},Ge=await wO(Kw(we));k(we),Le(Ge)},deploymentEnv:Xe.specs,requiredSecretEnv:Yt,requiredSecretEnvValues:E,onRequiredSecretEnvChange:(Y,we)=>C(Ge=>({...Ge,[Y]:we})),deploymentEnvValues:{...(fn=Ni.deployment)==null?void 0:fn.envValues,...E,...Xe.fixedValues},onDeploymentEnvChange:pn,onFeishuCredentialsChange:(Y,we)=>Pt({FEISHU_APP_ID:Y,FEISHU_APP_SECRET:we}),network:(On=w.deployment)==null?void 0:On.network,onNetworkChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},network:Y}})),deployRegion:qe,onDeployRegionChange:Ae,deploymentTelemetry:{source:"scratch",createMode:a,aiAssisted:M},onExportYaml:()=>L7t(`${Ni.name||"agent"}.yaml`,l7t(Ni,{heading:v("yaml.heading"),importHint:v("yaml.importHint")}),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"}),o.jsx("strong",{children:v("traditional.publish.generating")}),o.jsx("span",{children:v("traditional.publish.validating")})]})})]}),o.jsx(fBt,{mode:re,busy:Me,onChange:Gh,assistant:re==="build"?Hn:void 0}),Ce&&o.jsx(ZRe,{testRunId:Ce.runId,sessionId:Ce.sessionId,title:v("traditional.debug.traceTitle",{name:Ce.variantName}),onClose:()=>Wt(null)}),ln&&o.jsx(pc,{variant:"warning",title:v("traditional.debug.leaveTitle"),description:v("traditional.debug.leaveDescription"),confirmLabel:v(Ot?"traditional.debug.cleaning":"traditional.debug.confirmLeave"),closeLabel:v("traditional.debug.closeLeaveConfirmation"),busy:Ot,onCancel:$r,onConfirm:()=>void wa()}),I&&o.jsx("div",{className:"confirm-scrim",onClick:()=>H(null),children:o.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:Y=>Y.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:v("traditional.ai.failed")}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:I}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>H(null),children:v("common.close")})})]})})]})}function bu({name:e}){const t={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"branch":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"6",cy:"5",r:"2"}),o.jsx("circle",{cx:"18",cy:"7",r:"2"}),o.jsx("circle",{cx:"18",cy:"17",r:"2"}),o.jsx("path",{d:"M8 5h2.5A3.5 3.5 0 0 1 14 8.5v7A1.5 1.5 0 0 0 15.5 17H16"}),o.jsx("path",{d:"M14 10.5v-2A1.5 1.5 0 0 1 15.5 7H16"})]});case"plan":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M6.5 3.5h11a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-11a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"m8 9 1.4 1.4L12 7.8M13.5 10H16M8 15l1.4 1.4 2.6-2.6M13.5 16H16"})]});case"collaborate":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"8",cy:"8",r:"3"}),o.jsx("circle",{cx:"17",cy:"9",r:"2.5"}),o.jsx("path",{d:"M3.5 19a4.5 4.5 0 0 1 9 0M13.5 15.5A4 4 0 0 1 20.5 18"})]});case"summary":return o.jsx("svg",{...t,children:o.jsx("path",{d:"M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"})});case"skills":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M5 5h5v5H5zM14 5h5v5h-5zM5 14h5v5H5z"}),o.jsx("path",{d:"M14 16.5h5M16.5 14v5"})]});case"trace":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"6",cy:"6",r:"2"}),o.jsx("circle",{cx:"18",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("path",{d:"M8 6h3a3 3 0 0 1 3 3v0a3 3 0 0 0 2 2.83M16.2 13.2 9.8 16.8"})]});case"structure":return o.jsxs("svg",{...t,children:[o.jsx("rect",{x:"3.5",y:"4",width:"7",height:"5",rx:"1"}),o.jsx("rect",{x:"13.5",y:"15",width:"7",height:"5",rx:"1"}),o.jsx("path",{d:"M10.5 6.5h3A3.5 3.5 0 0 1 17 10v5M7 9v7a2 2 0 0 0 2 2h4.5"})]});case"model":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M8 3.5v3M16 3.5v3M8 17.5v3M16 17.5v3M3.5 8h3M17.5 8h3M3.5 16h3M17.5 16h3"}),o.jsx("rect",{x:"6.5",y:"6.5",width:"11",height:"11",rx:"2"}),o.jsx("path",{d:"M10 10h4v4h-4z"})]});case"environment":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M4 7.5h16M7 4h10l3 3.5v10L17 20H7l-3-2.5v-10Z"}),o.jsx("path",{d:"m8 12 2 2-2 2M12.5 16H16"})]});case"deploy":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M12 3.5v11M7.5 8 12 3.5 16.5 8"}),o.jsx("path",{d:"M5 13.5v5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-5"})]});case"workflow":return o.jsxs("svg",{...t,children:[o.jsx("rect",{x:"4",y:"4",width:"6",height:"5",rx:"1"}),o.jsx("rect",{x:"14",y:"15",width:"6",height:"5",rx:"1"}),o.jsx("path",{d:"M10 6.5h2a4 4 0 0 1 4 4V15M7 9v3a4 4 0 0 0 4 4h3"})]})}}function pBt({onSelectVulcan:e,onSelectTraditional:t}){const{t:n}=Te("create"),i=RF(),[r,s]=p.useState(!1),a=p.useRef(null),l=u=>{if(!r){if(i){u();return}a.current=u,s(!0)}},c=()=>{if(!r)return;const u=a.current;a.current=null,u==null||u()};return o.jsx(pr.main,{className:`agent-creation-mode-picker${r?" is-leaving":""}`,initial:i?!1:{opacity:0},animate:{opacity:r?0:1},transition:{duration:r?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:c,children:o.jsxs("section",{className:"agent-creation-mode-picker__content","aria-labelledby":"agent-creation-mode-picker-title",children:[o.jsxs("header",{className:"agent-creation-mode-picker__header",children:[o.jsx("h1",{id:"agent-creation-mode-picker-title",children:n("modePicker.title")}),o.jsx("p",{children:n("modePicker.subtitle")})]}),o.jsxs("div",{className:"agent-creation-mode-picker__options",children:[o.jsxs(Ht,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>l(e),children:[o.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[o.jsx(Xv,{className:"agent-creation-mode-picker__avatar is-vulcan",seed:n("modePicker.quick.title")}),o.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[o.jsx("span",{className:"agent-creation-mode-picker__card-title",children:n("modePicker.quick.title")}),o.jsx("span",{className:"agent-creation-mode-picker__card-description",children:n("modePicker.quick.description")})]})]}),o.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),o.jsxs("span",{className:"agent-creation-mode-picker__features",children:[o.jsx("span",{children:n("modePicker.features")}),o.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"branch"})}),o.jsx("span",{children:n("modePicker.quick.features.dynamicSubagents")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"plan"})}),o.jsx("span",{children:n("modePicker.quick.features.autonomousPlanning")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"collaborate"})}),o.jsx("span",{children:n("modePicker.quick.features.collaboration")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"summary"})}),o.jsx("span",{children:n("modePicker.quick.features.summary")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"skills"})}),o.jsx("span",{children:n("modePicker.quick.features.skills")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"trace"})}),o.jsx("span",{children:n("modePicker.quick.features.trace")})]})]})]})]}),o.jsxs(Ht,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>l(t),children:[o.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[o.jsx(Xv,{className:"agent-creation-mode-picker__avatar is-traditional",seed:n("modePicker.traditional.title")}),o.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[o.jsx("span",{className:"agent-creation-mode-picker__card-title",children:n("modePicker.traditional.title")}),o.jsx("span",{className:"agent-creation-mode-picker__card-description",children:n("modePicker.traditional.description")})]})]}),o.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),o.jsxs("span",{className:"agent-creation-mode-picker__features",children:[o.jsx("span",{children:n("modePicker.features")}),o.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"structure"})}),o.jsx("span",{children:n("modePicker.traditional.features.visualConfig")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"model"})}),o.jsx("span",{children:n("modePicker.traditional.features.migration")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"environment"})}),o.jsx("span",{children:n("modePicker.traditional.features.debugging")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"deploy"})}),o.jsx("span",{children:n("modePicker.traditional.features.optimization")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"workflow"})}),o.jsx("span",{children:n("modePicker.traditional.features.parameters")})]})]})]})]})]})]})})}const Kne=50*1024*1024,F8=800,mBt={name:"code_package",files:[]};function gBt(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function gz(e,t){return $t(e,t)}function oIe(e,t=gz){const n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!n||n.endsWith("/"))return null;if(n.startsWith("/")||n.includes("\0"))throw new Error(t("codePackage.errors.invalidPath",{name:e}));const i=n.split("/");if(i.some(r=>!r||r==="."||r===".."))throw new Error(t("codePackage.errors.invalidPath",{name:e}));return i[0]==="__MACOSX"||i[i.length-1]===".DS_Store"?null:i.join("/")}function bBt(e,t=gz){const n=e.flatMap(l=>{const c=oIe(l.name,t);return c?[{path:c,content:l.text}]:[]});if(n.length===0)throw new Error(t("codePackage.errors.empty"));if(n.length>F8)throw new Error(t("codePackage.errors.tooManyFiles",{count:F8}));const s=new Set(n.map(l=>l.path.split("/")[0])).size===1&&n.every(l=>l.path.includes("/"))?n.map(l=>({...l,path:l.path.split("/").slice(1).join("/")})):n,a=new Set;for(const l of s){if(a.has(l.path))throw new Error(t("codePackage.errors.duplicateFile",{path:l.path}));a.add(l.path)}return yBt(s,t),s}function yBt(e,t=gz){const n=new Set(e.map(s=>s.path)),i=e.find(s=>s.path==="agentkit.yaml");let r="app.py";if(i){let s;try{s=Ikt(i.content)}catch(c){throw new Error(t("codePackage.errors.manifestParse",{detail:c instanceof Error?c.message:String(c)}))}if(s!==null&&(typeof s!="object"||Array.isArray(s)))throw new Error(t("codePackage.errors.manifestRoot"));const a=s&&typeof s=="object"&&!Array.isArray(s)?s.common:void 0;if(a!==void 0&&(a===null||typeof a!="object"||Array.isArray(a)))throw new Error(t("codePackage.errors.manifestCommon"));const l=a&&typeof a=="object"&&!Array.isArray(a)?a.entry_point:void 0;if(l!==void 0){if(typeof l!="string")throw new Error(t("codePackage.errors.entryPointType"));const c=oIe(l,t);if(!c)throw new Error(t("codePackage.errors.entryPointInvalid"));r=c}}if(!n.has(r))throw i&&r!=="app.py"?new Error(t("codePackage.errors.entryPointMissing",{entryPoint:r})):new Error(t("codePackage.errors.defaultEntryPointMissing"));return r}function vBt({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:i,onDeploymentComplete:r,cloudProvider:s="volcengine",initialDeployRegion:a=Ji(s)}){const{t:l}=Te("create"),c=p.useRef(null),u=p.useRef(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!1),[v,y]=p.useState(!1),[x,O]=p.useState(!1),[w,k]=p.useState(""),[S,E]=p.useState(a),[C,N]=p.useState();p.useEffect(()=>()=>{u.current+=1},[]);async function _(T){const P=++u.current;if(k(""),!T.name.toLowerCase().endsWith(".zip")){k(l("codePackage.errors.invalidFormat"));return}if(T.size>Kne){k(l("codePackage.errors.tooLarge"));return}y(!0);try{const R=await Cje(new Uint8Array(await T.arrayBuffer()),{maxEntries:F8,maxUncompressedBytes:Kne}),L=bBt(R,l);if(P!==u.current)return;m(T.name),f({name:gBt(T.name),files:L})}catch(R){if(P!==u.current)return;m(""),f(null),k(R instanceof Error?R.message:String(R))}finally{P===u.current&&y(!1)}}function j(T){var R;const P=(R=T.currentTarget.files)==null?void 0:R[0];T.currentTarget.value="",P&&_(P)}function A(T){var R;T.preventDefault(),O(!1);const P=(R=T.dataTransfer.files)==null?void 0:R[0];P&&_(P)}async function F(T,P,R){const L=C&&C.mode!=="public"?{mode:C.mode,vpc_id:C.vpcId,subnet_ids:C.subnetIds,enable_shared_internet_access:C.enableSharedInternetAccess}:void 0;return Ax(T.name,T.files,{region:S,projectName:"default",network:L},{...R,onStage:P})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(WI,{cloudProvider:s,project:d??mBt,agentName:(d==null?void 0:d.name)||l("codePackage.name"),onChange:d?f:void 0,onDeploy:F,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:i,onDeploymentComplete:r,network:C,onNetworkChange:N,deployRegion:S,onDeployRegionChange:E,deploymentTelemetry:{source:"code_package",createMode:"code_package",aiAssisted:!1},onBack:e,backLabel:l("codePackage.back"),deployDisabled:!d||v,deployDisabledReason:v?l("codePackage.reading"):d?void 0:l("codePackage.uploadFirst"),deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":l("codePackage.uploadAriaLabel"),children:[o.jsx("div",{className:"package-source-label",children:l("codePackage.name")}),o.jsxs("div",{className:`package-dropzone${x?" is-dragging":""}${d?" is-ready":""}`,onDragEnter:T=>{T.preventDefault(),O(!0)},onDragOver:T=>T.preventDefault(),onDragLeave:T=>{T.currentTarget.contains(T.relatedTarget)||O(!1)},onDrop:A,onClick:()=>{var T;v||(T=c.current)==null||T.click()},onKeyDown:T=>{var P;!v&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(P=c.current)==null||P.click())},role:"button",tabIndex:v?-1:0,"aria-label":l(d?"codePackage.reupload":"codePackage.upload"),"aria-disabled":v,children:[o.jsx("strong",{children:v?l("codePackage.readingEllipsis"):d?h:l("codePackage.uploadPrompt")}),o.jsx("span",{children:d?l("codePackage.filesRecognized",{count:d.files.length}):l("codePackage.dropHint")}),o.jsx("div",{className:"package-upload-actions",children:d&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:T=>{T.stopPropagation(),b(!0)},onKeyDown:T=>T.stopPropagation(),children:l("codePackage.viewFiles")})}),o.jsx("input",{ref:c,type:"file",accept:".zip,application/zip","aria-label":l("codePackage.chooseFile"),onChange:j})]}),w&&o.jsx("div",{className:"package-create-error",role:"alert",children:w})]})}),d&&o.jsx(WS,{project:d,open:g,onClose:()=>b(!1),onChange:f})]})}const xBt="/web/agent-migrations",XI=39e4;class sl extends Error{constructor(t,n,i="MIGRATION_ERROR",r=!1,s="",a=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.rawResponse=a,this.name="MigrationApiError"}}const wBt=new Set(["langchain","langgraph","adk","strands","agentcore","dify","any"]),OBt=new Set(["awaiting_upload","analyzing","needs_input","analysis_ready","migrating","validating","packaging","succeeded","succeeded_with_warnings","partial","failed","cancelled","expired"]),SBt=new Set(["reasoning","message","plan","command","status"]),kBt=new Set(["running","completed","failed"]),EBt=new Set(["pending","in_progress","completed","failed"]);function Hi(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function Gg(e,t){if(!Array.isArray(e)||!e.every(n=>typeof n=="string"))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function WO(e,t){if(typeof e!="string"||!wBt.has(e))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function CBt(e){const t=Hi(e,V("migrations.labels.analysisResult")),n=t.recommended===null?null:Hi(t.recommended,V("migrations.labels.recommendation")),i=Hi(t.boundary,V("migrations.labels.boundary"));if(t.schema_version!==1||!["needs_input","recommendation_ready","unsupported"].includes(String(t.status))||typeof t.attempt!="number"||typeof t.input_sha256!="string"||typeof t.summary!="string"||!Array.isArray(t.frameworks)||!Array.isArray(t.entries)||!Array.isArray(t.questions))throw new Error(V("migrations.invalidAnalysisResult"));return{schema_version:1,status:t.status,attempt:t.attempt,input_sha256:t.input_sha256,summary:t.summary,frameworks:t.frameworks.map(r=>{const s=Hi(r,V("migrations.labels.frameworkCandidate"));if(!["high","medium","low"].includes(String(s.confidence))||!Array.isArray(s.evidence))throw new Error(V("migrations.invalidFrameworkCandidate"));return{id:WO(s.id,V("migrations.labels.frameworkCandidate")),confidence:s.confidence,evidence:s.evidence.map(a=>{const l=Hi(a,V("migrations.labels.analysisEvidence"));if(typeof l.path!="string"||typeof l.line!="number"||typeof l.reason!="string")throw new Error(V("migrations.invalidAnalysisEvidence"));return{path:l.path,line:l.line,reason:l.reason}})}}),recommended:n===null?null:{framework:WO(n.framework,V("migrations.labels.recommendedFramework")),entry:n.entry===null||typeof n.entry=="string"?n.entry:null,reason:typeof n.reason=="string"?n.reason:""},entries:t.entries.map(r=>{const s=Hi(r,V("migrations.labels.entryCandidate"));if(typeof s.value!="string"||typeof s.evidence!="string")throw new Error(V("migrations.invalidEntryCandidate"));return{value:s.value,framework:WO(s.framework,V("migrations.labels.entryFramework")),evidence:s.evidence}}),boundary:{include:Gg(i.include,V("migrations.labels.includeScope")),exclude:Gg(i.exclude,V("migrations.labels.excludeScope"))},assumptions:Gg(t.assumptions,V("migrations.labels.assumptions")),questions:t.questions.map(r=>{const s=Hi(r,V("migrations.labels.question"));if(typeof s.id!="string"||typeof s.prompt!="string"||typeof s.required!="boolean")throw new Error(V("migrations.invalidQuestion"));return{id:s.id,prompt:s.prompt,required:s.required}}),warnings:Gg(t.warnings,V("migrations.labels.analysisWarnings"))}}function a0(e){const t=Hi(e,V("migrations.labels.task")),n=Hi(t.artifact,V("migrations.labels.artifactStatus"));if(typeof t.id!="string"||typeof t.state!="string"||!OBt.has(t.state)||typeof t.message!="string"||typeof t.sourceFileName!="string"||typeof t.instruction!="string"||typeof t.createdAt!="string"&&typeof t.createdAt!="number"||typeof t.expiresAt!="string"||typeof t.sessionTtlSeconds!="number"||typeof t.canModify!="boolean"||typeof t.canUpload!="boolean"||typeof t.canAnswer!="boolean"||typeof t.canConfirm!="boolean"||typeof t.canStop!="boolean")throw new Error(V("migrations.invalidTask"));const i={id:t.id,state:t.state,message:t.message,sourceFileName:t.sourceFileName,instruction:t.instruction,createdAt:t.createdAt,expiresAt:t.expiresAt,sessionTtlSeconds:t.sessionTtlSeconds,canModify:t.canModify,canUpload:t.canUpload,canAnswer:t.canAnswer,canConfirm:t.canConfirm,canStop:t.canStop,artifact:{state:typeof n.state=="string"?n.state:"none",previewReady:n.previewReady===!0,downloadReady:n.downloadReady===!0,deployReady:n.deployReady===!0}};if(typeof t.modelId=="string"&&t.modelId.trim()&&(i.modelId=t.modelId),t.analysis!==void 0&&(i.analysis=CBt(t.analysis)),t.analysisRef!==void 0){const r=Hi(t.analysisRef,V("migrations.labels.analysisReference"));if(typeof r.attempt!="number"||typeof r.sha256!="string"||typeof r.inputSha256!="string")throw new Error(V("migrations.invalidAnalysisReference"));i.analysisRef={attempt:r.attempt,sha256:r.sha256,inputSha256:r.inputSha256}}if(t.confirmation!==void 0){const r=Hi(t.confirmation,V("migrations.labels.confirmation"));i.confirmation={...r.framework!==void 0?{framework:WO(r.framework,V("migrations.labels.confirmedFramework"))}:{},...r.entry===null||typeof r.entry=="string"?{entry:r.entry}:{},...typeof r.app_name=="string"?{app_name:r.app_name}:{}}}if(t.error!==void 0){const r=Hi(t.error,V("migrations.labels.error"));i.error={code:typeof r.code=="string"?r.code:"MIGRATION_ERROR",message:typeof r.message=="string"?r.message:t.message,retryable:r.retryable===!0}}if(t.persistence!==void 0){const r=Hi(t.persistence,V("migrations.labels.sourcePersistence"));if(!["saving","saved","failed","unavailable"].includes(String(r.state))||typeof r.message!="string"||r.projectId!==void 0&&typeof r.projectId!="string"||r.versionId!==void 0&&typeof r.versionId!="string"||r.retryable!==void 0&&typeof r.retryable!="boolean")throw new Error(V("migrations.invalidSourcePersistence"));i.persistence={state:r.state,message:r.message,...typeof r.projectId=="string"?{projectId:r.projectId}:{},...typeof r.versionId=="string"?{versionId:r.versionId}:{},...typeof r.retryable=="boolean"?{retryable:r.retryable}:{}}}return i}function TBt(e){const t=Hi(e,V("migrations.labels.activity"));if(typeof t.available!="boolean"||typeof t.complete!="boolean"||!Array.isArray(t.items))throw new Error(V("migrations.invalidActivity"));return{available:t.available,complete:t.complete,items:t.items.map(n=>{const i=Hi(n,V("migrations.labels.activityItem"));if(typeof i.id!="string"||typeof i.kind!="string"||!SBt.has(i.kind)||typeof i.status!="string"||!kBt.has(i.status)||typeof i.title!="string"||i.detail!==void 0&&typeof i.detail!="string")throw new Error(V("migrations.invalidActivityItem"));let r;if(i.tool!==void 0){const a=Hi(i.tool,V("migrations.labels.activityTool"));if(typeof a.name!="string"||a.error!==void 0&&typeof a.error!="string"||a.exitCode!==void 0&&!Number.isInteger(a.exitCode))throw new Error(V("migrations.invalidActivityTool"));r={name:a.name,...Object.prototype.hasOwnProperty.call(a,"input")?{input:a.input}:{},...Object.prototype.hasOwnProperty.call(a,"output")?{output:a.output}:{},...typeof a.error=="string"?{error:a.error}:{},...typeof a.exitCode=="number"?{exitCode:a.exitCode}:{}}}let s;if(i.plan!==void 0){if(!Array.isArray(i.plan))throw new Error(V("migrations.invalidActivityPlan"));s=i.plan.map(a=>{const l=Hi(a,V("migrations.labels.activityPlanItem"));if(typeof l.text!="string"||typeof l.status!="string"||!EBt.has(l.status))throw new Error(V("migrations.invalidActivityPlanItem"));return{text:l.text,status:l.status}})}return{id:i.id,kind:i.kind,status:i.status,title:i.title,...typeof i.detail=="string"?{detail:i.detail}:{},...r?{tool:r}:{},...s?{plan:s}:{}}})}}function ABt(e){const t=Hi(e,V("migrations.labels.artifact")),n=Hi(t.cli,V("migrations.labels.cli")),i=Hi(t.migration,V("migrations.labels.migration")),r=Hi(t.startup,V("migrations.labels.startup")),s=Hi(t.environment,V("migrations.labels.environment")),a=Hi(t.verification,V("migrations.labels.verification")),l=Hi(t.report,V("migrations.labels.report")),c=Hi(t.artifact,V("migrations.labels.archive")),u=s.defaults===void 0?{}:Hi(s.defaults,V("migrations.labels.environmentDefaults"));if(t.schema_version!==1||!["succeeded","succeeded_with_warnings","partial"].includes(String(t.status))||typeof n.name!="string"||typeof n.version!="string"||!["structured","agentic"].includes(String(i.engine))||typeof i.framework!="string"||!Array.isArray(t.files)||typeof r.module!="string"||typeof r.object!="string"||!["passed","failed","degraded"].includes(String(a.status))||!Array.isArray(a.checks)||typeof l.path!="string"||c.path!=="migration-result.zip"||typeof c.size!="number"||typeof c.sha256!="string"||typeof t.created_at!="string")throw new Error(V("migrations.invalidArtifact"));const d=Gg(s.required,V("migrations.labels.requiredEnvironment")),f=Gg(s.optional,V("migrations.labels.optionalEnvironment")),h=new Set([...d,...f]),m=Object.fromEntries(Object.entries(u).map(([g,b])=>{if(!h.has(g)||typeof b!="string")throw new Error(V("migrations.invalidEnvironmentDefaults"));return[g,b]}));return{schema_version:1,...typeof t.run_id=="string"?{run_id:t.run_id}:{},cli:{name:n.name,version:n.version},migration:{engine:i.engine,framework:i.framework,...typeof i.entry=="string"?{entry:i.entry}:{},...typeof i.source_sha256=="string"?{source_sha256:i.source_sha256}:{},...typeof i.provenance_sha256=="string"?{provenance_sha256:i.provenance_sha256}:{}},status:t.status,files:t.files.map(g=>{const b=Hi(g,V("migrations.labels.artifactFile"));if(typeof b.path!="string"||typeof b.size!="number"||typeof b.sha256!="string"||typeof b.mode!="string")throw new Error(V("migrations.invalidArtifactFile"));return{path:b.path,size:b.size,sha256:b.sha256,mode:b.mode}}),startup:{module:r.module,object:r.object,...Array.isArray(r.command)&&r.command.every(g=>typeof g=="string")?{command:r.command}:{}},environment:{required:d,optional:f,defaults:m},verification:{status:a.status,checks:a.checks.map(g=>{const b=Hi(g,V("migrations.labels.verificationCheck"));if(typeof b.name!="string"||!["passed","failed"].includes(String(b.status)))throw new Error(V("migrations.invalidVerificationCheck"));return{name:b.name,status:b.status,...typeof b.detail=="string"?{detail:b.detail}:{}}})},warnings:Gg(t.warnings,V("migrations.labels.artifactWarnings")),report:{path:l.path},artifact:{path:"migration-result.zip",size:c.size,sha256:c.sha256},created_at:t.created_at}}async function cu(e,t={},n=Wo){return fetch(Uo(`${xBt}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}function _Bt(e){return Array.isArray(e)?e.map(t=>{if(!t||typeof t!="object"||Array.isArray(t))return"";const n=t,i=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").join("."):"",r=typeof n.msg=="string"?n.msg:"";return r?i?`${i}: ${r}`:r:""}).filter(Boolean).join(V("migrations.validationSeparator")):""}async function bz(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Hi(JSON.parse(n),V("migrations.labels.errorResponse"));if(Array.isArray(r.detail)){const a=_Bt(r.detail);return new sl(a?V("migrations.requestValidationFailed",{detail:a}):t,e.status,"MIGRATION_REQUEST_INVALID",!1,e.statusText,n)}if(typeof r.detail=="string")return new sl(r.detail,e.status,typeof r.code=="string"?r.code:"MIGRATION_ERROR",r.retryable===!0,e.statusText,n);const s=r.detail&&typeof r.detail=="object"?Hi(r.detail,V("migrations.labels.errorDetail")):r;return new sl(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"MIGRATION_ERROR",s.retryable===!0,e.statusText,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing");return new sl(V("migrations.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"MIGRATION_ERROR",!1,e.statusText,n)}}async function nf(e,t){if(!e.ok)throw await bz(e,t);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new sl(V("migrations.nonJsonResponse",{fallback:t,status:e.status}),e.status,"MIGRATION_RESPONSE_INVALID",!1,e.statusText);return e.json()}async function NBt(e){const t=Hi(await nf(await cu("/capabilities",{signal:e}),V("migrations.loadCapabilitiesFailed")),V("migrations.labels.capabilities"));if(typeof t.enabled!="boolean"||typeof t.reason!="string"||typeof t.maxUploadBytes!="number"||typeof t.sessionTtlSeconds!="number"||!Array.isArray(t.frameworks))throw new Error(V("migrations.invalidCapabilities"));const n={enabled:t.enabled,reason:t.reason,maxUploadBytes:t.maxUploadBytes,sessionTtlSeconds:t.sessionTtlSeconds,frameworks:t.frameworks.map(i=>WO(i,V("migrations.labels.framework")))};if(t.model!==void 0){const i=Hi(t.model,V("migrations.labels.modelCapabilities"));if(typeof i.configured!="boolean"||typeof i.id!="string")throw new Error(V("migrations.invalidModelCapabilities"));n.model={configured:i.configured,id:i.id}}return n}async function AL(e){const t=Hi(await nf(await cu("/tasks",{signal:e}),V("migrations.loadTasksFailed")),V("migrations.labels.taskList"));if(!Array.isArray(t.items))throw new Error(V("migrations.invalidTaskList"));return t.items.map(a0)}async function jBt(e){return a0(await nf(await cu("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e.taskId,sourceFileName:e.sourceFileName,instruction:e.instruction,...e.modelId?{modelId:e.modelId}:{}}),signal:e.signal},XI),V("migrations.createTaskFailed")))}async function Xne(e,t,n){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}/source`,{method:"PUT",headers:{"Content-Type":"application/zip"},body:t,signal:n},XI),V("migrations.uploadProjectFailed")))}async function _L(e,t){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}`,{signal:t}),V("migrations.loadTasksFailed")))}async function RBt(e,t){return TBt(await nf(await cu(`/tasks/${encodeURIComponent(e)}/activity`,{signal:t,cache:"no-store"}),V("migrations.loadActivityFailed")))}async function IBt(e){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e.taskId)}/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({framework:e.framework,entry:e.entry||null,appName:e.appName,instruction:e.instruction,analysisAttempt:e.analysisAttempt,analysisSha256:e.analysisSha256,inputSha256:e.inputSha256,boundaryConfirmed:!0}),signal:e.signal},XI),V("migrations.startFailed")))}async function PBt(e){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e.taskId)}/answers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysisAttempt:e.analysisAttempt,analysisSha256:e.analysisSha256,inputSha256:e.inputSha256,answers:e.answers}),signal:e.signal},XI),V("migrations.submitAnswersFailed")))}async function DBt(e,t){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}/stop`,{method:"POST",signal:t}),V("migrations.stopFailed")))}async function MBt(e,t){return ABt(await nf(await cu(`/tasks/${encodeURIComponent(e)}/artifact`,{signal:t}),V("migrations.loadArtifactFailed")))}async function LBt(e,t,n){var s;const i=new URLSearchParams({path:t}),r=await cu(`/tasks/${encodeURIComponent(e)}/artifact/file?${i}`,{signal:n},is);if(!r.ok)throw await bz(r,V("migrations.loadArtifactFileFailed"));return{blob:await r.blob(),mimeType:((s=r.headers.get("content-type"))==null?void 0:s.split(";",1)[0])||"application/octet-stream"}}function $Bt(e,t){var i;return((i=(e.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:i[1])||t}async function FBt(e,t,n){const i=await cu(`/tasks/${encodeURIComponent(e)}/download`,{signal:n},is);if(!i.ok)throw await bz(i,V("migrations.downloadArtifactFailed"));const r=URL.createObjectURL(await i.blob()),s=document.createElement("a");s.href=r,s.download=$Bt(i,`${t}-migrated.zip`),s.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}function o0({children:e,...t}){return o.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e})}function BBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"m10 6-6 6 6 6M4 12h16"})})}function UBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 3v12m-4-4 4 4 4-4M5 20h14"})})}function Xw(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M6 3.5h8l4 4V20H6zM14 3.5v4h4M9 12h6M9 15.5h6"})})}function QBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function zBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M14.5 4.5c2.3-.9 4.2-.8 5-.6.2.8.3 2.7-.6 5l-5.1 5.1-3.8-3.8zM15.4 8.6h.1M10.3 10.5l-3.8.7-2.1 2.1 5.3.2M13.5 13.7l-.7 3.8-2.1 2.1-.2-5.3M7.2 16.8l-2.8 2.8"})})}function VBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 16V4m-4 4 4-4 4 4M5 20h14"})})}function Yne(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"m6 6 12 12M18 6 6 18"})})}function HBt(e){return e.flatMap(t=>{if(t.kind==="reasoning"&&t.detail)return[{kind:"thinking",text:t.detail,done:t.status!=="running"}];if(t.kind==="message"&&t.detail)return[{kind:"text",text:t.detail}];if(t.kind==="plan")return[{kind:"plan",title:t.title,summary:t.detail,items:t.plan??[],done:t.status!=="running"}];if(t.kind==="command"){const n=t.tool,i=n!=null&&n.error||typeof(n==null?void 0:n.exitCode)=="number"?{...n.output!==void 0?{output:n.output}:{},...n.error?{error:n.error}:{},...typeof n.exitCode=="number"?{exitCode:n.exitCode}:{}}:n==null?void 0:n.output;return[{kind:"tool",name:(n==null?void 0:n.name)??t.title,args:n==null?void 0:n.input,response:i,done:t.status!=="running",status:t.status,...t.status==="failed"?{defaultOpen:!0}:{}}]}return t.kind==="status"&&t.status!=="completed"?[{kind:"tool",name:t.title,response:t.detail,done:t.status!=="running",status:t.status,...t.status==="failed"?{defaultOpen:!0}:{}}]:[]})}function qBt({baseVersion:e,capabilities:t,loading:n,preparationStage:i,error:r,onCancel:s,onClose:a,onCreate:l}){const{t:c}=Te("migrations"),u=p.useId(),d=p.useRef(null),f=i!==null,h=p.useRef(f),m=p.useRef(a);return h.current=f,m.current=a,p.useEffect(()=>{const g=document.body.style.overflow,b=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",window.requestAnimationFrame(()=>{var y,x;(x=(y=d.current)==null?void 0:y.querySelector("textarea"))==null||x.focus()});const v=y=>{if(y.key==="Escape"){h.current||m.current();return}if(y.key!=="Tab"||!d.current)return;const x=[...d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(k=>k.offsetParent!==null);if(x.length===0)return;const O=x[0],w=x[x.length-1];y.shiftKey&&document.activeElement===O?(y.preventDefault(),w.focus()):!y.shiftKey&&document.activeElement===w&&(y.preventDefault(),O.focus())};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",v),b!=null&&b.isConnected&&b.focus()}},[]),Li.createPortal(o.jsx("div",{className:"migration-optimize-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&!f&&a()},children:o.jsxs("section",{ref:d,className:"migration-optimize-dialog",role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-busy":f||void 0,children:[o.jsxs("header",{className:"migration-optimize-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:u,children:c("optimization.title")}),o.jsx("p",{title:e.projectName,children:e.projectName})]}),o.jsx("button",{type:"button",className:"migration-optimize-dialog__close",onClick:a,disabled:f,"aria-label":c("optimization.closeAria"),title:c("common.close"),children:o.jsx(_Ce,{})})]}),o.jsx("div",{className:"migration-optimize-dialog__body",children:o.jsx(ORe,{capabilities:t,loading:n,preparationStage:i,error:r,onCancel:s,onCreate:async(g,b)=>{await l(g,b,e)},baseVersion:e})})]})}),document.body)}function WBt({capabilities:e,capabilitiesLoading:t,preparationStage:n,optimizationError:i,initialProjectId:r,onOptimize:s,onCancelOptimization:a,onDownload:l,onDeploy:c}){const{t:u}=Te("migrations"),[d,f]=p.useState();return o.jsxs(o.Fragment,{children:[o.jsxs("main",{className:"migration-main migration-projects-page",children:[o.jsx("header",{className:"migration-main__header",children:o.jsxs("div",{children:[o.jsx("h2",{children:u("projects.title")}),o.jsx("p",{children:u("projects.description")})]})}),o.jsx("div",{className:"migration-projects-page__content",children:o.jsx(wRe,{origin:"migration",title:u("projects.libraryTitle"),description:u("projects.libraryDescription"),emptyTitle:u("projects.emptyTitle"),emptyDescription:u("projects.emptyDescription"),capabilities:e,capabilitiesLoading:t,creating:n!==null,initialProjectId:r,onSelectBaseVersion:f,onClearBaseVersion:()=>{},onDownload:l,onDeploy:c})})]}),d?o.jsx(qBt,{baseVersion:d,capabilities:e,loading:t,preparationStage:n,error:i,onCancel:a,onClose:()=>f(void 0),onCreate:s}):null]})}const GBt=20*1024*1024,NL=1200,Zne=3e3,KBt=5e3,Jne=500,XBt=()=>{},YBt={langchain:"framework.langchain",langgraph:"framework.langgraph",adk:"framework.adk",strands:"framework.strands",agentcore:"framework.agentcore",dify:"framework.dify",any:"framework.any"};function Bi(e,t){return an.t(e,{ns:"migrations",...t})}function lIe(e){return Bi(YBt[e])}const jL=new Set(["langchain","langgraph","adk","strands","agentcore"]);function ZBt(e){switch(e){case"awaiting_upload":return Bi("state.awaitingUpload");case"analyzing":return Bi("state.analyzing");case"needs_input":return Bi("state.needsInput");case"analysis_ready":return Bi("state.analysisReady");case"migrating":return Bi("state.migrating");case"validating":return Bi("state.validating");case"packaging":return Bi("state.packaging");case"succeeded":return Bi("state.succeeded");case"succeeded_with_warnings":return Bi("state.succeededWithWarnings");case"partial":return Bi("state.partial");case"failed":return Bi("state.failed");case"cancelled":return Bi("state.cancelled");case"expired":return Bi("state.expired")}}function RL(e){return e.state==="partial"&&e.artifact.previewReady?Bi("task.partialReady"):["succeeded","succeeded_with_warnings"].includes(e.state)&&e.artifact.previewReady?e.state==="succeeded_with_warnings"?Bi("task.readyWithWarnings"):Bi("task.ready"):e.message}function JBt(e){switch(e){case"passed":return Bi("verification.passed");case"failed":return Bi("verification.failed");case"degraded":return Bi("verification.degraded")}}function IL({stage:e}){const{t}=Te("migrations"),n=[{id:"session",label:t("transfer.session")},{id:"upload",label:t("transfer.upload")},{id:"analysis",label:t("transfer.analysis")}],i=n.findIndex(r=>r.id===e);return o.jsx("div",{className:"migration-transfer-progress",role:"status",children:n.map((r,s)=>o.jsxs("div",{className:s=s)return{title:Bi("expiry.ended"),detail:Bi(n?"expiry.savedAvailable":"expiry.unavailable")};const a=Math.max(0,s-t),l=Math.floor(a/6e4),c=Math.floor(a%6e4/1e3);return{title:Bi("expiry.countdown",{minutes:l,seconds:c}),detail:r}}function oUt(e,t){let n=!1;const i=e.map(r=>{var l;if(r.state==="expired")return r;const s=new Date(r.expiresAt).getTime();if(!Number.isFinite(s)||ti.id!==t.id);return[t,...n].sort((i,r)=>{const s=typeof i.createdAt=="number"?i.createdAt*1e3:new Date(i.createdAt).getTime();return(typeof r.createdAt=="number"?r.createdAt*1e3:new Date(r.createdAt).getTime())-s})}function lUt(e,t){return e.find(n=>n.id===t)??null}function cUt(e,t){return e.startsWith("text/")||/(?:json|javascript|xml|yaml)/i.test(e)||/\.(?:py|ts|tsx|js|jsx|json|ya?ml|md|txt|toml|ini|cfg|env|sh|dockerfile)$/i.test(t)}function uUt({analysis:e}){var n;const{t}=Te("migrations");return o.jsxs("div",{className:"migration-analysis",children:[o.jsx(Bu,{text:e.summary,allowRawHtml:!1}),o.jsxs("div",{className:"migration-analysis__facts",children:[e.recommended?o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.recommended")}),o.jsx("strong",{children:lIe(e.recommended.framework)}),o.jsx("p",{children:e.recommended.reason})]}):null,o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.scope")}),o.jsx("ul",{children:e.boundary.include.map(i=>o.jsx("li",{children:i},i))})]}),e.boundary.exclude.length>0?o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.excluded")}),o.jsx("ul",{children:e.boundary.exclude.map(i=>o.jsx("li",{children:i},i))})]}):null]}),(n=e.frameworks[0])!=null&&n.evidence.length?o.jsxs("details",{className:"migration-analysis__evidence",children:[o.jsx("summary",{children:t("analysis.viewEvidence")}),o.jsx("ul",{children:e.frameworks.flatMap(i=>i.evidence.map(r=>o.jsxs("li",{children:[o.jsxs("code",{children:[r.path,":",r.line]}),o.jsx("span",{children:r.reason})]},`${i.id}:${r.path}:${r.line}`)))})]}):null,e.warnings.length>0?o.jsx("div",{className:"migration-analysis__warnings",children:e.warnings.map(i=>o.jsx("p",{children:i},i))}):null,e.assumptions.length>0?o.jsxs("details",{className:"migration-analysis__evidence",children:[o.jsx("summary",{children:t("analysis.viewAssumptions")}),o.jsx("ul",{children:e.assumptions.map(i=>o.jsx("li",{children:i},i))})]}):null]})}function dUt({activity:e,loading:t,error:n,analyzing:i}){const{t:r}=Te("migrations"),s=(e==null?void 0:e.items)??[],a=HBt(s);return o.jsxs("section",{className:"migration-activity","aria-label":r("activity.ariaLabel"),children:[o.jsxs("div",{className:"migration-activity__heading",children:[o.jsx("span",{className:`migration-activity__marker${e!=null&&e.complete?" is-complete":""}`,"aria-hidden":"true"}),o.jsx("strong",{children:r("activity.title")})]}),a.length>0?o.jsx("div",{className:"migration-activity__stream",children:o.jsx(TE,{blocks:a,onAction:XBt})}):t||!(e!=null&&e.complete)?o.jsx(xn,{children:r(i?"activity.startingAnalysis":"activity.startingMigration")}):null,n?o.jsx("p",{className:"migration-activity__error",role:"status",children:n}):null]})}function fUt({task:e,artifact:t}){var h;const{t:n,i18n:i}=Te("migrations"),[r,s]=p.useState(""),[a,l]=p.useState(((h=t.files[0])==null?void 0:h.path)??""),[c,u]=p.useState(null),d=t.files.find(m=>m.path===a)??t.files[0],f=p.useMemo(()=>{const m=r.trim().toLocaleLowerCase();return(m?t.files.filter(b=>b.path.toLocaleLowerCase().includes(m)):t.files).slice(0,Jne)},[t.files,r]);return p.useEffect(()=>{if(!d)return;if(d.size>2*1024*1024){u({path:d.path,loading:!1,error:n("artifact.fileTooLarge")});return}const m=new AbortController;let g="";return u({path:d.path,loading:!0}),LBt(e.id,d.path,m.signal).then(async({blob:b,mimeType:v})=>{if(!m.signal.aborted){if(v.startsWith("image/")){g=URL.createObjectURL(b),u({path:d.path,loading:!1,imageUrl:g});return}if(cUt(v,d.path)){const y=await b.text();if(m.signal.aborted)return;u({path:d.path,loading:!1,text:y});return}u({path:d.path,loading:!1,error:n("artifact.unsupportedPreview")})}}).catch(b=>{m.signal.aborted||u({path:d.path,loading:!1,error:b instanceof Error?b.message:String(b)})}),()=>{m.abort(),g&&URL.revokeObjectURL(g)}},[d,e.id,n,i.resolvedLanguage]),o.jsxs("div",{className:"migration-artifact-browser",children:[o.jsxs("aside",{"aria-label":n("artifact.filesAria"),children:[o.jsxs("label",{className:"migration-artifact-browser__search",children:[o.jsx("span",{className:"sr-only",children:n("artifact.searchAria")}),o.jsx("input",{value:r,onChange:m=>s(m.currentTarget.value),placeholder:n("artifact.searchPlaceholder")})]}),o.jsx("div",{className:"migration-artifact-browser__files",children:f.map(m=>o.jsxs("button",{type:"button",className:m.path===(d==null?void 0:d.path)?"is-active":"",onClick:()=>l(m.path),title:m.path,children:[o.jsx(Xw,{}),o.jsx("span",{children:m.path}),o.jsx("small",{children:hj(m.size)})]},m.path))}),t.files.length>f.length?o.jsx("p",{className:"migration-artifact-browser__limit",children:n("artifact.limit",{count:Jne})}):null]}),o.jsxs("section",{children:[o.jsxs("header",{children:[o.jsx("span",{title:d==null?void 0:d.path,children:(d==null?void 0:d.path)||n("artifact.noSelection")}),d?o.jsx("small",{children:hj(d.size)}):null]}),o.jsx("div",{className:"migration-artifact-browser__preview",children:d?(c==null?void 0:c.path)!==d.path||c.loading?o.jsx(xn,{children:n("artifact.loadingFile")}):c.error?o.jsx("p",{role:"status",children:c.error}):c.imageUrl?o.jsx("img",{src:c.imageUrl,alt:d.path}):o.jsx(zE,{value:c.text??"",path:d.path,readOnly:!0,onChange:()=>{}}):o.jsx("p",{children:n("artifact.noPreview")})})]})]})}function hUt({cloudProvider:e,onBack:t,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:a=Ji(e),projectCapabilities:l,projectCapabilitiesLoading:c,optimizationPreparationStage:u,optimizationError:d,onOptimizeVersion:f,onCancelOptimization:h,onDownloadSavedVersion:m,onDeploySavedVersion:g,initialPage:b="new",initialProjectId:v=""}){var ls,va,aa,ws,Ua,oa,Qa,Jn,Ni,Eo,xa,Xi,Co;const{t:y,i18n:x}=Te("migrations"),O=x.resolvedLanguage||x.language,w=p.useRef(null),k=p.useRef(""),S=p.useRef(null),[E,C]=p.useState(null),[N,_]=p.useState([]),[j,A]=p.useState(b),[F,T]=p.useState(v),[P,R]=p.useState(""),[L,M]=p.useState(null),[U,I]=p.useState([]),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(""),[le,se]=p.useState(0),[re,ge]=p.useState(!1),[W,X]=p.useState(!0),[ae,ue]=p.useState(""),[Oe,ke]=p.useState(""),[st,Le]=p.useState(""),[Me,Ie]=p.useState(!1),[qe,Ae]=p.useState(Date.now()),[ze,Ee]=p.useState(null),[De,J]=p.useState("langchain"),[he,_e]=p.useState(""),[Ze,at]=p.useState(""),[wt,Se]=p.useState({}),[ve,He]=p.useState(null),[Je,Ce]=p.useState(""),[Wt,ln]=p.useState(!1),[cn,Ot]=p.useState(0),[jt,ot]=p.useState(null),[gt,Pe]=p.useState(!1),[Et,bt]=p.useState(""),[Mt,$e]=p.useState(!1),[ye,Ue]=p.useState(!1),[Ke,ft]=p.useState(a),[ut,Gt]=p.useState(),[Rt,zt]=p.useState({}),Z=lUt(N,P),Bt=(E==null?void 0:E.maxUploadBytes)??GBt,Qe=iUt(Bt),tt=p.useMemo(()=>new Set((E==null?void 0:E.unsupportedModelIds)??[]),[E==null?void 0:E.unsupportedModelIds]),ht=p.useMemo(()=>U.filter(xe=>tUt(xe,tt)),[U,tt]),pe=(Z==null?void 0:Z.modelId)||H,We=p.useMemo(()=>{var tn;const xe=ht.map(In=>({value:In.id,label:In.displayName,description:[In.id,In.vendorName,In.lifecycleStatus==="Retiring"?y("model.retiring"):""].filter(Boolean).join(" · ")})),Xe=((Z==null?void 0:Z.modelId)||H||((tn=E==null?void 0:E.model)==null?void 0:tn.id)||"").trim(),Yt=(Z==null?void 0:Z.modelId)===Xe;return Xe&&(Yt||!tt.has(Xe))&&!xe.some(In=>In.value===Xe)&&xe.unshift({value:Xe,label:Xe,description:y("model.currentDefault")}),xe},[(ls=E==null?void 0:E.model)==null?void 0:ls.id,ht,H,Z==null?void 0:Z.modelId,y,tt]),vt=ze?Math.max(0,Math.floor((qe-ze)/1e3)):0,vn=jt==null?void 0:jt.items[jt.items.length-1],Ki=[(jt==null?void 0:jt.items.length)??0,(vn==null?void 0:vn.id)??"",(vn==null?void 0:vn.status)??"",((va=vn==null?void 0:vn.detail)==null?void 0:va.length)??0].join(":"),{ref:Fe,onScroll:Pt}=WEe(`${(Z==null?void 0:Z.id)??"new"}:${(Z==null?void 0:Z.state)??"new"}:${Ki}`);async function pn(xe,Xe=!0,Yt){try{const tn=await _L(xe,Yt);return Yt!=null&&Yt.aborted?null:(_(In=>Of(In,tn)),Le(""),Ie(!1),tn)}catch(tn){return Yt!=null&&Yt.aborted||Xe&&(Le(tn instanceof Error?tn.message:String(tn)),Ie(tn instanceof sl&&tn.retryable)),null}}async function Jt(xe){try{const Xe=await AL(xe);if(xe!=null&&xe.aborted)return;_(Xe),Le(""),Ie(!1)}catch(Xe){if(xe!=null&&xe.aborted)return;Le(Xe instanceof Error?Xe.message:String(Xe)),Ie(Xe instanceof sl&&Xe.retryable)}}p.useEffect(()=>{const xe=new AbortController;return X(!0),ke(""),Promise.all([NBt(xe.signal),AL(xe.signal)]).then(([Xe,Yt])=>{xe.signal.aborted||(C(Xe),_(Yt))}).catch(Xe=>{xe.signal.aborted||ke(Xe instanceof Error?Xe.message:String(Xe))}).finally(()=>{xe.signal.aborted||X(!1)}),()=>xe.abort()},[]),p.useEffect(()=>{const xe=new AbortController;return q(!0),ee(""),Ex({signal:xe.signal,refresh:le>0}).then(Xe=>{xe.signal.aborted||I(Xe.models)}).catch(Xe=>{xe.signal.aborted||ee(Xe instanceof Error?Xe.message:y("model.loadError"))}).finally(()=>{xe.signal.aborted||q(!1)}),()=>xe.abort()},[e,le,y]),p.useEffect(()=>{var Yt,tn;if(!E||H)return;const xe=((Yt=E.model)==null?void 0:Yt.id.trim())||"",Xe=xe&&!tt.has(xe)?xe:((tn=ht[0])==null?void 0:tn.id)||"";Xe&&K(Xe)},[E,ht,H,tt]),p.useEffect(()=>()=>{var xe;(xe=S.current)==null||xe.abort(),S.current=null},[]),p.useEffect(()=>{const xe=window.setInterval(()=>{const Xe=Date.now();Ae(Xe),_(Yt=>oUt(Yt,Xe))},1e3);return()=>window.clearInterval(xe)},[]),p.useEffect(()=>{if(!N.some(Yt=>fg(Yt.state)))return;const xe=new AbortController,Xe=window.setInterval(()=>{AL(xe.signal).then(Yt=>{xe.signal.aborted||_(Yt),Le(""),Ie(!1)}).catch(Yt=>{xe.signal.aborted||(Le(Yt instanceof Error?Yt.message:String(Yt)),Ie(Yt instanceof sl&&Yt.retryable),Yt instanceof sl&&Yt.retryable||window.clearInterval(Xe))})},KBt);return()=>{xe.abort(),window.clearInterval(Xe)}},[N.some(xe=>fg(xe.state))]),p.useEffect(()=>{var tn;if(!Z||!fg(Z.state)&&((tn=Z.persistence)==null?void 0:tn.state)!=="saving")return;const xe=new AbortController;let Xe;const Yt=async()=>{var In;try{const mr=await _L(Z.id,xe.signal);if(xe.signal.aborted)return;_(jr=>Of(jr,mr)),Le(""),Ie(!1),(fg(mr.state)||((In=mr.persistence)==null?void 0:In.state)==="saving")&&(Xe=window.setTimeout(()=>void Yt(),NL))}catch(mr){if(xe.signal.aborted)return;Le(mr instanceof Error?mr.message:String(mr)),Ie(mr instanceof sl&&mr.retryable),mr instanceof sl&&mr.retryable&&(Xe=window.setTimeout(()=>void Yt(),NL))}};return Xe=window.setTimeout(()=>void Yt(),NL),()=>{xe.abort(),Xe!==void 0&&window.clearTimeout(Xe)}},[Z==null?void 0:Z.id,Z==null?void 0:Z.state,(aa=Z==null?void 0:Z.persistence)==null?void 0:aa.state]),p.useEffect(()=>{const xe=Fe.current;xe&&(xe.scrollTop=xe.scrollHeight,Pt())},[P,Fe,Pt]),p.useEffect(()=>{ot(null),bt(""),Pe(!1)},[Z==null?void 0:Z.id]),p.useEffect(()=>{if(!Z||!eie(Z))return;const xe=new AbortController;let Xe;const Yt=async()=>{Pe(!0);try{const tn=await RBt(Z.id,xe.signal);if(xe.signal.aborted)return;ot(tn),bt(""),!tn.complete&&fg(Z.state)&&(Xe=window.setTimeout(()=>void Yt(),Zne))}catch(tn){if(xe.signal.aborted)return;bt(y("activity.loadError")),fg(Z.state)&&tn instanceof sl&&tn.retryable&&(Xe=window.setTimeout(()=>void Yt(),Zne))}finally{xe.signal.aborted||Pe(!1)}};return Yt(),()=>{xe.abort(),Xe!==void 0&&window.clearTimeout(Xe)}},[Z==null?void 0:Z.id,Z==null?void 0:Z.state,(ws=Z==null?void 0:Z.analysisRef)==null?void 0:ws.sha256,(Ua=Z==null?void 0:Z.confirmation)==null?void 0:Ua.framework,y]),p.useEffect(()=>{if(!(Z!=null&&Z.analysis)||!Z.analysisRef||!["needs_input","analysis_ready"].includes(Z.state))return;const xe=`${Z.id}:${Z.analysisRef.attempt}:${Z.analysisRef.sha256}`;if(k.current===xe||(k.current=xe,Se({}),Z.state!=="analysis_ready"))return;const Xe=Z.analysis.recommended;Xe&&(J(Xe.framework),_e(Xe.entry||""),at(tie(Z.sourceFileName)))},[Z]),p.useEffect(()=>{if(He(null),Ce(""),ln(!1),Ue(!1),zt({}),!(Z!=null&&Z.artifact.previewReady))return;const xe=new AbortController;return MBt(Z.id,xe.signal).then(Xe=>{xe.signal.aborted||He(Xe)}).catch(Xe=>{xe.signal.aborted||(Ce(Xe instanceof Error?Xe.message:String(Xe)),ln(Xe instanceof sl&&Xe.retryable))}),()=>xe.abort()},[Z==null?void 0:Z.id,Z==null?void 0:Z.artifact.previewReady,cn]),p.useEffect(()=>{if(!ve)return;const xe=kFt(ve,e);zt(Xe=>{var tn;const Yt={...Xe};for(const[In,mr]of Object.entries(xe))(tn=Yt[In])!=null&&tn.trim()||(Yt[In]=mr);return Yt})},[ve,e]);function en(xe){if(!S.current&&(ke(""),!!xe)){if(!xe.name.toLowerCase().endsWith(".zip")){M(null),ke(y("upload.zipOnly"));return}if(xe.name.length>255||/[/\\\u0000-\u001f]/.test(xe.name)){M(null),ke(y("upload.invalidName"));return}if(xe.size>Bt){M(null),ke(y("upload.tooLarge",{size:Qe}));return}if(xe.size===0){M(null),ke(y("upload.empty"));return}M(xe)}}function Un(xe){var Yt;const Xe=(Yt=xe.currentTarget.files)==null?void 0:Yt[0];xe.currentTarget.value="",en(Xe)}async function wn(){if(!L||ae||S.current)return;const xe=new AbortController;S.current=xe;const Xe=()=>S.current===xe&&!xe.signal.aborted,Yt=`migration-v1-${crypto.randomUUID().replace(/-/g,"")}`;ue("create"),Ee(Date.now()),ke("");try{const tn=await jBt({taskId:Yt,sourceFileName:L.name,instruction:"",modelId:H||void 0,signal:xe.signal});if(!Xe())return;_(mr=>Of(mr,tn)),R(tn.id),ue("upload"),Ee(null);const In=await Xne(tn.id,L,xe.signal);if(!Xe())return;_(mr=>Of(mr,In)),M(null)}catch(tn){if(!Xe())return;const In=await pn(Yt,!1,xe.signal);if(!Xe())return;if(In){if(R(In.id),In.state!=="awaiting_upload"){M(null);return}}else if(await Jt(xe.signal),!Xe())return;ke(tn instanceof Error?tn.message:String(tn))}finally{S.current===xe&&(S.current=null,Ee(null),ue(""))}}async function oi(){if(!(Z!=null&&Z.canUpload)||!L||ae||S.current)return;const xe=new AbortController;S.current=xe;const Xe=()=>S.current===xe&&!xe.signal.aborted;ue("upload"),ke("");try{const Yt=await Xne(Z.id,L,xe.signal);if(!Xe())return;_(tn=>Of(tn,Yt)),M(null)}catch(Yt){if(!Xe())return;const tn=await pn(Z.id,!0,xe.signal);if(!Xe())return;if(tn&&tn.state!=="awaiting_upload"){M(null);return}ke(Yt instanceof Error?Yt.message:String(Yt))}finally{S.current===xe&&(S.current=null,ue(""))}}const Oi=p.useMemo(()=>{var xe;return(((xe=Z==null?void 0:Z.analysis)==null?void 0:xe.entries)??[]).filter(Xe=>Xe.framework===De).map(Xe=>({value:Xe.value,label:Xe.value,description:Xe.evidence}))},[De,(oa=Z==null?void 0:Z.analysis)==null?void 0:oa.entries]),mi=(((Qa=Z==null?void 0:Z.analysis)==null?void 0:Qa.questions)??[]).every(xe=>{var Xe;return!xe.required||!!((Xe=wt[xe.id])!=null&&Xe.trim())}),bn=nUt(Ze),qi=!!(Z!=null&&Z.canConfirm&&Z.analysisRef&&!ae&&!bn&&(!jL.has(De)||he.trim())),ri=!!(Z!=null&&Z.canAnswer&&Z.analysisRef&&!ae&&mi);async function zi(){if(!(!(Z!=null&&Z.analysisRef)||!ri)){ue("answer"),ke("");try{const xe=await PBt({taskId:Z.id,analysisAttempt:Z.analysisRef.attempt,analysisSha256:Z.analysisRef.sha256,inputSha256:Z.analysisRef.inputSha256,answers:wt});_(Xe=>Of(Xe,xe))}catch(xe){const Xe=await pn(Z.id);if(Xe&&Xe.state!=="needs_input")return;ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function as(){if(!(!(Z!=null&&Z.analysisRef)||!qi)){ue("confirm"),ke("");try{const xe=await IBt({taskId:Z.id,framework:De,entry:jL.has(De)?he.trim():void 0,appName:Ze.trim(),instruction:"",analysisAttempt:Z.analysisRef.attempt,analysisSha256:Z.analysisRef.sha256,inputSha256:Z.analysisRef.inputSha256});_(Xe=>Of(Xe,xe))}catch(xe){const Xe=await pn(Z.id);if(Xe&&Xe.state!=="analysis_ready")return;ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function Lr(){if(!(!(Z!=null&&Z.canStop)||ae)){ue("stop"),ke("");try{const xe=await DBt(Z.id);_(Xe=>Of(Xe,xe)),$e(!1)}catch(xe){const Xe=await pn(Z.id);if(Xe&&!Xe.canStop){$e(!1);return}ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function _r(){if(!(!(Z!=null&&Z.artifact.downloadReady)||ae)){ue("download"),ke("");try{await FBt(Z.id,VA(Z.sourceFileName))}catch(xe){ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}function xs(){var xe,Xe;A("new"),T(""),R(""),M(null),ke(""),Le(""),Ie(!1),He(null),Ce(""),ln(!1),Ue(!1),$e(!1),K(((xe=E==null?void 0:E.model)==null?void 0:xe.id.trim())||((Xe=ht[0])==null?void 0:Xe.id)||"")}const os=ve?{name:((Jn=Z==null?void 0:Z.confirmation)==null?void 0:Jn.app_name)||tie((Z==null?void 0:Z.sourceFileName)||"migration.zip"),files:[{path:"migration-result.json",content:`${JSON.stringify(ve,null,2)} +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function ZRe({appName:e,testRunId:t,sessionId:n,endTimeMs:i,onClose:r,title:s}){const{t:a}=Te("conversation"),[l,c]=p.useState(null),[u,d]=p.useState("loading"),[f,h]=p.useState(0),[m,g]=p.useState(new Set),[b,v]=p.useState(null),y=p.useRef(0),x=`${e??""}:${t??""}:${n}:${i??""}`,O=p.useRef(x);p.useEffect(()=>{O.current!==x&&(O.current=x,y.current=0),c(null),d("loading");let A=!1,F,T;if(t)T=cye(t,n);else if(e)T=L_(e,n,i);else{d("error");return}return T.then(P=>{A||(c(P),d("ready"),v(P.length?P.reduce((R,L)=>R.start_time<=L.start_time?R:L).span_id:null))}).catch(P=>{if(A)return;const R=j7t(P instanceof Error?P.message:String(P));d(R),R==="collecting"&&y.current<_7t&&(y.current+=1,F=window.setTimeout(()=>h(L=>L+1),N7t))}),()=>{A=!0,F!==void 0&&window.clearTimeout(F)}},[e,i,f,n,x,t]);const w=()=>{y.current=0,h(A=>A+1)},{rootNodes:k,min:S,total:E}=p.useMemo(()=>R7t(l??[]),[l]),C=p.useMemo(()=>I7t(k,m),[k,m]),N=(l==null?void 0:l.find(A=>A.span_id===b))??null,_=E/1e6,j=A=>g(F=>{const T=new Set(F);return T.has(A)?T.delete(A):T.add(A),T});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s??a("trace.title")}),o.jsx("div",{className:"drawer-sub",children:u==="ready"&&l?a("trace.callCount",{count:l.length,duration:_.toFixed(1)}):a(`trace.statuses.${u}`)})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":a("trace.close"),children:o.jsx(Ba,{className:"icon"})})]}),u==="loading"&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(fi,{className:"icon spin"})," ",a("trace.loading")]}),u==="collecting"&&o.jsxs("div",{className:"drawer-loading",role:"status","aria-live":"polite",children:[o.jsx(fi,{className:"icon spin"}),o.jsx("span",{children:a("trace.errors.collecting")}),o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:w,children:a("trace.retryNow")})]}),(u==="disabled"||u==="forbidden"||u==="error")&&o.jsxs("div",{className:"drawer-empty trace-state",role:"alert",children:[o.jsx("span",{children:a(`trace.errors.${u}`)}),u==="error"&&o.jsx(Ht,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:w,children:a("trace.reload")})]}),u==="ready"&&l&&l.length===0&&o.jsx("div",{className:"drawer-empty",children:a("trace.empty")}),C.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:C.map(A=>{const F=A.span,T=(F.start_time-S)/E*100,P=Math.max((F.end_time-F.start_time)/E*100,.6),R=A.children.length>0;return o.jsxs("button",{className:`trace-row ${b===F.span_id?"active":""}`,onClick:()=>v(F.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:A.depth*14},children:[o.jsx("span",{className:`trace-caret ${R?"":"hidden"} ${m.has(F.span_id)?"":"open"}`,onClick:L=>{L.stopPropagation(),R&&j(F.span_id)},children:o.jsx(Uk,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:kL(F.name)}}),o.jsx("span",{className:"trace-name",title:F.name,children:F.name})]}),o.jsx("span",{className:"trace-dur",children:Une(F.end_time-F.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${T}%`,width:`${P}%`,background:kL(F.name)}})})]},F.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:N?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:N.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:kL(N.name)}}),Une(N.end_time-N.start_time)]}),o.jsx("div",{className:"td-section",children:a("trace.attributes")}),o.jsx("div",{className:"td-props",children:Qne(N).filter(A=>!A.long).map(A=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:A.key}),o.jsx("span",{className:"td-val",children:A.value})]},A.key))}),Qne(N).filter(A=>A.long).map(A=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:A.key}),o.jsx("pre",{className:"td-pre",children:A.value})]},A.key))]}):o.jsx("div",{className:"drawer-empty",children:a("trace.selectCall")})})]})]})]})}const D7t=p.lazy(()=>Md(()=>import("../chunks/MarkdownPromptEditor-B5lw1jCi.js"),__vite__mapDeps([2,3]))),D8="veadk.generatedAgentTestRuns",EL=4;function hz(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(D8)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function JRe(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(D8,JSON.stringify(t)):window.sessionStorage.removeItem(D8)}catch{}}function M7t(e){JRe([...hz(),e])}function fw(e){JRe(hz().filter(t=>t!==e))}function L7t(e,t,n="text/plain"){const i=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),r=document.createElement("a");r.href=i,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)}const $7t=[{id:"type",label:"traditional.sections.type.label",hint:"traditional.sections.type.hint",icon:P7e,required:!0},{id:"basic",label:"traditional.sections.basic.label",hint:"traditional.sections.basic.hint",icon:Wd,required:!0},{id:"model",label:"traditional.sections.model.label",hint:"traditional.sections.model.hint",icon:m7e},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:L7e},{id:"skills",label:"traditional.sections.skills.label",hint:"traditional.sections.skills.hint",icon:mS},{id:"knowledge",label:"traditional.sections.knowledge.label",hint:"traditional.sections.knowledge.hint",icon:Y2},{id:"memory",label:"traditional.sections.memory.label",hint:"traditional.sections.memory.hint",icon:Abe},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:l7e},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:I7e}];function F7t({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function zne({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25h14.5"}),o.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),o.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),o.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function pz({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function mz({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const B7t={llm:"traditional.agentTypes.llm.label",sequential:"traditional.agentTypes.sequential.label",parallel:"traditional.agentTypes.parallel.label",loop:"traditional.agentTypes.loop.label",a2a:"traditional.agentTypes.a2a.label"},Vne={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},eIe="REGISTRY_SPACE_ID",U7t=gOe.filter(e=>e.key!==eIe);function tIe(e,t,n="volcengine"){var s,a,l;if(!(e!=null&&e.enabled))return{};const i=VR(n),r={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(r.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||i.topK,r.REGISTRY_REGION=((a=e.registryRegion)==null?void 0:a.trim())||i.region,r.REGISTRY_ENDPOINT=((l=e.registryEndpoint)==null?void 0:l.trim())||i.endpoint):(r.REGISTRY_TOP_K=e.registryTopK??"",r.REGISTRY_REGION=e.registryRegion??"",r.REGISTRY_ENDPOINT=e.registryEndpoint??""),r}function cy(e,t){if(t!=="byteplus")return e;const n=VR(t);return e.map(i=>i.key==="REGISTRY_REGION"?{...i,placeholder:n.region}:i.key==="REGISTRY_ENDPOINT"?{...i,placeholder:n.endpoint}:i.key==="MODEL_EMBEDDING_NAME"?{...i,placeholder:LBe(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:xl(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:FBe(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:BBe(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:UBe(t)}:i.key==="MODEL_IMAGE_API_BASE"||i.key==="MODEL_EDIT_API_BASE"||i.key==="MODEL_VIDEO_API_BASE"?{...i,placeholder:xl(t)}:i)}function Q7t({items:e,selected:t,onToggle:n,scrollRows:i}){const{t:r}=Te("create");return o.jsx("div",{className:`cw-checklist ${i?"cw-checklist-tools":""}`,style:i?{"--cw-checklist-max-height":`${i*40+(i-1)*8}px`}:void 0,children:e.map(s=>{const a=t.includes(s.id);return o.jsx(fz,{id:`cw-check-${s.id}`,className:`cw-check ${a?"is-on":""}`,checked:a,onCheckedChange:l=>{l!==a&&n(s.id)},label:o.jsx("span",{className:"cw-check-text",children:o.jsx("span",{className:"cw-check-title",children:r(`traditional.catalog.${s.id}.label`,{defaultValue:s.label})})})},s.id)})})}function CL({options:e,value:t,onChange:n,translationGroup:i}){const{t:r}=Te("create");return o.jsx("div",{className:"cw-segmented",children:e.map(s=>{var l;const a=(t??((l=e[0])==null?void 0:l.id))===s.id;return o.jsx("button",{type:"button",className:`cw-seg ${a?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":a,children:o.jsx("span",{className:"cw-seg-title",children:r(`traditional.backends.${i}.${s.id}.label`,{defaultValue:s.label})})},s.id)})})}function z7t(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function hw({env:e,values:t,onChange:n,renderAfterField:i}){const{t:r}=Te("create"),s=e.filter(a=>!a.hidden);return s.length===0?o.jsx("p",{className:"cw-env-empty",children:r("traditional.env.noAdditionalParameters")}):o.jsx("div",{className:"cw-env-fields",children:s.map(a=>{const l=t[a.key]??a.defaultValue??"",c=uz(a,t,r("traditional.env.invalidJson")),u=`cw-env-${a.key}`;return o.jsxs(p.Fragment,{children:[o.jsxs("label",{className:"cw-env-field",htmlFor:u,children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-title",children:[o.jsxs("span",{className:"cw-env-field-label",children:[a.comment||a.key,a.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),a.help&&o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":a.help,"aria-label":r("traditional.env.helpAriaLabel",{label:a.comment||a.key,help:a.help}),children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:a.help})]}),a.link&&o.jsx("a",{className:"cw-env-link",href:a.link.url,target:"_blank",rel:"noopener noreferrer",title:r("traditional.env.openOpenViking",{label:a.link.label}),"aria-label":r("traditional.env.openOpenViking",{label:a.link.label}),onClick:d=>d.stopPropagation(),children:o.jsx(gb,{"aria-hidden":"true"})})]}),a.comment&&o.jsx("code",{title:a.key,children:a.key})]}),a.multiline||a.format==="json"?o.jsx("textarea",{id:u,className:"cw-input cw-env-textarea",value:l,placeholder:a.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":!!c,onChange:d=>n(a.key,d.currentTarget.value)}):o.jsx("input",{id:u,className:"cw-input",type:z7t(a.key)?"password":"text",value:l,placeholder:a.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off","aria-invalid":!!c,onChange:d=>n(a.key,d.currentTarget.value)}),c&&o.jsx("span",{className:"cw-env-error",children:c})]}),i==null?void 0:i(a)]},a.key)})})}function V7t({value:e,onChange:t}){const{t:n}=Te("create"),i="cw-openviking-knowledge-index",r=n("traditional.env.openVikingIndexHelp");return o.jsxs("label",{className:"cw-env-field",htmlFor:i,children:[o.jsx("span",{className:"cw-env-field-head",children:o.jsxs("span",{className:"cw-env-field-title",children:[o.jsx("span",{className:"cw-env-field-label",children:n("traditional.env.openVikingIndex")}),o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":r,"aria-label":n("traditional.env.openVikingIndexAriaLabel",{help:r}),children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:r})]})]})}),o.jsx("input",{id:i,className:"cw-input",value:e,placeholder:"",autoComplete:"off",onChange:s=>t(s.currentTarget.value)})]})}function TL(e,t=$t("traditional.resources.unnamedAgentCenter")){return e.name.trim()||t}function Hne(e,t=$t("traditional.resources.unnamedKnowledgeBase")){const n=e.name.trim()||e.id||t,i=[e.sourceLabel,e.projectName].filter(Boolean);return i.length?`${n} · ${i.join(" · ")}`:n}function qne(e,t=$t("traditional.resources.unnamedMemory")){return e.name.trim()||e.id||t}function H7t(e){return e.available?"traditional.model.available":e.lifecycleStatus==="Retiring"?"traditional.model.retiring":e.activationState&&e.activationState!=="Available"?"traditional.model.notActivated":"traditional.model.unavailable"}function q7t(e){return e.available||e.lifecycleStatus==="Retiring"}function Wne({selectedLabel:e,placeholder:t,disabled:n,triggerAriaLabel:i,menuAriaLabel:r,searchAriaLabel:s,searchValue:a,searchPlaceholder:l,onSearchChange:c,empty:u,emptyLabel:d,triggerClassName:f="",optionsClassName:h="",renderOptions:m}){const[g,b]=p.useState(!1),v=p.useRef(null),y=p.useRef(null),x=p.useRef(null),O=p.useId(),[w,k]=p.useState(null);p.useEffect(()=>{if(!g)return;const C=_=>{var A;const j=_.target;j instanceof Node&&v.current&&!v.current.contains(j)&&!((A=x.current)!=null&&A.contains(j))&&b(!1)},N=_=>{var j;_.key==="Escape"&&(b(!1),(j=y.current)==null||j.focus())};return window.addEventListener("pointerdown",C),window.addEventListener("keydown",N),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",N)}},[g]),p.useEffect(()=>{if(!g){k(null);return}const C=()=>{const N=y.current;if(!N)return;const _=N.getBoundingClientRect(),j=12,A=6,F=window.innerHeight-_.bottom-j-A,T=_.top-j-A,P=F<300&&T>F,R=Math.max(96,P?T:F),L=Math.min(_.width,window.innerWidth-j*2),M=Math.min(Math.max(j,_.left),window.innerWidth-j-L);k({...P?{bottom:window.innerHeight-_.top+A}:{top:_.bottom+A},left:M,width:L,maxHeight:R,opensUp:P})};return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[g]);const S=()=>b(!1),E=C=>{var A,F;if(!["ArrowDown","ArrowUp","Home","End"].includes(C.key))return;const N=Array.from(((A=x.current)==null?void 0:A.querySelectorAll('[role="option"]:not(:disabled)'))??[]);if(!N.length)return;C.preventDefault();const _=N.findIndex(T=>T===document.activeElement),j=C.key==="Home"?0:C.key==="End"?N.length-1:C.key==="ArrowUp"?_<=0?N.length-1:_-1:_<0||_===N.length-1?0:_+1;(F=N[j])==null||F.focus()};return o.jsxs("div",{className:`cw-a2a-space-select-wrap cw-catalog-select${g?" is-open":""}`,ref:v,children:[o.jsxs("button",{ref:y,type:"button",className:`cw-a2a-space-trigger ${f}`.trim(),disabled:n,"aria-haspopup":"listbox","aria-controls":g?O:void 0,"aria-expanded":g,"aria-label":i,title:e,onClick:()=>{g||c(""),b(C=>!C)},children:[o.jsx("span",{className:t?"is-placeholder":void 0,children:e}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),g&&w&&Li.createPortal(o.jsxs("div",{ref:x,className:`cw-a2a-space-menu cw-catalog-menu cw-catalog-menu-portal${w.opensUp?" is-up":""}`,style:{top:w.top??"auto",bottom:w.bottom??"auto",left:w.left,width:w.width,maxHeight:w.maxHeight},onKeyDown:E,children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:a,autoFocus:!0,autoComplete:"off","aria-label":s,placeholder:l,onChange:C=>c(C.currentTarget.value)})}),o.jsxs("div",{id:O,className:`cw-picker-options cw-catalog-options ${h}`.trim(),role:"listbox","aria-label":r,children:[m(S),u&&o.jsx("div",{className:"cw-picker-empty",children:d})]})]}),document.body)]})}function W7t({value:e,cloudProvider:t,apiKeyId:n,apiKeyName:i,onApiKeyChange:r,onChange:s}){const{t:a}=Te("create"),[l,c]=p.useState([]),[u,d]=p.useState(!1),[f,h]=p.useState([]),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,x]=p.useState(null),[O,w]=p.useState(0),[k,S]=p.useState(0),[E,C]=p.useState(""),[N,_]=p.useState("");p.useEffect(()=>{const q=new AbortController;return d(!0),x(null),HF(q.signal,O>0).then(B=>{if(q.signal.aborted)return;c(B.keys);const ee=B.keys.find(le=>le.id===n)??B.keys.find(le=>le.name===i)??B.keys.find(le=>le.id===B.defaultKeyId)??B.keys[0];ee&&r(ee)}).catch(B=>{q.signal.aborted||x(B instanceof Error?B.message:a("traditional.model.apiKeyLoadError"))}).finally(()=>{q.signal.aborted||d(!1)}),()=>q.abort()},[t,O,a]),p.useEffect(()=>{if(!n){h([]);return}const q=new AbortController;return v(!0),x(null),g(null),Ex({signal:q.signal,apiKeyId:n,refresh:O>0||k>0}).then(B=>{q.signal.aborted||(h(B.models),g(n))}).catch(B=>{q.signal.aborted||x(B instanceof Error?B.message:a("traditional.model.loadError"))}).finally(()=>{q.signal.aborted||v(!1)}),()=>q.abort()},[n,t,k,O,a]);const j=e.trim(),A=m===n,F=A?f:[],T=l.find(q=>q.id===n),P=T?T.name:n?a("traditional.model.currentApiKey"):u?a("traditional.model.loadingApiKeys"):l.length===0?a("traditional.model.noApiKeys"):a("traditional.model.selectApiKey"),R=p.useMemo(()=>l.filter(q=>ub(E,[q.name])),[E,l]),L=F.find(q=>q.id===j),M=b&&!A?a("traditional.model.refreshing"):L?`${L.displayName} (${L.id})`:j||a("traditional.model.selectModel"),U=p.useMemo(()=>F.filter(q=>ub(N,[q.displayName,q.id,q.name,q.vendorName,q.activationState,q.lifecycleStatus])),[N,F]),I=!!(j&&!L&&ub(N,[j])),H=F.filter(q=>q.available).length,K=t==="byteplus"?"BytePlus ModelArk":a("traditional.model.volcengineArk"),Q=MBe(t);return o.jsxs("div",{className:"cw-a2a-space-picker cw-model-picker",children:[o.jsxs("div",{className:"cw-model-picker-stack",children:[o.jsxs("div",{className:"cw-model-picker-field",children:[o.jsx("span",{className:"cw-model-picker-label",children:"API Key"}),o.jsx(Wne,{selectedLabel:P,placeholder:!n,disabled:u,triggerAriaLabel:a("traditional.model.selectApiKey"),menuAriaLabel:a("traditional.model.apiKeyList"),searchAriaLabel:a("traditional.model.searchApiKey"),searchValue:E,searchPlaceholder:a("traditional.model.searchApiKeyName"),onSearchChange:C,empty:R.length===0,emptyLabel:a("traditional.model.noMatchingApiKey"),optionsClassName:"cw-model-key-options",renderOptions:q=>R.map(B=>{const ee=B.id===n;return o.jsx("button",{type:"button",role:"option","aria-selected":ee,className:`cw-a2a-space-option cw-model-key-option ${ee?"is-selected":""}`,title:B.name,onClick:()=>{S(le=>le+1),r(B),q()},children:o.jsx("span",{children:B.name})},B.id)})})]}),o.jsxs("div",{className:"cw-model-picker-field",children:[o.jsx("span",{className:"cw-model-picker-label",children:a("traditional.model.label")}),o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsx(Wne,{selectedLabel:M,placeholder:!j,disabled:b,triggerAriaLabel:a("traditional.model.selectProviderModel",{provider:K}),menuAriaLabel:a("traditional.model.providerModels",{provider:K}),searchAriaLabel:a("traditional.model.search"),searchValue:N,searchPlaceholder:a("traditional.model.searchPlaceholder"),onSearchChange:_,empty:!I&&U.length===0,emptyLabel:a("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:q=>o.jsxs(o.Fragment,{children:[I&&o.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{s(j),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:a("traditional.model.currentConfiguration")}),o.jsx("small",{children:j})]}),o.jsx("span",{className:"cw-model-status is-unknown",children:a("traditional.model.unknownStatus")})]}),U.map(B=>{const ee=B.id===j,le=q7t(B);return!le&&B.activationState!=="Available"?o.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:a("traditional.model.activate",{provider:K,model:B.displayName}),onClick:()=>{window.open(Q,"_blank","noopener,noreferrer"),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:B.displayName}),o.jsxs("small",{children:[B.id,B.vendorName?` · ${B.vendorName}`:""]})]}),o.jsx("span",{className:"cw-model-status is-unavailable",children:a("traditional.model.activateAction")})]},B.id):o.jsxs("button",{type:"button",role:"option","aria-selected":ee,disabled:!le,className:`cw-a2a-space-option cw-model-option ${ee?"is-selected":""}`,title:`${B.displayName} (${B.id})`,onClick:()=>{s(B.id),q()},children:[o.jsxs("span",{className:"cw-model-option-copy",children:[o.jsx("strong",{children:B.displayName}),o.jsxs("small",{children:[B.id,B.vendorName?` · ${B.vendorName}`:""]})]}),o.jsx("span",{className:`cw-model-status ${B.available?"is-available":B.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:a(H7t(B))})]},B.id)})]})}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:a("traditional.model.refresh"),"aria-label":a("traditional.model.refresh"),disabled:b||u,onClick:()=>w(q=>q+1),children:b||u?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]})]})]}),y?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",role:"alert",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:y})]}):b?o.jsxs("span",{className:"cw-help cw-a2a-space-status","aria-live":"polite",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),a("traditional.model.loading")]}):F.length===0?o.jsx("span",{className:"cw-help",children:a("traditional.model.empty")}):o.jsx("span",{className:"cw-help",children:a("traditional.model.loaded",{count:F.length,available:H})})]})}function G7t({value:e,region:t,invalid:n,onChange:i}){const{t:r}=Te("create"),s=t.trim()||nv.region,[a,l]=p.useState([]),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState(0),[g,b]=p.useState(!1),[v,y]=p.useState(""),x=p.useRef(null);p.useEffect(()=>{let _=!1;return u(!0),f(null),k7t({region:s}).then(j=>{_||l(j)}).catch(j=>{_||(l([]),f(j instanceof Error?j.message:r("traditional.resources.loadError")))}).finally(()=>{_||u(!1)}),()=>{_=!0}},[s,h,r]);const O=!e||a.some(_=>_.id===e.trim()),w=a.find(_=>_.id===e.trim()),k=w?TL(w,r("traditional.resources.unnamedAgentCenter")):r(e&&!O?"traditional.resources.selectedAgentCenter":"traditional.resources.selectAgentCenter"),S=c&&a.length===0,E=p.useMemo(()=>a.filter(_=>ub(v,[TL(_,r("traditional.resources.unnamedAgentCenter")),_.id,_.projectName])),[v,a,r]),C=!!(e&&!O&&ub(v,[r("traditional.resources.selectedAgentCenter"),e]));p.useEffect(()=>{if(!g)return;const _=A=>{const F=A.target;F instanceof Node&&x.current&&!x.current.contains(F)&&b(!1)},j=A=>{A.key==="Escape"&&b(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",j)}},[g]);const N=_=>{i(_),b(!1)};return o.jsxs("div",{className:`cw-a2a-space-picker${g?" is-open":""}`,ref:x,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":g,"aria-label":r("traditional.resources.selectAgentKitCenter"),onClick:()=>{y(""),b(_=>!_)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:k}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),g&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:v,autoFocus:!0,autoComplete:"off","aria-label":r("traditional.resources.searchAgentKitCenter"),placeholder:r("traditional.resources.searchNameOrId"),onChange:_=>y(_.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":r("traditional.resources.agentKitCenter"),children:[C&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>N(e),children:r("traditional.resources.selectedAgentCenter")}),E.map(_=>{const j=TL(_,r("traditional.resources.unnamedAgentCenter")),A=_.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:`${j} (${_.id})`,onClick:()=>N(_.id),children:j},_.id)}),!C&&E.length===0&&o.jsx("div",{className:"cw-picker-empty",children:r("traditional.resources.noMatchingAgentCenters")})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:r("traditional.resources.refreshAgentCenters"),"aria-label":r("traditional.resources.refreshAgentCenters"),disabled:c,onClick:()=>m(_=>_+1),children:c?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:d})]}):c?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),r("traditional.resources.loadingAgentCenters")]}):a.length===0?o.jsx("span",{className:"cw-help",children:r("traditional.resources.noAgentCenters")}):o.jsx("span",{className:"cw-help",children:r("traditional.resources.agentCentersLoaded",{count:a.length})})]})}function nIe({value:e,items:t,loading:n,error:i,pickerClassName:r,selectLabel:s,searchLabel:a,listLabel:l,placeholder:c,emptyMessage:u,loadedMessage:d,refreshLabel:f,noMatchesMessage:h,getLabel:m,getSearchFields:g,getKey:b,getOptionIds:v,makeUnknownItem:y,onChange:x,onRefresh:O}){const{t:w}=Te("create"),[k,S]=p.useState(!1),[E,C]=p.useState(""),N=p.useRef(null),_=!e||t.some(L=>L.id===e.trim()),j=t.find(L=>L.id===e.trim()),A=j?m(j):e&&!_?e:c,F=n&&t.length===0,T=p.useMemo(()=>t.filter(L=>ub(E,g(L))),[g,t,E]),P=!!(e&&!_&&ub(E,[e]));p.useEffect(()=>{if(!k)return;const L=U=>{const I=U.target;I instanceof Node&&N.current&&!N.current.contains(I)&&S(!1)},M=U=>{U.key==="Escape"&&S(!1)};return window.addEventListener("pointerdown",L),window.addEventListener("keydown",M),()=>{window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",M)}},[k]);const R=L=>{x(L),S(!1)};return n&&t.length===0?o.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}),w("common.loading")]}):o.jsxs("div",{className:`cw-a2a-space-picker ${r}${k?" is-open":""}`,ref:N,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:F,"aria-haspopup":"listbox","aria-expanded":k,"aria-label":s,onClick:()=>{C(""),S(L=>!L)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:A}),o.jsx(pz,{className:"cw-a2a-space-trigger-icon"})]}),k&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:E,autoFocus:!0,autoComplete:"off","aria-label":a,placeholder:w("traditional.resources.searchNameOrId"),onChange:L=>C(L.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":l,children:[P&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>R(y(e)),children:e}),T.map(L=>{const M=m(L),U=L.id===e,I=v(L).filter(Boolean).join(" / ");return o.jsx("button",{type:"button",role:"option","aria-selected":U,className:`cw-a2a-space-option ${U?"is-selected":""}`,title:I?`${M} (${I})`:M,onClick:()=>R(L),children:M},b(L))}),!P&&T.length===0&&o.jsx("div",{className:"cw-picker-empty",children:h})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:f,"aria-label":f,disabled:n,onClick:O,children:n?o.jsx(fi,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(mz,{className:"cw-i cw-i-sm"})})]}),i?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i})]}):t.length===0?o.jsx("span",{className:"cw-help",children:u}):o.jsx("span",{className:"cw-help",children:d(t.length)})]})}function K7t({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return a(!0),c(null),C7t().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||a(!1)}),()=>{f=!0}},[u,n]),o.jsx(nIe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-kb-picker",selectLabel:n("traditional.resources.selectKnowledgeBase"),searchLabel:n("traditional.resources.searchKnowledgeBase"),listLabel:n("traditional.resources.knowledgeBaseList"),placeholder:n("traditional.resources.knowledgeBasePlaceholder"),emptyMessage:n("traditional.resources.noKnowledgeBases"),loadedMessage:f=>n("traditional.resources.knowledgeBasesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshKnowledgeBases"),noMatchesMessage:n("traditional.resources.noMatchingKnowledgeBases"),getLabel:f=>Hne(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Hne(f,n("traditional.resources.unnamedKnowledgeBase")),f.id,f.description,f.projectName,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId,f.sourceLabel],getKey:f=>f.id,getOptionIds:f=>[f.id,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),onChange:t,onRefresh:()=>d(f=>f+1)})}function X7t({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,a]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return a(!0),c(null),A7t().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||a(!1)}),()=>{f=!0}},[u,n]),o.jsx(nIe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-memory-picker",selectLabel:n("traditional.resources.selectMemory"),searchLabel:n("traditional.resources.searchMemory"),listLabel:n("traditional.resources.memoryList"),placeholder:n("traditional.resources.memoryPlaceholder"),emptyMessage:n("traditional.resources.noMemories"),loadedMessage:f=>n("traditional.resources.memoriesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshMemories"),noMatchesMessage:n("traditional.resources.noMatchingMemories"),getLabel:f=>qne(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[qne(f,n("traditional.resources.unnamedMemory")),f.id,f.description,f.projectName,f.region,f.resourceId,...f.memoryTypes??[]],getKey:f=>`${f.projectName}:${f.region}:${f.id}`,getOptionIds:f=>[f.id,f.resourceId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",resourceId:"",memoryTypes:[]}),onChange:t,onRefresh:()=>d(f=>f+1)})}function Y7t({tools:e,conflict:t,showConflict:n,onChange:i}){const{t:r}=Te("create"),s=p.useId(),a=n?t:null,l=(d,f)=>i(e.map((h,m)=>m===d?{...h,...f}:h)),c=d=>i(e.filter((f,h)=>h!==d)),u=()=>i([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(Ru,{initial:!1,children:e.map((d,f)=>o.jsxs(pr.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${d.transport==="http"?"is-on":""}`,onClick:()=>l(f,{transport:"http"}),"aria-pressed":d.transport==="http",children:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${d.transport==="stdio"?"is-on":""}`,onClick:()=>l(f,{transport:"stdio"}),"aria-pressed":d.transport==="stdio",children:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>c(f),"aria-label":r("traditional.mcp.removeTool"),children:o.jsx(pm,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input","data-validation-field":"mcp-name","aria-invalid":a==="duplicateName","aria-describedby":a==="duplicateName"?s:void 0,value:d.name,placeholder:r("traditional.mcp.namePlaceholder"),onChange:h=>l(f,{name:h.target.value})}),d.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input","data-validation-field":"mcp-url","aria-invalid":a==="duplicateUrl","aria-describedby":a==="duplicateUrl"?s:void 0,value:d.url??"",placeholder:r("traditional.mcp.urlPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?n7t(m,h.target.value):m))}),t7t(d.url??"")&&o.jsxs("p",{className:"cw-mcp-warning",children:[o.jsx(Wd,{"aria-hidden":"true"}),o.jsx("span",{children:r("traditional.mcp.pathWarning")})]}),o.jsx("input",{className:"cw-input","aria-invalid":KRe(d),value:ZFt(d),placeholder:d.credentialConfigured&&!d.authToken?r("traditional.mcp.configuredPlaceholder"):r("traditional.mcp.tokenPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?JFt(m,h.target.value):m))}),d.credentialUpdate==="pending"&&o.jsxs("div",{className:"cw-mcp-auth-state is-warning",role:"alert",children:[o.jsx("span",{children:r("traditional.mcp.changedUrlWarning")}),o.jsxs("div",{className:"cw-mcp-auth-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?i7t(h):h)),children:r("traditional.mcp.reuseCredential")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?I8(h):h)),children:r("traditional.mcp.replaceCredential")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?r7t(h):h)),children:r("traditional.mcp.noAuth")})]})]}),d.credentialUpdate==="reuse"&&o.jsxs("div",{className:"cw-mcp-auth-state",role:"status",children:[o.jsx("span",{children:r("traditional.mcp.reuseHint")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?I8(h):h)),children:r("traditional.mcp.changeToReplace")})]}),d.credentialConfigured&&!d.authToken&&!d.credentialUpdate&&o.jsxs("div",{className:"cw-mcp-auth-state",role:"status",children:[o.jsx("span",{children:r("traditional.mcp.credentialConfigured")}),o.jsx("button",{type:"button",onClick:()=>i(e.map((h,m)=>m===f?e7t(h):h)),children:r("traditional.mcp.removeCredential")})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:d.command??"",placeholder:r("traditional.mcp.commandPlaceholder"),onChange:h=>l(f,{command:h.target.value})}),o.jsx("input",{className:"cw-input",value:(d.args??[]).join(" "),placeholder:r("traditional.mcp.argsPlaceholder"),onChange:h=>l(f,{args:h.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:r("traditional.mcp.stdioHint")})]})]},f))})}),a&&o.jsx("p",{className:"cw-error-text",id:s,role:"alert",children:r(a==="duplicateName"?"traditional.validation.mcpDuplicateName":"traditional.validation.mcpDuplicateUrl")}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:u,children:[o.jsx(Fo,{className:"cw-i"}),r("traditional.mcp.addTool")]})]})}function k2({checked:e,onChange:t,title:n,desc:i,showDescription:r=!1}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),r&&o.jsx("span",{className:"cw-toggle-help",children:i})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(pr.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Z7t(e,t){var i;let n=e;for(const r of t)if(n=(i=n.subAgents)==null?void 0:i[r],!n)return!1;return!0}function E2(e,t){let n=e;for(const i of t)n=n.subAgents[i];return n}function XE(e,t,n){if(t.length===0)return n(e);const[i,...r]=t,s=e.subAgents.slice();return s[i]=XE(s[i],r,n),{...e,subAgents:s}}function J7t(e,t,n="volcengine"){return XE(e,t,i=>({...i,subAgents:[...i.subAgents,oc(n)]}))}function eBt(e,t,n,i="volcengine"){return XE(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,oc(i)),{...r,subAgents:s}})}function tBt(e,t){if(t.length===0)return e;const n=t.slice(0,-1),i=t[t.length-1];return XE(e,n,r=>({...r,subAgents:r.subAgents.filter((s,a)=>a!==i)}))}const M8=e=>!GI(e.agentType),Gne=3;function nBt(e,t,n=!1){var r;if(GI(e.agentType))return n?"remoteRoot":(r=e.a2aRegistry)!=null&&r.registrySpaceId.trim()?null:"missingRegistry";const i=WE(e.name,s=>`name.${s}`);return i||(t.has(e.name)?"duplicateName":e.description.trim().length===0?"missingDescription":(e.mcpTools??[]).some(KRe)?"mcpAuthRequired":RRe(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function iIe(e,t,n=[]){const i=[];if(n.length===0){const a=WRe(e);a&&i.push({path:n,name:e.name.trim(),agentType:e.agentType,problem:a==="duplicateName"?"mcpDuplicateName":"mcpDuplicateUrl"})}const r=GI(e.agentType),s=nBt(e,t,n.length===0);return s&&i.push({path:n,name:r?"":e.name.trim(),agentType:e.agentType,problem:s}),M8(e)&&e.subAgents.forEach((a,l)=>i.push(...iIe(a,t,[...n,l]))),i}function iBt(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function rIe(e){return 1+e.subAgents.reduce((t,n)=>t+rIe(n),0)}function L8(e,t=!1){const n=KE(e),i=aN(n.draft).includes("mcp_resilience"),r=[],s={...n.envValues},a=n.draft.cloudProvider??"volcengine",l=Ust(n.draft).map(mA);let c=!1,u="";for(const h of kRe(n.draft,xl(a))){const m=[{key:h.apiKeyKey,required:!0,comment:h.label}];h.providerKey&&(m.push({key:h.providerKey,required:!0}),s[h.providerKey]=h.provider),h.apiBaseKey&&(m.push({key:h.apiBaseKey,required:!0}),s[h.apiBaseKey]=h.apiBase),r.push({env:m})}const d=h=>{var m,g,b,v;h.agentType==="llm"&&Im(h,a)==="ark"&&(c=!0,u||(u=(h.modelName??"").trim()));for(const y of h.builtinTools??[]){const x=Bx.find(O=>O.id===y);x&&r.push({env:cy(x.env,a)})}for(const y of h.mcpTools??[])y.authTokenEnv&&r.push({env:[{key:y.authTokenEnv,required:!1,comment:`${y.name.trim()||"MCP"} Bearer Token`,secret:!0,readOnly:i,serverManaged:i,hidden:i}]});if((m=h.a2aRegistry)!=null&&m.enabled&&(r.push({env:cy(gOe,a)}),Object.assign(s,tIe(h.a2aRegistry,{includeDefaults:!0},a))),h.memory.shortTerm&&r.push({env:cy(((g=iv.find(y=>y.id===(h.shortTermBackend??"local")))==null?void 0:g.env)??[],a)}),h.memory.longTerm&&r.push({env:cy(((b=v6.find(y=>y.id===(h.longTermBackend??"local")))==null?void 0:b.env)??[],a)}),h.knowledgebase&&r.push({env:cy(((v=x6.find(y=>y.id===(h.knowledgebaseBackend??nm)))==null?void 0:v.env)??[],a)}),h.tracing)for(const y of h.tracingExporters??[]){const x=Rst.find(O=>O.id===y);x&&r.push({env:x.env,enableFlag:x.enableFlag})}h.subAgents.forEach(d)};if(d(n.draft),c){r.push({env:[{key:"MODEL_AGENT_PROVIDER",required:!0},{key:"MODEL_AGENT_API_BASE",required:!0},{key:"MODEL_AGENT_API_KEY",required:!0,comment:"Ark API Key",placeholder:$t("helpers.deploymentEnv.selectedApiKeyPlaceholder"),secret:!0,readOnly:!0,serverManaged:!0,requiredBy:l}]}),s.MODEL_AGENT_PROVIDER="openai",s.MODEL_AGENT_API_BASE=xl(a);const h=u||wh(a);s.MODEL_AGENT_NAME=h,s.MODEL_NAME=h}if(i){if(t){r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:$t("helpers.deploymentEnv.mcpInjectedComment"),placeholder:$t("helpers.deploymentEnv.restoredPlaceholder"),help:$t("helpers.deploymentEnv.restoredHelp"),readOnly:!0,serverManaged:!0,hidden:!0,requiredBy:[mA("mcp_resilience")]}]});const g=j8(r);return{specs:g.specs,fixedValues:{...g.fixedValues,...s}}}const h=d7t(n.draft),m=h.ok?void 0:h.message;r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:$t("helpers.deploymentEnv.mcpInjectedComment"),placeholder:$t(t?"helpers.deploymentEnv.restoredPlaceholder":"helpers.deploymentEnv.generatedMcpPlaceholder"),help:$t("helpers.deploymentEnv.mergedMcpHelp"),secret:!0,readOnly:!0,serverManaged:h.ok,hidden:!0,requiredBy:[mA("mcp_resilience")],missingError:m}]})}const f=j8(r);return{specs:f.specs,fixedValues:{...f.fixedValues,...s}}}function sIe(e,t){var i;if(e.id==="baseline")return t("traditional.debug.baseline");const n=(i=/^variant-(\d+)$/.exec(e.id))==null?void 0:i[1];return n?t("traditional.debug.comparison",{count:Number(n)}):e.name}function rBt(e,t){const n=i=>(i??"").trim().replace(/\/+$/,"");return n(e)===n(t)}function sBt(e,t,n){const i=(e??"").trim();return!i||i===wh(t)?!0:i===wh(n)?!1:n==="byteplus"&&i.includes("doubao-")}function Ig(e,t){const n=e.cloudProvider??"volcengine",i=Im(e,n),r=e.subAgents.map(u=>Ig(u,t)),s=i==="ark"&&sBt(e.modelName,n,t)?wh(t):e.modelName,l=rBt(e.modelApiBase,xl(n))||t==="byteplus"&&(e.modelApiBase??"").includes("volces.com")?xl(t):e.modelApiBase;return e.cloudProvider!==t||s!==e.modelName||l!==e.modelApiBase||r.some((u,d)=>u!==e.subAgents[d])?{...e,cloudProvider:t,modelName:s,modelApiBase:l,subAgents:r}:e}function aBt(e,t){var l;const n=Ig(e,t),i=ERe(n,xl(t)),r=new Set(i.map(({key:c})=>c)),s=((l=n.deployment)==null?void 0:l.envValues)??{},a=Object.fromEntries(Object.entries(s).filter(([c,u])=>r.has(c)&&!!u.trim()));return Object.keys(a).length===0?{draft:n,customModelSecretValues:a}:{draft:{...n,deployment:{...n.deployment??{feishuEnabled:!1},envValues:Object.fromEntries(Object.entries(s).filter(([c])=>!r.has(c)))}},customModelSecretValues:a}}function Kw(e){var i,r,s;const t=KE(e).draft;return{...ARe(t,t.cloudProvider??"volcengine"),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),modelApiKeyId:((r=e.deployment)==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:((s=e.deployment)==null?void 0:s.modelApiKeyName)??""}}}function $8(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const i of e.subAgents){const r=$8(i);if(r)return r}return""}function aIe(e,t={}){var r,s,a,l;const n=L8(e),i={...((r=e.deployment)==null?void 0:r.envValues)??{},...t,...n.fixedValues};return{...Kw(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),modelApiKeyId:((a=e.deployment)==null?void 0:a.modelApiKeyId)??"",modelApiKeyName:((l=e.deployment)==null?void 0:l.modelApiKeyName)??"",envValues:Object.fromEntries(cz(n.specs,i).map(({key:c,value:u})=>[c,u]))}}}function oBt(e,t={}){return JSON.stringify(aIe(e,t))}function fj(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction})}function By(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim()})}function lBt({enabled:e,disabledReason:t,variants:n,draftSnapshot:i,input:r,onInput:s,onSend:a,onStartVariant:l,onUseVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:m,onOpenTrace:g}){const{t:b}=Te("create"),v=n.filter(O=>O.phase!=="ready"?!1:O.runtimeSnapshot===fj(i,O)),y=n.some(O=>O.phase==="sending"),x=v.length>0&&!y;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":b("traditional.debug.ariaLabel"),children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((O,w)=>{const k=sIe(O,b),S=O.modelName.trim(),E=O.description.trim(),C=O.instruction.trim(),N=By(O),_=!!(S&&E&&C&&n.findIndex(I=>By(I)===N)!==w),j=!S||!E||!C||_,A=!!(O.runtimeSnapshot&&O.runtimeSnapshot!==fj(i,O)),F=O.phase==="starting",T=O.phase==="ready"&&!A,P=F||O.phase==="sending",R=T&&O.phase!=="sending"&&O.messages.some(I=>I.role==="assistant"),L=P||O.configOpen||j,M=S?E?C?_?b("traditional.debug.duplicateConfiguration"):"":b("traditional.debug.enterPrompt"):b("traditional.debug.enterDescription"):b("traditional.debug.selectModel"),U=F?b("traditional.debug.starting"):A?b("traditional.debug.applyAndRestart"):T||O.phase==="error"?b("traditional.debug.restart"):b("traditional.debug.start");return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${O.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":O.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:k}),o.jsx("span",{children:O.modelName||b("traditional.debug.defaultModel")})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:O.configOpen||P,onClick:()=>f(O.id),children:b("traditional.debug.testConfiguration")}),O.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),disabled:O.configOpen||P,onClick:()=>d(O.id),children:o.jsx(zne,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:O.error?o.jsx(Lb,{message:O.error,className:"cw-debug-error-detail",defaultExpanded:!0}):F?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(fi,{className:"cw-i cw-spin"}),o.jsx("span",{children:b("traditional.debug.creatingEnvironment")})]}):A?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:b("traditional.debug.configurationChanged")})}):O.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:T?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:b("traditional.debug.ready")}),o.jsx("span",{className:"cw-ab-launch-hint",children:b("traditional.debug.readyHint")})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:M||b("traditional.debug.startHint")})}):O.messages.map((I,H)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${I.role}`,children:o.jsx("div",{className:"cw-debug-content",children:I.role==="user"?I.content:I.error?o.jsx(Lb,{message:I.error,className:"cw-debug-msg-error",defaultExpanded:!0}):I.blocks&&I.blocks.length>0?o.jsx(TE,{blocks:I.blocks,onAction:()=>{}}):I.content?I.content:H===O.messages.length-1&&O.phase==="sending"?o.jsx(PCe,{}):null})},H))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!R,title:R?b("traditional.debug.viewTraceNamed",{name:k}):b("traditional.debug.traceUnavailable"),onClick:()=>g(O.id),children:b("traditional.debug.trace")}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:L,title:M||void 0,onClick:()=>l(O.id),children:[T||A||O.phase==="error"?o.jsx(R7e,{className:"cw-i"}):o.jsx(F7t,{className:"cw-i cw-debug-run-icon"}),U]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:P||!S,onClick:()=>c(O.id),children:b("traditional.debug.useConfiguration")})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!O.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:b("traditional.debug.testConfiguration")}),o.jsx("span",{children:k})]}),o.jsxs("div",{className:"cw-ab-config-head-actions",children:[O.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),title:b("traditional.debug.deleteVariantGroup"),disabled:P,onClick:()=>d(O.id),children:o.jsx(zne,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:`cw-ab-config-done-wrap${M?" is-disabled":""}`,tabIndex:M?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!O.configOpen||j,onClick:()=>h(O.id),children:O.id==="baseline"?b("traditional.debug.finishConfiguration"):b("traditional.debug.finishAndStart")}),M&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:M})]})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:b("traditional.model.label")}),o.jsx("input",{value:O.modelName,placeholder:b("traditional.debug.currentAgentModel"),disabled:!O.configOpen,onChange:I=>m(O.id,"modelName",I.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:b("common.description")}),o.jsx("textarea",{rows:2,value:O.description,disabled:!O.configOpen,onChange:I=>m(O.id,"description",I.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:b("traditional.basic.systemPrompt")}),o.jsx("textarea",{rows:5,value:O.instruction,disabled:!O.configOpen,onChange:I=>m(O.id,"instruction",I.target.value)})]}),o.jsx("p",{children:b("traditional.debug.configurationHint")})]})]})]})},O.id)})}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsxs("div",{className:"cw-ab-composer",children:[o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:r,placeholder:b(x?"traditional.debug.messagePlaceholder":"traditional.debug.startOneFirst"),disabled:!x,onChange:O=>s(O.target.value),onKeyDown:O=>{VI(O.nativeEvent)||O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:b("common.send"),disabled:!x||!r.trim(),onClick:a,children:y?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(a7e,{className:"cw-i"})})]}),e&&n.length<3&&o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[o.jsx(Fo,{className:"cw-i"}),b("traditional.debug.addVariant")]})]})]})}function cBt({profile:e,optimizations:t,unavailableMessage:n,onProfileChange:i,onOptimizationChange:r}){const{t:s}=Te("create");return o.jsx("section",{className:"cw-optimize-workspace","aria-label":s("traditional.optimization.ariaLabel"),children:o.jsxs("div",{className:"cw-optimize-panel",children:[n?o.jsxs("div",{className:"cw-banner",role:"alert",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:n})]}):null,o.jsxs("fieldset",{className:"cw-optimize-section",children:[o.jsx("legend",{children:s("traditional.optimization.scenario")}),o.jsx(Wg,{className:"cw-optimize-profile-options","aria-label":s("traditional.optimization.scenario"),value:e,onChange:i,children:OB.map(a=>o.jsx("div",{className:`cw-optimize-profile-option${e===a.id?" is-on":""}`,children:o.jsx(Wg.Item,{value:a.id,block:!0,className:"cw-optimize-profile-control",children:o.jsxs("span",{className:"cw-optimize-profile-copy",children:[o.jsx("strong",{children:s(`traditional.optimization.profiles.${a.id}.label`)}),o.jsx("small",{children:s(`traditional.optimization.profiles.${a.id}.description`)})]})})},a.id))})]}),o.jsxs("fieldset",{className:"cw-optimize-section",children:[o.jsx("legend",{children:s("traditional.optimization.components")}),o.jsx("div",{className:"cw-optimize-option-list",children:Ist.map(a=>o.jsxs("section",{className:"cw-optimize-option-group","aria-labelledby":`cw-optimize-group-${a.id}`,children:[o.jsx("h3",{id:`cw-optimize-group-${a.id}`,className:"cw-optimize-option-group-title",children:s(`traditional.optimization.groups.${a.id}`)}),o.jsx("div",{className:"cw-optimize-option-group-items",children:a.componentIds.map(l=>{const c=wB.find(d=>d.id===l);if(!c)return null;const u=t.includes(c.id);return o.jsx(fz,{checked:u,onCheckedChange:d=>{const f=!!d;f!==u&&r(c.id,f)},label:o.jsxs("span",{className:"cw-optimize-option-copy",children:[o.jsx("strong",{children:s(`traditional.optimization.options.${c.id}.label`)}),o.jsx("small",{children:s(`traditional.optimization.options.${c.id}.description`)})]}),className:"cw-optimize-option"},c.id)})})]},a.id))})]})]})})}const C2=[{id:"build",label:"traditional.workspace.modes.build"},{id:"validate",label:"traditional.workspace.modes.validate"},{id:"optimize",label:"traditional.workspace.modes.optimize"},{id:"environment",label:"traditional.workspace.modes.environment"},{id:"publish",label:"traditional.workspace.modes.publish"}],uBt={build:"traditional.workspace.titles.build",validate:"traditional.workspace.titles.validate",optimize:"traditional.workspace.titles.optimize",environment:"traditional.workspace.titles.environment",publish:"traditional.workspace.titles.publish"};function dBt({mode:e}){const{t}=Te("create");return o.jsx("header",{className:"cw-workspace-header",children:o.jsx("h1",{children:t(uBt[e])})})}function fBt({mode:e,busy:t,onChange:n,assistant:i,accessory:r}){const{t:s}=Te("create"),a=C2.findIndex(u=>u.id===e),l=C2[a-1],c=C2[a+1];return o.jsxs("footer",{className:"cw-workspace-footer",children:[r?o.jsx("div",{className:"cw-workspace-footer-accessory",children:r}):null,o.jsxs("div",{className:`cw-workspace-nav-actions${i?" has-assistant":""}`,children:[o.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!l||t,onClick:()=>l&&n(l.id),children:s("common.previous")}),o.jsx("span",{"aria-hidden":"true"}),i?o.jsx("div",{className:"cw-workspace-ai-slot",children:i}):null,e==="publish"?o.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):o.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!c||t,onClick:()=>c&&n(c.id),children:s("common.next")})]}),o.jsx("nav",{className:"cw-workspace-progress","aria-label":s("traditional.workspace.progress"),children:C2.map((u,d)=>{const f=u.id===e;return o.jsx("button",{type:"button",className:`${f?"is-active":""}${dn(u.id),children:o.jsx("span",{"aria-hidden":"true"})},u.id)})})]})}function hBt({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:i,features:r,onDeploymentTaskChange:s,createMode:a="custom",freshCreationSurface:l="traditional",workspaceDraftId:c,deploymentTarget:u,cloudProvider:d="volcengine",initialDeployRegion:f=Ji(d),onDeploymentComplete:h,onDeploymentStarted:m,onDraftChange:g,onDiscard:b}){var ji,nd,vc,du,us,Tl,xc,Sr,Qn,za,rf,Al,be,Ye,Ct,_n,Dt,fn,On;const{t:v}=Te("create"),y=a==="custom"&&l==="vulcan",x=y&&!i,[O]=p.useState(()=>{const Y=i??oc(d),we=x?{...Y,name:Y.name.trim()?Y.name:"assistant",dynamicAgentDelegation:!0}:Y;return aBt(we,d)}),[w,k]=p.useState(O.draft),S=y,[E,C]=p.useState(O.customModelSecretValues),N=((ji=w.deployment)==null?void 0:ji.runtimeName)??"",_=u?u.name:D4t(w.name,N,(nd=w.deployment)==null?void 0:nd.runtimeNameCustomized),j=E;p.useEffect(()=>{k(Y=>Ig(Y,d))},[d]);const[A,F]=p.useState(""),[T,P]=p.useState(!1),[R,L]=p.useState(!1),[M,U]=p.useState(!1),[I,H]=p.useState(null),K=A.trim(),Q=K.length>0&&K.length{se.current=g},[g]),p.useEffect(()=>{var Y;ee!==B.current&&(B.current=ee,(Y=se.current)==null||Y.call(se,Ig(w,d),le))},[d,w,le,ee]);const[re,ge]=p.useState("build"),[W,X]=p.useState(!1),[ae,ue]=p.useState(()=>new Set),[Oe,ke]=p.useState(0),[st,Le]=p.useState(null),[Me,Ie]=p.useState(!1),[qe,Ae]=p.useState((u==null?void 0:u.region)??f),ze=(r==null?void 0:r.generatedAgentTestRun)===!0,Ee=(r==null?void 0:r.generatedAgentTestRunDisabledReason)||v("traditional.debug.unavailable"),[De,J]=p.useState(()=>{const Y=Ig(i??oc(d),d);return[{id:"baseline",name:v("traditional.debug.baseline"),modelName:$8(Y),description:Y.description,instruction:Y.instruction,configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]}),[he,_e]=p.useState("baseline"),Ze=p.useRef(1),at=p.useRef(!1),wt=p.useRef(new Map),[Se,ve]=p.useState(0),[He,Je]=p.useState(""),[Ce,Wt]=p.useState(null),[ln,cn]=p.useState(!1),[Ot,jt]=p.useState(!1),ot=p.useRef(null),[gt,Pe]=p.useState(""),[Et,bt]=p.useState(!1),[Mt,$e]=p.useState(null),[ye,Ue]=p.useState(""),[Ke,ft]=p.useState(!1),[ut,Gt]=p.useState(!1),[Rt,zt]=p.useState([]),Z=p.useRef(null),Bt=p.useRef({});async function Qe(){const Y=new Set([...wt.current.values()].map(({run:Ge})=>Ge.runId)),we=hz().filter(Ge=>!Y.has(Ge));we.length&&await Promise.all(we.map(async Ge=>{try{await ey(Ge),fw(Ge)}catch(_t){console.warn("Failed to clean up stale debug run",_t)}}))}p.useEffect(()=>(Qe(),()=>{for(const{run:Y}of wt.current.values())ey(Y.runId).then(()=>fw(Y.runId)).catch(we=>console.warn("Failed to clean up debug run",we));wt.current.clear()}),[]),p.useEffect(()=>()=>{var Y;(Y=ot.current)==null||Y.call(ot,!1),ot.current=null},[]);const tt=p.useRef(null);tt.current||(tt.current=({meta:Y,children:we})=>o.jsxs("section",{ref:Ge=>{Bt.current[Y.id]=Ge},id:`cw-sec-${Y.id}`,"data-step-id":Y.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsx("h2",{className:"cw-sec-title",children:v(Y.label)})}),o.jsx("div",{className:"cw-sec-body",children:we})]}));const ht=Z7t(w,Rt)?Rt:[],pe=E2(w,ht),We=ht.length===0,vt=ht.join(".")||"root",vn=()=>{ue(Y=>Y.has(vt)?Y:new Set(Y).add(vt))},Ki=`cw-a2a-registry-advanced-${ht.join("-")||"root"}`,Fe=Y=>k(we=>XE(we,ht,Ge=>({...Ge,...Y}))),Pt=Y=>k(we=>{var Ge;return{...we,deployment:{...we.deployment??{feishuEnabled:!1},envValues:{...((Ge=we.deployment)==null?void 0:Ge.envValues)??{},...Y}}}}),pn=(Y,we)=>Pt({[Y]:we}),Jt=Y=>Fe({a2aRegistry:{...pe.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Y}}),en=(Y,we)=>{if(!(Y in Vne))return;const Ge=Vne[Y];Jt({[Ge]:we}),pn(Y,we)},Un=Y=>{if(!(We&&Y==="a2a")){if(Y==="a2a"){Fe({agentType:Y,a2aRegistry:{...pe.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}Fe({agentType:Y,a2aRegistry:pe.a2aRegistry?{...pe.a2aRegistry,enabled:!1}:void 0})}},wn=(Y,we)=>{k(Y),we&&zt(we)},oi=async()=>{const Y=A.trim();if(!(!Y||T)&&!(Y.length{const we=E2(w,Y);if(!M8(we)||Y.length>=Gne)return;const Ge=J7t(w,Y,d),_t=E2(Ge,Y).subAgents.length-1;wn(Ge,[...Y,_t])},mi=(Y,we)=>{const Ge=E2(w,Y);if(!M8(Ge)||Y.length>=Gne)return;const _t=Math.max(0,Math.min(we,Ge.subAgents.length)),un=eBt(w,Y,_t,d);wn(un,[...Y,_t])},bn=()=>{window.confirm(v("traditional.actions.clearRootConfirmation"))&&(k(oc(d)),zt([]),X(!1))},qi=Y=>{if(Y.length===0){bn();return}wn(tBt(w,Y),Y.slice(0,-1))},ri=pe.builtinTools??[],zi=p.useMemo(()=>bOe(d),[d]),as=p.useMemo(()=>new Set(zi.map(Y=>Y.id)),[zi]),Lr=pe.mcpTools??[],_r=We?WRe(w):null,xs=pe.selectedSkills??[],os=Y=>{as.has(Y)&&Fe({builtinTools:ri.includes(Y)?ri.filter(we=>we!==Y):[...ri,Y]})},ia=RRe(pe.agentType),Nr=GI(pe.agentType),As=VR(d),Vs=Im(pe,d),Yr=Y=>{var Ge;const we=Y==="custom"&&Vs==="ark"?"":Y==="ark"&&!((Ge=pe.modelName)!=null&&Ge.trim())?wh(d):pe.modelName;Fe({modelSource:Y,modelName:we})},ra=p.useMemo(()=>x$t(w),[w]),sa=Nr?null:WE(pe.name,Y=>v(`validation.agentName.${Y}`))??(ra.has(pe.name)?v("traditional.validation.duplicateName"):null),ls=sa!==null,va=W||ae.has(vt),aa=!Nr&&pe.description.trim().length===0,ws=pe.instruction.trim().length===0,Ua=Nr&&!((vc=pe.a2aRegistry)!=null&&vc.registrySpaceId.trim()),oa=(Y,we=W)=>we&&Y?`is-error cw-error-shake-${Oe%2}`:"",Qa=p.useMemo(()=>iIe(w,ra),[w,ra]),Jn=Qa.length===0,Ni=p.useMemo(()=>Ig(w,d),[d,w]),Eo=Bst(w),xa=aN(w),Xi=Pst(d),Co=p.useMemo(()=>oBt(Ni,j),[Ni,j]),xe=De.find(Y=>Y.id===he)??De[0],Xe=p.useMemo(()=>L8(Ni,(u==null?void 0:u.editMode)==="source-preserving"),[u==null?void 0:u.editMode,Ni]),Yt=p.useMemo(()=>ERe(Ni,xl(d)),[d,Ni]),tn=Yt.find(Y=>Y.label===$t("helpers.customModel.apiKeyLabel",{name:pe.name.trim()||$t("helpers.customModel.fallbackName")})),In=p.useCallback(Y=>{k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},modelApiKeyId:Y.id,modelApiKeyName:Y.name}}))},[]);function mr(Y){const we=Y.problem==="mcpDuplicateName"||Y.problem==="mcpDuplicateUrl"?"tools":Y.problem==="missingSubagent"?"type":"basic",Ge=Bt.current[we];Ge==null||Ge.scrollIntoView({behavior:"smooth",block:"start"});const _t=Y.problem==="mcpDuplicateName"?"mcp-name":Y.problem==="mcpDuplicateUrl"?"mcp-url":Y.problem==="missingDescription"?"description":Y.problem==="missingPrompt"?"instruction":Y.problem==="missingRegistry"?"a2a-registry":Y.problem==="missingSubagent"||Y.problem==="remoteRoot"?null:"name",un=_t?Ge==null?void 0:Ge.querySelector(`[data-validation-field="${_t}"]`):Ge,Nn=un!=null&&un.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?un:un==null?void 0:un.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Nn==null||Nn.focus({preventScroll:!0})}const jr=()=>Jn?!0:(X(!0),ke(Y=>Y+1),Qa[0]&&(zt(Qa[0].path),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>mr(Qa[0]))})),!1),_s=async()=>{Wt(null);const Y=[...wt.current.values()];wt.current.clear(),ve(0),J(we=>we.map(Ge=>({...Ge,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(Y.map(async({run:we})=>{try{await ey(we.runId),fw(we.runId)}catch(Ge){console.warn("Failed to clean up debug run",Ge)}}))},Si=async Y=>{const we=wt.current.get(Y);if(we){wt.current.delete(Y),ve(wt.current.size);try{await ey(we.run.runId),fw(we.run.runId)}catch(Ge){console.warn("Failed to clean up debug run",Ge)}}},la=Y=>{const we=wt.current.get(Y),Ge=De.find(_t=>_t.id===Y);!we||!Ge||Wt({runId:we.run.runId,sessionId:we.sessionId,variantName:sIe(Ge,v)})},Hs=Y=>{const we=ot.current;ot.current=null,we==null||we(Y)},$r=()=>{Ot||(cn(!1),Hs(!1))},wa=async()=>{if(!Ot){jt(!0);try{await _s(),cn(!1),Hs(!0)}finally{jt(!1)}}},cs=async()=>re!=="validate"||Se===0?!0:ot.current?!1:new Promise(Y=>{ot.current=Y,cn(!0)}),Vi=async Y=>{if(await cs()){if(!jr()){ge("build");return}Y&&_e(Y),ge("environment")}},so=async Y=>{var Ge,_t;if(Pe(""),!jr()){ge("build");return}if((Ge=Ni.harnessSidecar)!=null&&Ge.enabled&&Xi){Pe(Xi),ge("optimize");return}const we=R8(Xe.specs,((_t=Ni.deployment)==null?void 0:_t.envValues)??{});if(we){Pe(`${we.spec.comment||we.spec.key}:${we.error}`),ge("build");return}Ie(!0);try{const un=Y?De.find(Ri=>Ri.id===Y):xe;un&&_e(un.id);const Nn=un?Fst(Ni,un):Ni,Yi=await wO(Kw(Nn));k(Nn),Le(Yi),ge("publish")}catch(un){Pe(un instanceof Error?un.message:String(un))}finally{Ie(!1)}},ao=async()=>{if(await cs()){if(!jr()){ge("build");return}ge("optimize")}},Go=async Y=>{if(!ze||Me||!jr())return;const we=De.find(lt=>lt.id===Y);if(!we||we.phase==="starting"||we.phase==="sending")return;const Ge=we.modelName.trim(),_t=we.description.trim(),un=we.instruction.trim(),Nn=By(we),Yi=De.findIndex(lt=>lt.id===Y),Ri=De.findIndex(lt=>By(lt)===Nn);if(!Ge||!_t||!un||Ri!==Yi)return;const Kn=fj(Co,we);J(lt=>lt.map(Sn=>Sn.id===Y?{...Sn,configOpen:!1,phase:"starting",messages:[],error:null}:Sn)),Je("");let zn=null,ds="unknown";const $n=Y==="baseline"?"baseline":"comparison",ca=y$t({agentId:String(Ni.name||"unknown"),variantType:$n});try{await Si(Y),await Qe();const lt={...Ni,modelName:we.modelName||Ni.modelName,description:we.description,instruction:we.instruction};ds="create_test_run",zn=await oye(aIe(lt,j),u?{runtimeId:u.runtimeId,region:u.region,mcpCredentialReuses:Dne(lt)}:void 0),M7t(zn.runId),ds="create_test_session";const Sn=await lye(zn.runId,"test_user");wt.current.set(Y,{run:zn,sessionId:Sn}),ve(wt.current.size),J(Qt=>Qt.map(si=>si.id===Y?{...si,phase:"ready",runtimeSnapshot:Kn}:si)),ca.succeed({debugRunId:String(zn.runId)})}catch(lt){if(zn)try{await ey(zn.runId),fw(zn.runId)}catch(Sn){console.warn("Failed to clean up debug run",Sn)}J(Sn=>Sn.map(Qt=>Qt.id===Y?{...Qt,phase:"error",runtimeSnapshot:"",error:lt instanceof Error?lt.message:String(lt)}:Qt)),ca.fail({failedPhase:ds,...Wa(lt,{phase:ds})})}},oo=async()=>{const Y=He.trim(),we=De.filter(_t=>_t.phase==="ready"&&_t.runtimeSnapshot===fj(Co,_t)&&wt.current.has(_t.id));if(!Y||we.length===0)return;Je("");const Ge=new Set(we.map(_t=>_t.id));J(_t=>_t.map(un=>Ge.has(un.id)?{...un,phase:"sending",messages:[...un.messages,{role:"user",content:Y},{role:"assistant",content:"",blocks:[]}]}:un)),await Promise.all(we.map(async _t=>{const un=wt.current.get(_t.id);if(un)try{let Nn=I4();for await(const Yi of uye({runId:un.run.runId,userId:"test_user",sessionId:un.sessionId,text:Y})){const Ri=Yi.error||Yi.errorMessage||Yi.error_message;if(Ri||(Nn=Sye(Nn,Yi)),J(Kn=>Kn.map(zn=>{if(zn.id!==_t.id)return zn;const ds=[...zn.messages],$n={...ds[ds.length-1]};return Ri?$n.error=String(Ri):($n.content=Nn.blocks.filter(ca=>ca.kind==="text").map(ca=>ca.text).join(""),$n.blocks=Nn.blocks),ds[ds.length-1]=$n,{...zn,messages:ds}})),Ri)break}}catch(Nn){J(Yi=>Yi.map(Ri=>{if(Ri.id!==_t.id)return Ri;const Kn=[...Ri.messages],zn={...Kn[Kn.length-1]};return zn.error=Nn instanceof Error?Nn.message:String(Nn),Kn[Kn.length-1]=zn,{...Ri,messages:Kn}}))}finally{J(Nn=>Nn.map(Yi=>Yi.id===_t.id?{...Yi,phase:"ready"}:Yi))}}))},ed=()=>{J(Y=>{if(Y.length>=3)return Y;const we=Ze.current++,Ge=`variant-${we}`;return[...Y,{id:Ge,name:v("traditional.debug.comparison",{count:we}),modelName:w.modelName??"",description:w.description,instruction:w.instruction,configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},bc=async Y=>{await Si(Y),J(we=>we.filter(Ge=>Ge.id!==Y)),he===Y&&_e("baseline")},uu=(Y,we)=>J(Ge=>Ge.map(_t=>_t.id===Y?{..._t,...we}:_t)),To=(Y,we)=>{if(we&&Xi){Pe(Xi);return}const Ge=we?[...new Set([...xa,Y])]:xa.filter(un=>un!==Y),_t=Eo==="ops"?"default":Eo;k(un=>({...un,harnessSidecar:Lg(Ge,_t)})),Pe(""),Le(null)},yc=Y=>{const we=SB(Y);if(we.length>0&&Xi){Pe(Xi);return}k(Ge=>({...Ge,harnessSidecar:Lg(we,Y)})),Pe(""),Le(null)},Cl=(Y,we,Ge)=>{Y==="baseline"&&we==="modelName"&&(at.current=!0),uu(Y,{[we]:Ge}),!(he!==Y||Y==="baseline")&&_e("baseline")},td=Y=>{const we=De.find(Kn=>Kn.id===Y);if(!we)return;const Ge=we.modelName.trim(),_t=we.description.trim(),un=we.instruction.trim(),Nn=By(we),Yi=De.findIndex(Kn=>Kn.id===Y),Ri=De.findIndex(Kn=>By(Kn)===Nn);if(!(!Ge||!_t||!un||Ri!==Yi)){if(Y==="baseline"){uu(Y,{configOpen:!1});return}Go(Y)}},Oa=async(Y,we,Ge)=>{var Ri,Kn,zn;const _t=(u==null?void 0:u.editMode)==="source-preserving",un=aN(w).includes("mcp_resilience"),Nn=(Ri=w.deployment)==null?void 0:Ri.network,Yi=Nn&&Nn.mode&&Nn.mode!=="public"?{mode:Nn.mode,vpc_id:Nn.vpcId,subnet_ids:Nn.subnetIds,enable_shared_internet_access:Nn.enableSharedInternetAccess}:void 0;return Ax(Y.name,Y.files,{region:(u==null?void 0:u.region)??qe,projectName:"default",network:Yi},{...Ge,onStage:we,runtimeId:u==null?void 0:u.runtimeId,runtimeName:(Ge==null?void 0:Ge.runtimeName)??_,appName:u==null?void 0:u.appName,editMode:u==null?void 0:u.editMode,draft:u||un?Kw(w):void 0,updateEtag:u==null?void 0:u.etag,baseRuntimeVersion:u==null?void 0:u.currentVersion,envs:_t?[]:Ge==null?void 0:Ge.envs,mcpSecretValues:_t?a7t(w):un?s7t(w):void 0,mcpCredentialReuses:u?Dne(w):void 0,removeRuntimeEnvKeys:u?[...YFt(u.configuredMcpEnvKeys??[],w),...(Kn=w.deployment)!=null&&Kn.feishuEnabled?[]:["FEISHU_APP_ID","FEISHU_APP_SECRET"]]:void 0,description:w.description,harnessSidecar:w.harnessSidecar,environment:(zn=w.cloudEnvironment)!=null&&zn.environmentId?{environmentId:w.cloudEnvironment.environmentId,environmentVersionId:w.cloudEnvironment.environmentVersionId}:void 0})},Wh=()=>{jr()&&(J(Y=>Y.map(we=>we.id==="baseline"&&!wt.current.has(we.id)?{...we,modelName:at.current?we.modelName:$8(Ni),description:Ni.description,instruction:Ni.instruction}:we)),ge("validate"))},Gh=async Y=>{if(Y==="publish"){if(!await cs())return;await so();return}if(Y==="validate"){Wh();return}if(Y==="optimize"){await ao();return}if(Y==="environment"){Vi();return}await cs()&&ge(Y)},ce=Y=>{k(we=>({...we,cloudEnvironment:Y})),Pe(""),Le(null)},li=async Y=>{var $n,ca,lt,Sn,Qt,si,fs,or,hs,wc,Oc,Kh;if(Et||(Ue(""),ft(!1),!jr()))return;const we=qE(_.trim());if(we){Ue(we);return}const Ge={...Ni,memory:{...Ni.memory,shortTerm:Y.sessionBackend!=="local"},shortTermBackend:Y.sessionBackend},_t=L8(Ge,(u==null?void 0:u.editMode)==="source-preserving"),un=($n=Ge.deployment)==null?void 0:$n.network;if((un==null?void 0:un.mode)!==void 0&&un.mode!=="public"&&!((ca=un.vpcId)!=null&&ca.trim())){Ue(v("traditional.deployment.vpcRequired"));return}if(Im(Ge,d)==="ark"&&!((Sn=(lt=Ge.deployment)==null?void 0:lt.modelApiKeyId)!=null&&Sn.trim())){Ue(v("traditional.deployment.apiKeyRequired"));return}const Nn={...((Qt=Ge.deployment)==null?void 0:Qt.envValues)??{},...E,..._t.fixedValues},Yi=Object.keys(Nn).find(Ko=>Ko&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Ko));if(Yi){Ue(v("traditional.deployment.invalidEnvName",{key:Yi}));return}const Ri=(si=Ge.deployment)!=null&&si.feishuEnabled?[..._t.specs,...Mw]:_t.specs,Kn=R9t(Ri,Nn);if(Kn){Ue(v("traditional.deployment.requiredEnv",{name:Kn.comment||Kn.key}));return}const zn=R8(Ri,Nn);if(zn){Ue(`${zn.spec.comment||zn.spec.key}:${zn.error}`);return}bt(!0),$e({level:"info",phase:"prepare",message:v("traditional.deployment.generatingConfiguration"),pct:0});let ds=null;try{if(!u&&!(await sR(_.trim(),qe)).available)throw new Error(v("traditional.deployment.runtimeNameExists"));const Ko=await wO(Kw(Ge));Le(Ko);const fu=crypto.randomUUID(),sf=Date.now();let af="prepare",Sc=v("traditional.deployment.preparing"),Xo=v("traditional.deployment.generatingConfiguration");const lo={id:fu,...c?{draftId:c}:{},agentName:Ge.name,runtimeName:_.trim(),region:qe,startedAt:sf,agentDraft:Ge},ka={...lo,status:"running",phase:af,label:Sc,message:Xo,pct:0};ds=ka,s==null||s(ka),m==null||m(ka);const _l=new Map(Object.entries(Nn).map(([Fr,cf])=>[Fr.trim(),cf]).filter(([Fr,cf])=>Fr&&cf.trim()));for(const Fr of cz(Ri,Nn))_l.set(Fr.key,Fr.value);const of=(or=(fs=Ge.deployment)==null?void 0:fs.modelApiKeyId)==null?void 0:or.trim(),qm=(wc=(hs=Ge.deployment)==null?void 0:hs.modelApiKeyName)==null?void 0:wc.trim();of&&_l.set("MODEL_AGENT_API_KEY_ID",of),qm&&_l.set("MODEL_AGENT_API_KEY_NAME",qm);const lf=await Oa(Ko,Fr=>{af=Fr.phase,Sc=Fr.phase==="build"?v("traditional.deployment.stages.build"):Fr.phase==="deploy"?v("traditional.deployment.stages.deploy"):Fr.phase==="publish"?v("traditional.deployment.stages.publish"):v("traditional.deployment.stages.running"),Xo=Fr.message,$e(Fr),s==null||s({...lo,runtimeName:Fr.runtimeName||lo.runtimeName,status:"running",phase:af,label:Sc,message:Xo,messageCode:Fr.messageCode,pct:Fr.pct,...Fr.buildLog?{buildLog:Fr.buildLog}:{}})},{taskId:fu,runtimeName:_.trim(),sessionStorage:Y.sessionStorage,minInstance:Y.minInstance,maxInstance:Y.maxInstance,authentication:Y.authentication,createEvaluationSets:Y.createEvaluationSets,resources:Y.resources,...(Oc=Ge.deployment)!=null&&Oc.feishuEnabled?{im:{feishu:{enabled:!0}}}:{},envs:[..._l].map(([Fr,cf])=>({key:Fr,value:cf}))});ft(!0),$e({level:"success",phase:"complete",message:v("traditional.deployment.complete"),pct:100}),s==null||s({...lo,runtimeName:lf.runtimeName||lo.runtimeName,runtimeId:lf.runtimeId,region:lf.region||qe,status:"success",phase:"complete",label:v("traditional.deployment.complete"),message:(Kh=lf.warnings)==null?void 0:Kh.join(";"),pct:100}),await(h==null?void 0:h(lf))}catch(Ko){const fu=Ko instanceof Error?Ko.message:String(Ko);Ue(fu),$e(null);const sf={...ds??{id:crypto.randomUUID(),agentName:Ni.name||v("traditional.basic.unnamedAgent"),runtimeName:_.trim(),region:qe,startedAt:Date.now()},status:"error",phase:ds==null?void 0:ds.phase,label:v("traditional.deployment.failed"),message:fu,retry:()=>li(Y)};s==null||s(sf)}finally{bt(!1)}},ci=tt.current,Sa=Y=>$7t.find(we=>we.id===Y),Hn=o.jsx("section",{className:`cw-ai-compose${T?" is-generating":""}${R?" is-success":""}`,"aria-label":v("traditional.ai.ariaLabel"),children:o.jsx(Ru,{initial:!1,mode:"wait",children:R?o.jsxs(pr.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:v("traditional.ai.success")}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>L(!1),children:v("traditional.ai.regenerate")})]},"success"):o.jsxs(pr.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:Y=>{Y.preventDefault(),oi()},children:[o.jsx("input",{type:"text",value:A,maxLength:8e3,disabled:T,placeholder:v("traditional.ai.placeholder",{model:$Be(d)}),"aria-invalid":!!Q,"aria-describedby":Q?"ai-requirement-error":void 0,onChange:Y=>F(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),oi())}}),o.jsx("button",{type:"submit",disabled:T||!K||!!Q,"aria-label":v(T?"traditional.ai.generating":"traditional.ai.generate"),children:T?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):v("traditional.ai.generate")})]}),Q&&o.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:Q})]},"compose")})});return S?o.jsx(O7t,{draft:Ni,cloudProvider:d,deployRegion:qe,runtimeName:_,isRuntimeUpdate:!!u,deploying:Et,deployStage:Mt,deployError:ye,deploySucceeded:Ke,showErrors:W,onBack:e,onDraftPatch:Y=>{k(we=>({...we,...Y})),Le(null),Pe("")},onDeploymentPatch:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},...Y}})),onModelApiKeyChange:In,customModelApiKey:tn?E[tn.key]??"":"",onCustomModelApiKeyChange:Y=>{tn&&C(we=>({...we,[tn.key]:Y}))},onSelectedSkillsChange:Y=>k(we=>({...we,selectedSkills:Y})),onCloudEnvironmentChange:ce,onDeployRegionChange:Ae,onRuntimeNameChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},runtimeName:Y,runtimeNameCustomized:!0}})),onNetworkChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},network:Y}})),onDeploy:Y=>void li(Y)}):o.jsxs("div",{className:`cw-root is-${re}`,children:[o.jsx(dBt,{mode:re}),gt&&o.jsx(Lb,{className:"cw-workspace-alert",message:gt}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[re==="build"&&o.jsx("div",{className:"cw-build-workspace",children:o.jsxs("div",{className:"cw-editor",children:[o.jsx(LS,{draft:w,direction:"horizontal",selectedPath:ht,onSelect:zt,onAdd:Oi,onInsert:mi,onDelete:qi}),o.jsx("div",{className:"cw-detail",children:o.jsx("div",{className:"cw-detail-scroll",ref:Z,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsx("div",{className:"cw-lower",children:o.jsxs("div",{className:"cw-form-col",children:[o.jsxs(ci,{meta:Sa("type"),children:[o.jsx(Wg,{className:"cw-agent-type-options","aria-label":v("traditional.agentTypes.ariaLabel"),value:pe.agentType??"llm",onChange:Un,children:$Ft.map(Y=>{const we=(pe.agentType??"llm")===Y.id,Ge=We&&Y.id==="a2a",_t=Ge?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("div",{"data-agent-type":Y.id,className:`cw-agent-type-option ${we?"is-on":""} ${Ge?"is-disabled":""}`,tabIndex:Ge?0:void 0,"aria-describedby":_t,children:[o.jsx(Wg.Item,{value:Y.id,disabled:Ge,block:!0,className:"cw-agent-type-control",children:o.jsx("span",{className:"cw-agent-type-copy",children:o.jsx("strong",{children:v(B7t[Y.id])})})}),Ge&&o.jsx("span",{id:_t,className:"cw-agent-type-disabled-hint",role:"tooltip",children:v("traditional.agentTypes.remoteChildOnly")})]},Y.id)})}),W&&ia&&pe.subAgents.length===0&&o.jsx("span",{className:"cw-error-text",children:iBt({name:pe.name.trim(),agentType:pe.agentType},v)})]}),o.jsx(ci,{meta:Sa("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Nr&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[v(We?"traditional.basic.agentName":"traditional.basic.name"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${oa(ls,va)}`,"data-validation-field":"name",value:pe.name,placeholder:"assistant","aria-invalid":va&&ls,"aria-describedby":va&&sa?"cw-agent-name-error":void 0,onBlur:vn,onChange:Y=>{vn(),Fe({name:Y.target.value})}}),va&&sa?o.jsx("span",{id:"cw-agent-name-error",role:"alert",className:"cw-error-text",children:sa}):o.jsx("span",{className:"cw-help",children:v("traditional.basic.nameHelp")})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[v(We?"common.description":"traditional.basic.agentDescription"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${oa(aa)}`,"data-validation-field":"description",value:pe.description,placeholder:v("traditional.basic.descriptionPlaceholder"),"aria-invalid":W&&aa,"aria-describedby":W&&aa?"cw-agent-description-error":void 0,onChange:Y=>Fe({description:Y.target.value})}),W&&aa?o.jsx("span",{id:"cw-agent-description-error",role:"alert",className:"cw-error-text",children:v("traditional.validation.missingDescription")}):o.jsx("span",{className:"cw-help",children:v(We?"traditional.basic.rootDescriptionHelp":"traditional.basic.descriptionHelp")})]})]}),ia?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:v("traditional.basic.orchestratorHelp")}),pe.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.basic.maxIterations")}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:pe.maxIterations??3,onChange:Y=>Fe({maxIterations:Math.max(1,Number(Y.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:v("traditional.basic.maxIterationsHelp")})]})]}):Nr?o.jsxs("div",{className:"cw-field cw-remote-center-fields","data-validation-field":"a2a-registry",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:[v("traditional.basic.agentCenter"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:v("traditional.basic.agentCenterHelp")})]}),o.jsx(G7t,{value:((du=pe.a2aRegistry)==null?void 0:du.registrySpaceId)??"",region:((us=pe.a2aRegistry)==null?void 0:us.registryRegion)||As.region,invalid:W&&Ua,onChange:Y=>en(eIe,Y)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ut,"aria-controls":Ki,onClick:()=>Gt(Y=>!Y),children:[o.jsx("span",{children:v("traditional.basic.moreOptions")}),o.jsx(Uk,{className:`cw-more-options-chevron ${ut?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Ru,{initial:!1,children:ut&&o.jsx(pr.div,{id:Ki,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:o.jsx(hw,{env:cy(U7t,d),values:tIe(pe.a2aRegistry,{includeDefaults:!1},d),onChange:en})})}),W&&Ua&&o.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingRegistry")})]}):o.jsxs("div",{className:"cw-field","data-validation-field":"instruction",children:[o.jsxs("label",{className:"cw-label",children:[v("traditional.basic.systemPrompt"),o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:v("traditional.basic.loadingMarkdown")}),children:o.jsx(D7t,{value:pe.instruction,invalid:ws,onChange:Y=>Fe({instruction:Y})})}),W&&ws?o.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingPrompt")}):o.jsx("span",{className:"cw-help",children:v("traditional.basic.markdownHelp")})]})]})}),!ia&&!Nr&&o.jsxs(o.Fragment,{children:[o.jsx(ci,{meta:Sa("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field cw-model-source-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.source")}),o.jsx(Wg,{className:"cw-model-source-options","aria-label":v("traditional.model.source"),value:Vs,onChange:Y=>{Y!=="gateway"&&Yr(Y)},children:[{value:"ark",label:v(d==="byteplus"?"traditional.model.bytePlusModelArk":"traditional.model.volcanoArk")},{value:"custom",label:v("traditional.model.custom")},{value:"gateway",label:v("traditional.model.gateway"),disabled:!0}].map(Y=>o.jsx("div",{className:`cw-model-source-option ${Vs===Y.value?"is-on":""}${Y.disabled?" is-disabled":""}`,children:o.jsxs(Wg.Item,{value:Y.value,disabled:Y.disabled,block:!0,className:"cw-model-source-control",children:[o.jsx("span",{children:Y.label}),Y.disabled&&o.jsx("span",{className:"cw-model-source-coming-soon",children:v("traditional.model.comingSoon")})]})},Y.value))})]}),Vs==="ark"?o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.configuration")}),o.jsx(W7t,{value:pe.modelName??"",cloudProvider:d,apiKeyId:(Tl=w.deployment)==null?void 0:Tl.modelApiKeyId,apiKeyName:(xc=w.deployment)==null?void 0:xc.modelApiKeyName,onApiKeyChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},modelApiKeyId:Y.id,modelApiKeyName:Y.name}})),onChange:Y=>Fe({modelName:Y})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.model.name")}),o.jsx("input",{className:"cw-input",value:pe.modelName??"",onChange:Y=>Fe({modelName:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label cw-label-with-link",children:[o.jsx("span",{children:v("traditional.model.provider")}),o.jsxs("a",{href:"https://docs.litellm.ai/docs/providers",target:"_blank",rel:"noopener noreferrer",onClick:Y=>Y.stopPropagation(),children:[v("traditional.model.liteLlmProviders"),o.jsx(gb,{"aria-hidden":"true"})]})]}),o.jsx("input",{className:"cw-input",value:pe.modelProvider??"",placeholder:"openai",onChange:Y=>Fe({modelProvider:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:pe.modelApiBase??"",placeholder:xl(d),onChange:Y=>Fe({modelApiBase:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Key"}),o.jsx("input",{className:"cw-input",type:"password",value:tn?E[tn.key]??"":"",placeholder:v("traditional.model.apiKeyPlaceholder"),autoComplete:"new-password",onChange:Y=>{if(!tn)return;const we=Y.currentTarget.value;C(Ge=>({...Ge,[tn.key]:we}))}})]})]})]})}),o.jsx(ci,{meta:Sa("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.tools.builtIn")}),o.jsx("span",{className:"cw-help",children:v("traditional.tools.builtInHelp")}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(Q7t,{items:zi,selected:ri,onToggle:os,scrollRows:6})}),o.jsx(Ru,{initial:!1,children:ri.includes("run_code")&&o.jsxs(pr.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:v("traditional.tools.codeExecution")}),o.jsx("span",{className:"cw-help",children:v("traditional.tools.codeExecutionHelp")})]}),o.jsx(hw,{env:((Sr=Bx.find(Y=>Y.id==="run_code"))==null?void 0:Sr.env)??[],values:((Qn=w.deployment)==null?void 0:Qn.envValues)??{},onChange:pn})]})})]}),o.jsxs("div",{className:"cw-field cw-mcp-field",children:[o.jsx("label",{className:"cw-label",children:v("traditional.tools.mcp")}),o.jsx(Y7t,{tools:Lr,conflict:_r,showConflict:W,onChange:Y=>Fe({mcpTools:Y})})]})]})}),o.jsx(ci,{meta:Sa("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(ZQ,{selected:xs,onChange:Y=>Fe({selectedSkills:Y}),cloudProvider:d})})}),o.jsx(ci,{meta:Sa("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(k2,{checked:pe.knowledgebase,onChange:Y=>Fe({knowledgebase:Y}),title:v("traditional.knowledge.title"),desc:v("traditional.knowledge.description"),icon:Y2}),pe.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.knowledge.backend")}),o.jsx(CL,{options:x6,value:pe.knowledgebaseBackend,translationGroup:"knowledge",onChange:Y=>Fe({knowledgebaseBackend:Y,knowledgebaseIndex:Y==="viking"||Y==="openviking"?pe.knowledgebaseIndex:""})}),(pe.knowledgebaseBackend??nm)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.knowledge.vikingDatabase")}),o.jsx(K7t,{value:pe.knowledgebaseIndex??"",onChange:Y=>{Fe({knowledgebaseIndex:Y.id}),Y.projectName&&pn("DATABASE_VIKING_PROJECT",Y.projectName),Y.region&&pn("DATABASE_VIKING_REGION",Y.region),Y.sourceKind&&pn("DATABASE_VIKING_COLLECTION_KIND",Y.sourceKind),pn("DATABASE_VIKING_RESOURCE_ID",Y.resourceId??"")}})]}),o.jsx(hw,{env:((za=x6.find(Y=>Y.id===(pe.knowledgebaseBackend??nm)))==null?void 0:za.env)??[],values:((rf=w.deployment)==null?void 0:rf.envValues)??{},onChange:pn,renderAfterField:(pe.knowledgebaseBackend??nm)==="openviking"?Y=>Y.key==="DATABASE_OPENVIKING_USER_ID"?o.jsx(V7t,{value:pe.knowledgebaseIndex??"",onChange:we=>Fe({knowledgebaseIndex:we})}):null:void 0})]})]})}),We&&o.jsx(ci,{meta:Sa("memory"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(k2,{checked:pe.memory.shortTerm,onChange:Y=>Fe({memory:{...pe.memory,shortTerm:Y}}),title:v("traditional.memory.shortTerm"),desc:v("traditional.memory.shortTermDescription"),showDescription:!0,icon:Abe}),pe.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.shortTermBackend")}),o.jsx(CL,{options:iv,value:pe.shortTermBackend,translationGroup:"shortTerm",onChange:Y=>Fe({shortTermBackend:Y})}),o.jsx(hw,{env:((Al=iv.find(Y=>Y.id===(pe.shortTermBackend??"local")))==null?void 0:Al.env)??[],values:((be=w.deployment)==null?void 0:be.envValues)??{},onChange:pn})]}),o.jsx(k2,{checked:pe.memory.longTerm,onChange:Y=>Fe({memory:{...pe.memory,longTerm:Y}}),title:v("traditional.memory.longTerm"),desc:v("traditional.memory.longTermDescription"),showDescription:!0,icon:Y2}),pe.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.longTermBackend")}),o.jsx(CL,{options:v6,value:pe.longTermBackend,translationGroup:"longTerm",onChange:Y=>Fe({longTermBackend:Y,longTermMemoryIndex:Y==="viking"?pe.longTermMemoryIndex:""})}),(pe.longTermBackend??"local")==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:v("traditional.memory.vikingDatabase")}),o.jsx(X7t,{value:pe.longTermMemoryIndex??"",onChange:Y=>{Fe({longTermMemoryIndex:Y.id}),pn("DATABASE_VIKINGMEM_PROJECT",Y.projectName),pn("DATABASE_VIKING_REGION",Y.region),pn("DATABASE_VIKINGMEM_MEMORY_TYPE",(Y.memoryTypes??[]).join(","))}})]}),o.jsx(hw,{env:((Ye=v6.find(Y=>Y.id===(pe.longTermBackend??"local")))==null?void 0:Ye.env)??[],values:((Ct=w.deployment)==null?void 0:Ct.envValues)??{},onChange:pn}),o.jsx(k2,{checked:!!pe.autoSaveSession,onChange:Y=>Fe({autoSaveSession:Y}),title:v("traditional.memory.autoSave"),desc:v("traditional.memory.autoSaveDescription"),icon:Y2})]})]})})]})]})})})})})]})}),re==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(lBt,{enabled:ze,disabledReason:Ee,variants:De,draftSnapshot:Co,input:He,onInput:Je,onSend:oo,onStartVariant:Go,onUseVariant:Y=>void Vi(Y),onAddVariant:ed,onRemoveVariant:bc,onToggleConfig:Y=>{const we=De.find(Ge=>Ge.id===Y);we&&uu(Y,{configOpen:!we.configOpen})},onCompleteConfig:td,onConfigChange:Cl,onOpenTrace:la})})}),re==="optimize"&&o.jsx(cBt,{profile:Eo,optimizations:xa,unavailableMessage:Xi,onProfileChange:yc,onOptimizationChange:To}),re==="environment"&&o.jsx("div",{className:"cw-environment-workspace",children:o.jsx(YRe,{value:w.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:ce,disabled:Me})}),re==="publish"&&o.jsx("div",{className:"cw-preview-body",children:st?o.jsx(WI,{embedded:!0,cloudProvider:d,project:st,agentDraft:w,agentName:w.name||v("traditional.basic.unnamedAgent"),agentCount:rIe(w),releaseConfiguration:xe?{modelName:xe.modelName||w.modelName||v("traditional.debug.defaultModel"),description:xe.description,instruction:xe.instruction,optimizations:[v("traditional.optimization.releaseScenario",{profile:v(`traditional.optimization.profiles.${Eo}.label`)}),...xa.map(Y=>v(`traditional.optimization.options.${Y}.label`))]}:void 0,onChange:Le,onDeploy:Oa,onAgentAdded:n,onDeploymentTaskChange:s,deploymentActionLabel:v(u?"traditional.deployment.updateAndPublish":"common.deploy"),deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:u==null?void 0:u.runtimeId,deploymentRuntimeName:_,deploymentRuntimeNameCustomized:!!u||!!((_n=w.deployment)!=null&&_n.runtimeNameCustomized),onDeploymentRuntimeNameChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},runtimeName:Y,runtimeNameCustomized:!0}})),onDeploymentStarted:m,onDeploymentComplete:h,feishuEnabled:!!((Dt=w.deployment)!=null&&Dt.feishuEnabled),configuredRuntimeEnvKeys:u==null?void 0:u.configuredRuntimeEnvKeys,onFeishuEnabledChange:async Y=>{const we={...w,deployment:{...w.deployment??{feishuEnabled:!1},feishuEnabled:Y}},Ge=await wO(Kw(we));k(we),Le(Ge)},deploymentEnv:Xe.specs,requiredSecretEnv:Yt,requiredSecretEnvValues:E,onRequiredSecretEnvChange:(Y,we)=>C(Ge=>({...Ge,[Y]:we})),deploymentEnvValues:{...(fn=Ni.deployment)==null?void 0:fn.envValues,...E,...Xe.fixedValues},onDeploymentEnvChange:pn,onFeishuCredentialsChange:(Y,we)=>Pt({FEISHU_APP_ID:Y,FEISHU_APP_SECRET:we}),network:(On=w.deployment)==null?void 0:On.network,onNetworkChange:Y=>k(we=>({...we,deployment:{...we.deployment??{feishuEnabled:!1},network:Y}})),deployRegion:qe,onDeployRegionChange:Ae,deploymentTelemetry:{source:"scratch",createMode:a,aiAssisted:M},onExportYaml:()=>L7t(`${Ni.name||"agent"}.yaml`,l7t(Ni,{heading:v("yaml.heading"),importHint:v("yaml.importHint")}),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"}),o.jsx("strong",{children:v("traditional.publish.generating")}),o.jsx("span",{children:v("traditional.publish.validating")})]})})]}),o.jsx(fBt,{mode:re,busy:Me,onChange:Gh,assistant:re==="build"?Hn:void 0}),Ce&&o.jsx(ZRe,{testRunId:Ce.runId,sessionId:Ce.sessionId,title:v("traditional.debug.traceTitle",{name:Ce.variantName}),onClose:()=>Wt(null)}),ln&&o.jsx(pc,{variant:"warning",title:v("traditional.debug.leaveTitle"),description:v("traditional.debug.leaveDescription"),confirmLabel:v(Ot?"traditional.debug.cleaning":"traditional.debug.confirmLeave"),closeLabel:v("traditional.debug.closeLeaveConfirmation"),busy:Ot,onCancel:$r,onConfirm:()=>void wa()}),I&&o.jsx("div",{className:"confirm-scrim",onClick:()=>H(null),children:o.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:Y=>Y.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:v("traditional.ai.failed")}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:I}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>H(null),children:v("common.close")})})]})})]})}function bu({name:e}){const t={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"branch":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"6",cy:"5",r:"2"}),o.jsx("circle",{cx:"18",cy:"7",r:"2"}),o.jsx("circle",{cx:"18",cy:"17",r:"2"}),o.jsx("path",{d:"M8 5h2.5A3.5 3.5 0 0 1 14 8.5v7A1.5 1.5 0 0 0 15.5 17H16"}),o.jsx("path",{d:"M14 10.5v-2A1.5 1.5 0 0 1 15.5 7H16"})]});case"plan":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M6.5 3.5h11a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-11a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"m8 9 1.4 1.4L12 7.8M13.5 10H16M8 15l1.4 1.4 2.6-2.6M13.5 16H16"})]});case"collaborate":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"8",cy:"8",r:"3"}),o.jsx("circle",{cx:"17",cy:"9",r:"2.5"}),o.jsx("path",{d:"M3.5 19a4.5 4.5 0 0 1 9 0M13.5 15.5A4 4 0 0 1 20.5 18"})]});case"summary":return o.jsx("svg",{...t,children:o.jsx("path",{d:"M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"})});case"skills":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M5 5h5v5H5zM14 5h5v5h-5zM5 14h5v5H5z"}),o.jsx("path",{d:"M14 16.5h5M16.5 14v5"})]});case"trace":return o.jsxs("svg",{...t,children:[o.jsx("circle",{cx:"6",cy:"6",r:"2"}),o.jsx("circle",{cx:"18",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("path",{d:"M8 6h3a3 3 0 0 1 3 3v0a3 3 0 0 0 2 2.83M16.2 13.2 9.8 16.8"})]});case"structure":return o.jsxs("svg",{...t,children:[o.jsx("rect",{x:"3.5",y:"4",width:"7",height:"5",rx:"1"}),o.jsx("rect",{x:"13.5",y:"15",width:"7",height:"5",rx:"1"}),o.jsx("path",{d:"M10.5 6.5h3A3.5 3.5 0 0 1 17 10v5M7 9v7a2 2 0 0 0 2 2h4.5"})]});case"model":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M8 3.5v3M16 3.5v3M8 17.5v3M16 17.5v3M3.5 8h3M17.5 8h3M3.5 16h3M17.5 16h3"}),o.jsx("rect",{x:"6.5",y:"6.5",width:"11",height:"11",rx:"2"}),o.jsx("path",{d:"M10 10h4v4h-4z"})]});case"environment":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M4 7.5h16M7 4h10l3 3.5v10L17 20H7l-3-2.5v-10Z"}),o.jsx("path",{d:"m8 12 2 2-2 2M12.5 16H16"})]});case"deploy":return o.jsxs("svg",{...t,children:[o.jsx("path",{d:"M12 3.5v11M7.5 8 12 3.5 16.5 8"}),o.jsx("path",{d:"M5 13.5v5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-5"})]});case"workflow":return o.jsxs("svg",{...t,children:[o.jsx("rect",{x:"4",y:"4",width:"6",height:"5",rx:"1"}),o.jsx("rect",{x:"14",y:"15",width:"6",height:"5",rx:"1"}),o.jsx("path",{d:"M10 6.5h2a4 4 0 0 1 4 4V15M7 9v3a4 4 0 0 0 4 4h3"})]})}}function pBt({onSelectVulcan:e,onSelectTraditional:t}){const{t:n}=Te("create"),i=RF(),[r,s]=p.useState(!1),a=p.useRef(null),l=u=>{if(!r){if(i){u();return}a.current=u,s(!0)}},c=()=>{if(!r)return;const u=a.current;a.current=null,u==null||u()};return o.jsx(pr.main,{className:`agent-creation-mode-picker${r?" is-leaving":""}`,initial:i?!1:{opacity:0},animate:{opacity:r?0:1},transition:{duration:r?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:c,children:o.jsxs("section",{className:"agent-creation-mode-picker__content","aria-labelledby":"agent-creation-mode-picker-title",children:[o.jsxs("header",{className:"agent-creation-mode-picker__header",children:[o.jsx("h1",{id:"agent-creation-mode-picker-title",children:n("modePicker.title")}),o.jsx("p",{children:n("modePicker.subtitle")})]}),o.jsxs("div",{className:"agent-creation-mode-picker__options",children:[o.jsxs(Ht,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>l(e),children:[o.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[o.jsx(Xv,{className:"agent-creation-mode-picker__avatar is-vulcan",seed:n("modePicker.quick.title")}),o.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[o.jsx("span",{className:"agent-creation-mode-picker__card-title",children:n("modePicker.quick.title")}),o.jsx("span",{className:"agent-creation-mode-picker__card-description",children:n("modePicker.quick.description")})]})]}),o.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),o.jsxs("span",{className:"agent-creation-mode-picker__features",children:[o.jsx("span",{children:n("modePicker.features")}),o.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"branch"})}),o.jsx("span",{children:n("modePicker.quick.features.dynamicSubagents")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"plan"})}),o.jsx("span",{children:n("modePicker.quick.features.autonomousPlanning")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"collaborate"})}),o.jsx("span",{children:n("modePicker.quick.features.collaboration")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"summary"})}),o.jsx("span",{children:n("modePicker.quick.features.summary")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"skills"})}),o.jsx("span",{children:n("modePicker.quick.features.skills")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"trace"})}),o.jsx("span",{children:n("modePicker.quick.features.trace")})]})]})]})]}),o.jsxs(Ht,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>l(t),children:[o.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[o.jsx(Xv,{className:"agent-creation-mode-picker__avatar is-traditional",seed:n("modePicker.traditional.title")}),o.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[o.jsx("span",{className:"agent-creation-mode-picker__card-title",children:n("modePicker.traditional.title")}),o.jsx("span",{className:"agent-creation-mode-picker__card-description",children:n("modePicker.traditional.description")})]})]}),o.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),o.jsxs("span",{className:"agent-creation-mode-picker__features",children:[o.jsx("span",{children:n("modePicker.features")}),o.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"structure"})}),o.jsx("span",{children:n("modePicker.traditional.features.visualConfig")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"model"})}),o.jsx("span",{children:n("modePicker.traditional.features.migration")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"environment"})}),o.jsx("span",{children:n("modePicker.traditional.features.debugging")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"deploy"})}),o.jsx("span",{children:n("modePicker.traditional.features.optimization")})]}),o.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[o.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:o.jsx(bu,{name:"workflow"})}),o.jsx("span",{children:n("modePicker.traditional.features.parameters")})]})]})]})]})]})]})})}const Kne=50*1024*1024,F8=800,mBt={name:"code_package",files:[]};function gBt(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function gz(e,t){return $t(e,t)}function oIe(e,t=gz){const n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!n||n.endsWith("/"))return null;if(n.startsWith("/")||n.includes("\0"))throw new Error(t("codePackage.errors.invalidPath",{name:e}));const i=n.split("/");if(i.some(r=>!r||r==="."||r===".."))throw new Error(t("codePackage.errors.invalidPath",{name:e}));return i[0]==="__MACOSX"||i[i.length-1]===".DS_Store"?null:i.join("/")}function bBt(e,t=gz){const n=e.flatMap(l=>{const c=oIe(l.name,t);return c?[{path:c,content:l.text}]:[]});if(n.length===0)throw new Error(t("codePackage.errors.empty"));if(n.length>F8)throw new Error(t("codePackage.errors.tooManyFiles",{count:F8}));const s=new Set(n.map(l=>l.path.split("/")[0])).size===1&&n.every(l=>l.path.includes("/"))?n.map(l=>({...l,path:l.path.split("/").slice(1).join("/")})):n,a=new Set;for(const l of s){if(a.has(l.path))throw new Error(t("codePackage.errors.duplicateFile",{path:l.path}));a.add(l.path)}return yBt(s,t),s}function yBt(e,t=gz){const n=new Set(e.map(s=>s.path)),i=e.find(s=>s.path==="agentkit.yaml");let r="app.py";if(i){let s;try{s=Ikt(i.content)}catch(c){throw new Error(t("codePackage.errors.manifestParse",{detail:c instanceof Error?c.message:String(c)}))}if(s!==null&&(typeof s!="object"||Array.isArray(s)))throw new Error(t("codePackage.errors.manifestRoot"));const a=s&&typeof s=="object"&&!Array.isArray(s)?s.common:void 0;if(a!==void 0&&(a===null||typeof a!="object"||Array.isArray(a)))throw new Error(t("codePackage.errors.manifestCommon"));const l=a&&typeof a=="object"&&!Array.isArray(a)?a.entry_point:void 0;if(l!==void 0){if(typeof l!="string")throw new Error(t("codePackage.errors.entryPointType"));const c=oIe(l,t);if(!c)throw new Error(t("codePackage.errors.entryPointInvalid"));r=c}}if(!n.has(r))throw i&&r!=="app.py"?new Error(t("codePackage.errors.entryPointMissing",{entryPoint:r})):new Error(t("codePackage.errors.defaultEntryPointMissing"));return r}function vBt({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:i,onDeploymentComplete:r,cloudProvider:s="volcengine",initialDeployRegion:a=Ji(s)}){const{t:l}=Te("create"),c=p.useRef(null),u=p.useRef(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!1),[v,y]=p.useState(!1),[x,O]=p.useState(!1),[w,k]=p.useState(""),[S,E]=p.useState(a),[C,N]=p.useState();p.useEffect(()=>()=>{u.current+=1},[]);async function _(T){const P=++u.current;if(k(""),!T.name.toLowerCase().endsWith(".zip")){k(l("codePackage.errors.invalidFormat"));return}if(T.size>Kne){k(l("codePackage.errors.tooLarge"));return}y(!0);try{const R=await Cje(new Uint8Array(await T.arrayBuffer()),{maxEntries:F8,maxUncompressedBytes:Kne}),L=bBt(R,l);if(P!==u.current)return;m(T.name),f({name:gBt(T.name),files:L})}catch(R){if(P!==u.current)return;m(""),f(null),k(R instanceof Error?R.message:String(R))}finally{P===u.current&&y(!1)}}function j(T){var R;const P=(R=T.currentTarget.files)==null?void 0:R[0];T.currentTarget.value="",P&&_(P)}function A(T){var R;T.preventDefault(),O(!1);const P=(R=T.dataTransfer.files)==null?void 0:R[0];P&&_(P)}async function F(T,P,R){const L=C&&C.mode!=="public"?{mode:C.mode,vpc_id:C.vpcId,subnet_ids:C.subnetIds,enable_shared_internet_access:C.enableSharedInternetAccess}:void 0;return Ax(T.name,T.files,{region:S,projectName:"default",network:L},{...R,onStage:P})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(WI,{cloudProvider:s,project:d??mBt,agentName:(d==null?void 0:d.name)||l("codePackage.name"),onChange:d?f:void 0,onDeploy:F,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:i,onDeploymentComplete:r,network:C,onNetworkChange:N,deployRegion:S,onDeployRegionChange:E,deploymentTelemetry:{source:"code_package",createMode:"code_package",aiAssisted:!1},onBack:e,backLabel:l("codePackage.back"),deployDisabled:!d||v,deployDisabledReason:v?l("codePackage.reading"):d?void 0:l("codePackage.uploadFirst"),deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":l("codePackage.uploadAriaLabel"),children:[o.jsx("div",{className:"package-source-label",children:l("codePackage.name")}),o.jsxs("div",{className:`package-dropzone${x?" is-dragging":""}${d?" is-ready":""}`,onDragEnter:T=>{T.preventDefault(),O(!0)},onDragOver:T=>T.preventDefault(),onDragLeave:T=>{T.currentTarget.contains(T.relatedTarget)||O(!1)},onDrop:A,onClick:()=>{var T;v||(T=c.current)==null||T.click()},onKeyDown:T=>{var P;!v&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(P=c.current)==null||P.click())},role:"button",tabIndex:v?-1:0,"aria-label":l(d?"codePackage.reupload":"codePackage.upload"),"aria-disabled":v,children:[o.jsx("strong",{children:v?l("codePackage.readingEllipsis"):d?h:l("codePackage.uploadPrompt")}),o.jsx("span",{children:d?l("codePackage.filesRecognized",{count:d.files.length}):l("codePackage.dropHint")}),o.jsx("div",{className:"package-upload-actions",children:d&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:T=>{T.stopPropagation(),b(!0)},onKeyDown:T=>T.stopPropagation(),children:l("codePackage.viewFiles")})}),o.jsx("input",{ref:c,type:"file",accept:".zip,application/zip","aria-label":l("codePackage.chooseFile"),onChange:j})]}),w&&o.jsx("div",{className:"package-create-error",role:"alert",children:w})]})}),d&&o.jsx(WS,{project:d,open:g,onClose:()=>b(!1),onChange:f})]})}const xBt="/web/agent-migrations",XI=39e4;class sl extends Error{constructor(t,n,i="MIGRATION_ERROR",r=!1,s="",a=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.rawResponse=a,this.name="MigrationApiError"}}const wBt=new Set(["langchain","langgraph","adk","strands","agentcore","dify","any"]),OBt=new Set(["awaiting_upload","analyzing","needs_input","analysis_ready","migrating","validating","packaging","succeeded","succeeded_with_warnings","partial","failed","cancelled","expired"]),SBt=new Set(["reasoning","message","plan","command","status"]),kBt=new Set(["running","completed","failed"]),EBt=new Set(["pending","in_progress","completed","failed"]);function Hi(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function Gg(e,t){if(!Array.isArray(e)||!e.every(n=>typeof n=="string"))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function WO(e,t){if(typeof e!="string"||!wBt.has(e))throw new Error(V("migrations.invalidFormat",{label:t}));return e}function CBt(e){const t=Hi(e,V("migrations.labels.analysisResult")),n=t.recommended===null?null:Hi(t.recommended,V("migrations.labels.recommendation")),i=Hi(t.boundary,V("migrations.labels.boundary"));if(t.schema_version!==1||!["needs_input","recommendation_ready","unsupported"].includes(String(t.status))||typeof t.attempt!="number"||typeof t.input_sha256!="string"||typeof t.summary!="string"||!Array.isArray(t.frameworks)||!Array.isArray(t.entries)||!Array.isArray(t.questions))throw new Error(V("migrations.invalidAnalysisResult"));return{schema_version:1,status:t.status,attempt:t.attempt,input_sha256:t.input_sha256,summary:t.summary,frameworks:t.frameworks.map(r=>{const s=Hi(r,V("migrations.labels.frameworkCandidate"));if(!["high","medium","low"].includes(String(s.confidence))||!Array.isArray(s.evidence))throw new Error(V("migrations.invalidFrameworkCandidate"));return{id:WO(s.id,V("migrations.labels.frameworkCandidate")),confidence:s.confidence,evidence:s.evidence.map(a=>{const l=Hi(a,V("migrations.labels.analysisEvidence"));if(typeof l.path!="string"||typeof l.line!="number"||typeof l.reason!="string")throw new Error(V("migrations.invalidAnalysisEvidence"));return{path:l.path,line:l.line,reason:l.reason}})}}),recommended:n===null?null:{framework:WO(n.framework,V("migrations.labels.recommendedFramework")),entry:n.entry===null||typeof n.entry=="string"?n.entry:null,reason:typeof n.reason=="string"?n.reason:""},entries:t.entries.map(r=>{const s=Hi(r,V("migrations.labels.entryCandidate"));if(typeof s.value!="string"||typeof s.evidence!="string")throw new Error(V("migrations.invalidEntryCandidate"));return{value:s.value,framework:WO(s.framework,V("migrations.labels.entryFramework")),evidence:s.evidence}}),boundary:{include:Gg(i.include,V("migrations.labels.includeScope")),exclude:Gg(i.exclude,V("migrations.labels.excludeScope"))},assumptions:Gg(t.assumptions,V("migrations.labels.assumptions")),questions:t.questions.map(r=>{const s=Hi(r,V("migrations.labels.question"));if(typeof s.id!="string"||typeof s.prompt!="string"||typeof s.required!="boolean")throw new Error(V("migrations.invalidQuestion"));return{id:s.id,prompt:s.prompt,required:s.required}}),warnings:Gg(t.warnings,V("migrations.labels.analysisWarnings"))}}function a0(e){const t=Hi(e,V("migrations.labels.task")),n=Hi(t.artifact,V("migrations.labels.artifactStatus"));if(typeof t.id!="string"||typeof t.state!="string"||!OBt.has(t.state)||typeof t.message!="string"||typeof t.sourceFileName!="string"||typeof t.instruction!="string"||typeof t.createdAt!="string"&&typeof t.createdAt!="number"||typeof t.expiresAt!="string"||typeof t.sessionTtlSeconds!="number"||typeof t.canModify!="boolean"||typeof t.canUpload!="boolean"||typeof t.canAnswer!="boolean"||typeof t.canConfirm!="boolean"||typeof t.canStop!="boolean")throw new Error(V("migrations.invalidTask"));const i={id:t.id,state:t.state,message:t.message,sourceFileName:t.sourceFileName,instruction:t.instruction,createdAt:t.createdAt,expiresAt:t.expiresAt,sessionTtlSeconds:t.sessionTtlSeconds,canModify:t.canModify,canUpload:t.canUpload,canAnswer:t.canAnswer,canConfirm:t.canConfirm,canStop:t.canStop,artifact:{state:typeof n.state=="string"?n.state:"none",previewReady:n.previewReady===!0,downloadReady:n.downloadReady===!0,deployReady:n.deployReady===!0}};if(typeof t.modelId=="string"&&t.modelId.trim()&&(i.modelId=t.modelId),t.analysis!==void 0&&(i.analysis=CBt(t.analysis)),t.analysisRef!==void 0){const r=Hi(t.analysisRef,V("migrations.labels.analysisReference"));if(typeof r.attempt!="number"||typeof r.sha256!="string"||typeof r.inputSha256!="string")throw new Error(V("migrations.invalidAnalysisReference"));i.analysisRef={attempt:r.attempt,sha256:r.sha256,inputSha256:r.inputSha256}}if(t.confirmation!==void 0){const r=Hi(t.confirmation,V("migrations.labels.confirmation"));i.confirmation={...r.framework!==void 0?{framework:WO(r.framework,V("migrations.labels.confirmedFramework"))}:{},...r.entry===null||typeof r.entry=="string"?{entry:r.entry}:{},...typeof r.app_name=="string"?{app_name:r.app_name}:{}}}if(t.error!==void 0){const r=Hi(t.error,V("migrations.labels.error"));i.error={code:typeof r.code=="string"?r.code:"MIGRATION_ERROR",message:typeof r.message=="string"?r.message:t.message,retryable:r.retryable===!0}}if(t.persistence!==void 0){const r=Hi(t.persistence,V("migrations.labels.sourcePersistence"));if(!["saving","saved","failed","unavailable"].includes(String(r.state))||typeof r.message!="string"||r.projectId!==void 0&&typeof r.projectId!="string"||r.versionId!==void 0&&typeof r.versionId!="string"||r.retryable!==void 0&&typeof r.retryable!="boolean")throw new Error(V("migrations.invalidSourcePersistence"));i.persistence={state:r.state,message:r.message,...typeof r.projectId=="string"?{projectId:r.projectId}:{},...typeof r.versionId=="string"?{versionId:r.versionId}:{},...typeof r.retryable=="boolean"?{retryable:r.retryable}:{}}}return i}function TBt(e){const t=Hi(e,V("migrations.labels.activity"));if(typeof t.available!="boolean"||typeof t.complete!="boolean"||!Array.isArray(t.items))throw new Error(V("migrations.invalidActivity"));return{available:t.available,complete:t.complete,items:t.items.map(n=>{const i=Hi(n,V("migrations.labels.activityItem"));if(typeof i.id!="string"||typeof i.kind!="string"||!SBt.has(i.kind)||typeof i.status!="string"||!kBt.has(i.status)||typeof i.title!="string"||i.detail!==void 0&&typeof i.detail!="string")throw new Error(V("migrations.invalidActivityItem"));let r;if(i.tool!==void 0){const a=Hi(i.tool,V("migrations.labels.activityTool"));if(typeof a.name!="string"||a.error!==void 0&&typeof a.error!="string"||a.exitCode!==void 0&&!Number.isInteger(a.exitCode))throw new Error(V("migrations.invalidActivityTool"));r={name:a.name,...Object.prototype.hasOwnProperty.call(a,"input")?{input:a.input}:{},...Object.prototype.hasOwnProperty.call(a,"output")?{output:a.output}:{},...typeof a.error=="string"?{error:a.error}:{},...typeof a.exitCode=="number"?{exitCode:a.exitCode}:{}}}let s;if(i.plan!==void 0){if(!Array.isArray(i.plan))throw new Error(V("migrations.invalidActivityPlan"));s=i.plan.map(a=>{const l=Hi(a,V("migrations.labels.activityPlanItem"));if(typeof l.text!="string"||typeof l.status!="string"||!EBt.has(l.status))throw new Error(V("migrations.invalidActivityPlanItem"));return{text:l.text,status:l.status}})}return{id:i.id,kind:i.kind,status:i.status,title:i.title,...typeof i.detail=="string"?{detail:i.detail}:{},...r?{tool:r}:{},...s?{plan:s}:{}}})}}function ABt(e){const t=Hi(e,V("migrations.labels.artifact")),n=Hi(t.cli,V("migrations.labels.cli")),i=Hi(t.migration,V("migrations.labels.migration")),r=Hi(t.startup,V("migrations.labels.startup")),s=Hi(t.environment,V("migrations.labels.environment")),a=Hi(t.verification,V("migrations.labels.verification")),l=Hi(t.report,V("migrations.labels.report")),c=Hi(t.artifact,V("migrations.labels.archive")),u=s.defaults===void 0?{}:Hi(s.defaults,V("migrations.labels.environmentDefaults"));if(t.schema_version!==1||!["succeeded","succeeded_with_warnings","partial"].includes(String(t.status))||typeof n.name!="string"||typeof n.version!="string"||!["structured","agentic"].includes(String(i.engine))||typeof i.framework!="string"||!Array.isArray(t.files)||typeof r.module!="string"||typeof r.object!="string"||!["passed","failed","degraded"].includes(String(a.status))||!Array.isArray(a.checks)||typeof l.path!="string"||c.path!=="migration-result.zip"||typeof c.size!="number"||typeof c.sha256!="string"||typeof t.created_at!="string")throw new Error(V("migrations.invalidArtifact"));const d=Gg(s.required,V("migrations.labels.requiredEnvironment")),f=Gg(s.optional,V("migrations.labels.optionalEnvironment")),h=new Set([...d,...f]),m=Object.fromEntries(Object.entries(u).map(([g,b])=>{if(!h.has(g)||typeof b!="string")throw new Error(V("migrations.invalidEnvironmentDefaults"));return[g,b]}));return{schema_version:1,...typeof t.run_id=="string"?{run_id:t.run_id}:{},cli:{name:n.name,version:n.version},migration:{engine:i.engine,framework:i.framework,...typeof i.entry=="string"?{entry:i.entry}:{},...typeof i.source_sha256=="string"?{source_sha256:i.source_sha256}:{},...typeof i.provenance_sha256=="string"?{provenance_sha256:i.provenance_sha256}:{}},status:t.status,files:t.files.map(g=>{const b=Hi(g,V("migrations.labels.artifactFile"));if(typeof b.path!="string"||typeof b.size!="number"||typeof b.sha256!="string"||typeof b.mode!="string")throw new Error(V("migrations.invalidArtifactFile"));return{path:b.path,size:b.size,sha256:b.sha256,mode:b.mode}}),startup:{module:r.module,object:r.object,...Array.isArray(r.command)&&r.command.every(g=>typeof g=="string")?{command:r.command}:{}},environment:{required:d,optional:f,defaults:m},verification:{status:a.status,checks:a.checks.map(g=>{const b=Hi(g,V("migrations.labels.verificationCheck"));if(typeof b.name!="string"||!["passed","failed"].includes(String(b.status)))throw new Error(V("migrations.invalidVerificationCheck"));return{name:b.name,status:b.status,...typeof b.detail=="string"?{detail:b.detail}:{}}})},warnings:Gg(t.warnings,V("migrations.labels.artifactWarnings")),report:{path:l.path},artifact:{path:"migration-result.zip",size:c.size,sha256:c.sha256},created_at:t.created_at}}async function cu(e,t={},n=Wo){return fetch(Uo(`${xBt}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}function _Bt(e){return Array.isArray(e)?e.map(t=>{if(!t||typeof t!="object"||Array.isArray(t))return"";const n=t,i=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").join("."):"",r=typeof n.msg=="string"?n.msg:"";return r?i?`${i}: ${r}`:r:""}).filter(Boolean).join(V("migrations.validationSeparator")):""}async function bz(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Hi(JSON.parse(n),V("migrations.labels.errorResponse"));if(Array.isArray(r.detail)){const a=_Bt(r.detail);return new sl(a?V("migrations.requestValidationFailed",{detail:a}):t,e.status,"MIGRATION_REQUEST_INVALID",!1,e.statusText,n)}if(typeof r.detail=="string")return new sl(r.detail,e.status,typeof r.code=="string"?r.code:"MIGRATION_ERROR",r.retryable===!0,e.statusText,n);const s=r.detail&&typeof r.detail=="object"?Hi(r.detail,V("migrations.labels.errorDetail")):r;return new sl(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"MIGRATION_ERROR",s.retryable===!0,e.statusText,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing");return new sl(V("migrations.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"MIGRATION_ERROR",!1,e.statusText,n)}}async function nf(e,t){if(!e.ok)throw await bz(e,t);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new sl(V("migrations.nonJsonResponse",{fallback:t,status:e.status}),e.status,"MIGRATION_RESPONSE_INVALID",!1,e.statusText);return e.json()}async function NBt(e){const t=Hi(await nf(await cu("/capabilities",{signal:e}),V("migrations.loadCapabilitiesFailed")),V("migrations.labels.capabilities"));if(typeof t.enabled!="boolean"||typeof t.reason!="string"||typeof t.maxUploadBytes!="number"||typeof t.sessionTtlSeconds!="number"||!Array.isArray(t.frameworks))throw new Error(V("migrations.invalidCapabilities"));const n={enabled:t.enabled,reason:t.reason,maxUploadBytes:t.maxUploadBytes,sessionTtlSeconds:t.sessionTtlSeconds,frameworks:t.frameworks.map(i=>WO(i,V("migrations.labels.framework")))};if(t.model!==void 0){const i=Hi(t.model,V("migrations.labels.modelCapabilities"));if(typeof i.configured!="boolean"||typeof i.id!="string")throw new Error(V("migrations.invalidModelCapabilities"));n.model={configured:i.configured,id:i.id}}return n}async function AL(e){const t=Hi(await nf(await cu("/tasks",{signal:e}),V("migrations.loadTasksFailed")),V("migrations.labels.taskList"));if(!Array.isArray(t.items))throw new Error(V("migrations.invalidTaskList"));return t.items.map(a0)}async function jBt(e){return a0(await nf(await cu("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e.taskId,sourceFileName:e.sourceFileName,instruction:e.instruction,...e.modelId?{modelId:e.modelId}:{}}),signal:e.signal},XI),V("migrations.createTaskFailed")))}async function Xne(e,t,n){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}/source`,{method:"PUT",headers:{"Content-Type":"application/zip"},body:t,signal:n},XI),V("migrations.uploadProjectFailed")))}async function _L(e,t){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}`,{signal:t}),V("migrations.loadTasksFailed")))}async function RBt(e,t){return TBt(await nf(await cu(`/tasks/${encodeURIComponent(e)}/activity`,{signal:t,cache:"no-store"}),V("migrations.loadActivityFailed")))}async function IBt(e){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e.taskId)}/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({framework:e.framework,entry:e.entry||null,appName:e.appName,instruction:e.instruction,analysisAttempt:e.analysisAttempt,analysisSha256:e.analysisSha256,inputSha256:e.inputSha256,boundaryConfirmed:!0}),signal:e.signal},XI),V("migrations.startFailed")))}async function PBt(e){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e.taskId)}/answers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysisAttempt:e.analysisAttempt,analysisSha256:e.analysisSha256,inputSha256:e.inputSha256,answers:e.answers}),signal:e.signal},XI),V("migrations.submitAnswersFailed")))}async function DBt(e,t){return a0(await nf(await cu(`/tasks/${encodeURIComponent(e)}/stop`,{method:"POST",signal:t}),V("migrations.stopFailed")))}async function MBt(e,t){return ABt(await nf(await cu(`/tasks/${encodeURIComponent(e)}/artifact`,{signal:t}),V("migrations.loadArtifactFailed")))}async function LBt(e,t,n){var s;const i=new URLSearchParams({path:t}),r=await cu(`/tasks/${encodeURIComponent(e)}/artifact/file?${i}`,{signal:n},is);if(!r.ok)throw await bz(r,V("migrations.loadArtifactFileFailed"));return{blob:await r.blob(),mimeType:((s=r.headers.get("content-type"))==null?void 0:s.split(";",1)[0])||"application/octet-stream"}}function $Bt(e,t){var i;return((i=(e.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:i[1])||t}async function FBt(e,t,n){const i=await cu(`/tasks/${encodeURIComponent(e)}/download`,{signal:n},is);if(!i.ok)throw await bz(i,V("migrations.downloadArtifactFailed"));const r=URL.createObjectURL(await i.blob()),s=document.createElement("a");s.href=r,s.download=$Bt(i,`${t}-migrated.zip`),s.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}function o0({children:e,...t}){return o.jsx("svg",{...t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e})}function BBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"m10 6-6 6 6 6M4 12h16"})})}function UBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 3v12m-4-4 4 4 4-4M5 20h14"})})}function Xw(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M6 3.5h8l4 4V20H6zM14 3.5v4h4M9 12h6M9 15.5h6"})})}function QBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function zBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M14.5 4.5c2.3-.9 4.2-.8 5-.6.2.8.3 2.7-.6 5l-5.1 5.1-3.8-3.8zM15.4 8.6h.1M10.3 10.5l-3.8.7-2.1 2.1 5.3.2M13.5 13.7l-.7 3.8-2.1 2.1-.2-5.3M7.2 16.8l-2.8 2.8"})})}function VBt(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"M12 16V4m-4 4 4-4 4 4M5 20h14"})})}function Yne(e){return o.jsx(o0,{...e,children:o.jsx("path",{d:"m6 6 12 12M18 6 6 18"})})}function HBt(e){return e.flatMap(t=>{if(t.kind==="reasoning"&&t.detail)return[{kind:"thinking",text:t.detail,done:t.status!=="running"}];if(t.kind==="message"&&t.detail)return[{kind:"text",text:t.detail}];if(t.kind==="plan")return[{kind:"plan",title:t.title,summary:t.detail,items:t.plan??[],done:t.status!=="running"}];if(t.kind==="command"){const n=t.tool,i=n!=null&&n.error||typeof(n==null?void 0:n.exitCode)=="number"?{...n.output!==void 0?{output:n.output}:{},...n.error?{error:n.error}:{},...typeof n.exitCode=="number"?{exitCode:n.exitCode}:{}}:n==null?void 0:n.output;return[{kind:"tool",name:(n==null?void 0:n.name)??t.title,args:n==null?void 0:n.input,response:i,done:t.status!=="running",status:t.status,...t.status==="failed"?{defaultOpen:!0}:{}}]}return t.kind==="status"&&t.status!=="completed"?[{kind:"tool",name:t.title,response:t.detail,done:t.status!=="running",status:t.status,...t.status==="failed"?{defaultOpen:!0}:{}}]:[]})}function qBt({baseVersion:e,capabilities:t,loading:n,preparationStage:i,error:r,onCancel:s,onClose:a,onCreate:l}){const{t:c}=Te("migrations"),u=p.useId(),d=p.useRef(null),f=i!==null,h=p.useRef(f),m=p.useRef(a);return h.current=f,m.current=a,p.useEffect(()=>{const g=document.body.style.overflow,b=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",window.requestAnimationFrame(()=>{var y,x;(x=(y=d.current)==null?void 0:y.querySelector("textarea"))==null||x.focus()});const v=y=>{if(y.key==="Escape"){h.current||m.current();return}if(y.key!=="Tab"||!d.current)return;const x=[...d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(k=>k.offsetParent!==null);if(x.length===0)return;const O=x[0],w=x[x.length-1];y.shiftKey&&document.activeElement===O?(y.preventDefault(),w.focus()):!y.shiftKey&&document.activeElement===w&&(y.preventDefault(),O.focus())};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",v),b!=null&&b.isConnected&&b.focus()}},[]),Li.createPortal(o.jsx("div",{className:"migration-optimize-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&!f&&a()},children:o.jsxs("section",{ref:d,className:"migration-optimize-dialog",role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-busy":f||void 0,children:[o.jsxs("header",{className:"migration-optimize-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:u,children:c("optimization.title")}),o.jsx("p",{title:e.projectName,children:e.projectName})]}),o.jsx("button",{type:"button",className:"migration-optimize-dialog__close",onClick:a,disabled:f,"aria-label":c("optimization.closeAria"),title:c("common.close"),children:o.jsx(_Ce,{})})]}),o.jsx("div",{className:"migration-optimize-dialog__body",children:o.jsx(ORe,{capabilities:t,loading:n,preparationStage:i,error:r,onCancel:s,onCreate:async(g,b)=>{await l(g,b,e)},baseVersion:e})})]})}),document.body)}function WBt({capabilities:e,capabilitiesLoading:t,preparationStage:n,optimizationError:i,initialProjectId:r,onOptimize:s,onCancelOptimization:a,onDownload:l,onDeploy:c}){const{t:u}=Te("migrations"),[d,f]=p.useState();return o.jsxs(o.Fragment,{children:[o.jsxs("main",{className:"migration-main migration-projects-page",children:[o.jsx("header",{className:"migration-main__header",children:o.jsxs("div",{children:[o.jsx("h2",{children:u("projects.title")}),o.jsx("p",{children:u("projects.description")})]})}),o.jsx("div",{className:"migration-projects-page__content",children:o.jsx(wRe,{origin:"migration",title:u("projects.libraryTitle"),description:u("projects.libraryDescription"),emptyTitle:u("projects.emptyTitle"),emptyDescription:u("projects.emptyDescription"),capabilities:e,capabilitiesLoading:t,creating:n!==null,initialProjectId:r,onSelectBaseVersion:f,onClearBaseVersion:()=>{},onDownload:l,onDeploy:c})})]}),d?o.jsx(qBt,{baseVersion:d,capabilities:e,loading:t,preparationStage:n,error:i,onCancel:a,onClose:()=>f(void 0),onCreate:s}):null]})}const GBt=20*1024*1024,NL=1200,Zne=3e3,KBt=5e3,Jne=500,XBt=()=>{},YBt={langchain:"framework.langchain",langgraph:"framework.langgraph",adk:"framework.adk",strands:"framework.strands",agentcore:"framework.agentcore",dify:"framework.dify",any:"framework.any"};function Bi(e,t){return an.t(e,{ns:"migrations",...t})}function lIe(e){return Bi(YBt[e])}const jL=new Set(["langchain","langgraph","adk","strands","agentcore"]);function ZBt(e){switch(e){case"awaiting_upload":return Bi("state.awaitingUpload");case"analyzing":return Bi("state.analyzing");case"needs_input":return Bi("state.needsInput");case"analysis_ready":return Bi("state.analysisReady");case"migrating":return Bi("state.migrating");case"validating":return Bi("state.validating");case"packaging":return Bi("state.packaging");case"succeeded":return Bi("state.succeeded");case"succeeded_with_warnings":return Bi("state.succeededWithWarnings");case"partial":return Bi("state.partial");case"failed":return Bi("state.failed");case"cancelled":return Bi("state.cancelled");case"expired":return Bi("state.expired")}}function RL(e){return e.state==="partial"&&e.artifact.previewReady?Bi("task.partialReady"):["succeeded","succeeded_with_warnings"].includes(e.state)&&e.artifact.previewReady?e.state==="succeeded_with_warnings"?Bi("task.readyWithWarnings"):Bi("task.ready"):e.message}function JBt(e){switch(e){case"passed":return Bi("verification.passed");case"failed":return Bi("verification.failed");case"degraded":return Bi("verification.degraded")}}function IL({stage:e}){const{t}=Te("migrations"),n=[{id:"session",label:t("transfer.session")},{id:"upload",label:t("transfer.upload")},{id:"analysis",label:t("transfer.analysis")}],i=n.findIndex(r=>r.id===e);return o.jsx("div",{className:"migration-transfer-progress",role:"status",children:n.map((r,s)=>o.jsxs("div",{className:s=s)return{title:Bi("expiry.ended"),detail:Bi(n?"expiry.savedAvailable":"expiry.unavailable")};const a=Math.max(0,s-t),l=Math.floor(a/6e4),c=Math.floor(a%6e4/1e3);return{title:Bi("expiry.countdown",{minutes:l,seconds:c}),detail:r}}function oUt(e,t){let n=!1;const i=e.map(r=>{var l;if(r.state==="expired")return r;const s=new Date(r.expiresAt).getTime();if(!Number.isFinite(s)||ti.id!==t.id);return[t,...n].sort((i,r)=>{const s=typeof i.createdAt=="number"?i.createdAt*1e3:new Date(i.createdAt).getTime();return(typeof r.createdAt=="number"?r.createdAt*1e3:new Date(r.createdAt).getTime())-s})}function lUt(e,t){return e.find(n=>n.id===t)??null}function cUt(e,t){return e.startsWith("text/")||/(?:json|javascript|xml|yaml)/i.test(e)||/\.(?:py|ts|tsx|js|jsx|json|ya?ml|md|txt|toml|ini|cfg|env|sh|dockerfile)$/i.test(t)}function uUt({analysis:e}){var n;const{t}=Te("migrations");return o.jsxs("div",{className:"migration-analysis",children:[o.jsx(Bu,{text:e.summary,allowRawHtml:!1}),o.jsxs("div",{className:"migration-analysis__facts",children:[e.recommended?o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.recommended")}),o.jsx("strong",{children:lIe(e.recommended.framework)}),o.jsx("p",{children:e.recommended.reason})]}):null,o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.scope")}),o.jsx("ul",{children:e.boundary.include.map(i=>o.jsx("li",{children:i},i))})]}),e.boundary.exclude.length>0?o.jsxs("section",{children:[o.jsx("h3",{children:t("analysis.excluded")}),o.jsx("ul",{children:e.boundary.exclude.map(i=>o.jsx("li",{children:i},i))})]}):null]}),(n=e.frameworks[0])!=null&&n.evidence.length?o.jsxs("details",{className:"migration-analysis__evidence",children:[o.jsx("summary",{children:t("analysis.viewEvidence")}),o.jsx("ul",{children:e.frameworks.flatMap(i=>i.evidence.map(r=>o.jsxs("li",{children:[o.jsxs("code",{children:[r.path,":",r.line]}),o.jsx("span",{children:r.reason})]},`${i.id}:${r.path}:${r.line}`)))})]}):null,e.warnings.length>0?o.jsx("div",{className:"migration-analysis__warnings",children:e.warnings.map(i=>o.jsx("p",{children:i},i))}):null,e.assumptions.length>0?o.jsxs("details",{className:"migration-analysis__evidence",children:[o.jsx("summary",{children:t("analysis.viewAssumptions")}),o.jsx("ul",{children:e.assumptions.map(i=>o.jsx("li",{children:i},i))})]}):null]})}function dUt({activity:e,loading:t,error:n,analyzing:i}){const{t:r}=Te("migrations"),s=(e==null?void 0:e.items)??[],a=HBt(s);return o.jsxs("section",{className:"migration-activity","aria-label":r("activity.ariaLabel"),children:[o.jsxs("div",{className:"migration-activity__heading",children:[o.jsx("span",{className:`migration-activity__marker${e!=null&&e.complete?" is-complete":""}`,"aria-hidden":"true"}),o.jsx("strong",{children:r("activity.title")})]}),a.length>0?o.jsx("div",{className:"migration-activity__stream",children:o.jsx(TE,{blocks:a,onAction:XBt})}):t||!(e!=null&&e.complete)?o.jsx(xn,{children:r(i?"activity.startingAnalysis":"activity.startingMigration")}):null,n?o.jsx("p",{className:"migration-activity__error",role:"status",children:n}):null]})}function fUt({task:e,artifact:t}){var h;const{t:n,i18n:i}=Te("migrations"),[r,s]=p.useState(""),[a,l]=p.useState(((h=t.files[0])==null?void 0:h.path)??""),[c,u]=p.useState(null),d=t.files.find(m=>m.path===a)??t.files[0],f=p.useMemo(()=>{const m=r.trim().toLocaleLowerCase();return(m?t.files.filter(b=>b.path.toLocaleLowerCase().includes(m)):t.files).slice(0,Jne)},[t.files,r]);return p.useEffect(()=>{if(!d)return;if(d.size>2*1024*1024){u({path:d.path,loading:!1,error:n("artifact.fileTooLarge")});return}const m=new AbortController;let g="";return u({path:d.path,loading:!0}),LBt(e.id,d.path,m.signal).then(async({blob:b,mimeType:v})=>{if(!m.signal.aborted){if(v.startsWith("image/")){g=URL.createObjectURL(b),u({path:d.path,loading:!1,imageUrl:g});return}if(cUt(v,d.path)){const y=await b.text();if(m.signal.aborted)return;u({path:d.path,loading:!1,text:y});return}u({path:d.path,loading:!1,error:n("artifact.unsupportedPreview")})}}).catch(b=>{m.signal.aborted||u({path:d.path,loading:!1,error:b instanceof Error?b.message:String(b)})}),()=>{m.abort(),g&&URL.revokeObjectURL(g)}},[d,e.id,n,i.resolvedLanguage]),o.jsxs("div",{className:"migration-artifact-browser",children:[o.jsxs("aside",{"aria-label":n("artifact.filesAria"),children:[o.jsxs("label",{className:"migration-artifact-browser__search",children:[o.jsx("span",{className:"sr-only",children:n("artifact.searchAria")}),o.jsx("input",{value:r,onChange:m=>s(m.currentTarget.value),placeholder:n("artifact.searchPlaceholder")})]}),o.jsx("div",{className:"migration-artifact-browser__files",children:f.map(m=>o.jsxs("button",{type:"button",className:m.path===(d==null?void 0:d.path)?"is-active":"",onClick:()=>l(m.path),title:m.path,children:[o.jsx(Xw,{}),o.jsx("span",{children:m.path}),o.jsx("small",{children:hj(m.size)})]},m.path))}),t.files.length>f.length?o.jsx("p",{className:"migration-artifact-browser__limit",children:n("artifact.limit",{count:Jne})}):null]}),o.jsxs("section",{children:[o.jsxs("header",{children:[o.jsx("span",{title:d==null?void 0:d.path,children:(d==null?void 0:d.path)||n("artifact.noSelection")}),d?o.jsx("small",{children:hj(d.size)}):null]}),o.jsx("div",{className:"migration-artifact-browser__preview",children:d?(c==null?void 0:c.path)!==d.path||c.loading?o.jsx(xn,{children:n("artifact.loadingFile")}):c.error?o.jsx("p",{role:"status",children:c.error}):c.imageUrl?o.jsx("img",{src:c.imageUrl,alt:d.path}):o.jsx(zE,{value:c.text??"",path:d.path,readOnly:!0,onChange:()=>{}}):o.jsx("p",{children:n("artifact.noPreview")})})]})]})}function hUt({cloudProvider:e,onBack:t,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:a=Ji(e),projectCapabilities:l,projectCapabilitiesLoading:c,optimizationPreparationStage:u,optimizationError:d,onOptimizeVersion:f,onCancelOptimization:h,onDownloadSavedVersion:m,onDeploySavedVersion:g,initialPage:b="new",initialProjectId:v=""}){var ls,va,aa,ws,Ua,oa,Qa,Jn,Ni,Eo,xa,Xi,Co;const{t:y,i18n:x}=Te("migrations"),O=x.resolvedLanguage||x.language,w=p.useRef(null),k=p.useRef(""),S=p.useRef(null),[E,C]=p.useState(null),[N,_]=p.useState([]),[j,A]=p.useState(b),[F,T]=p.useState(v),[P,R]=p.useState(""),[L,M]=p.useState(null),[U,I]=p.useState([]),[H,K]=p.useState(""),[Q,q]=p.useState(!1),[B,ee]=p.useState(""),[le,se]=p.useState(0),[re,ge]=p.useState(!1),[W,X]=p.useState(!0),[ae,ue]=p.useState(""),[Oe,ke]=p.useState(""),[st,Le]=p.useState(""),[Me,Ie]=p.useState(!1),[qe,Ae]=p.useState(Date.now()),[ze,Ee]=p.useState(null),[De,J]=p.useState("langchain"),[he,_e]=p.useState(""),[Ze,at]=p.useState(""),[wt,Se]=p.useState({}),[ve,He]=p.useState(null),[Je,Ce]=p.useState(""),[Wt,ln]=p.useState(!1),[cn,Ot]=p.useState(0),[jt,ot]=p.useState(null),[gt,Pe]=p.useState(!1),[Et,bt]=p.useState(""),[Mt,$e]=p.useState(!1),[ye,Ue]=p.useState(!1),[Ke,ft]=p.useState(a),[ut,Gt]=p.useState(),[Rt,zt]=p.useState({}),Z=lUt(N,P),Bt=(E==null?void 0:E.maxUploadBytes)??GBt,Qe=iUt(Bt),tt=p.useMemo(()=>new Set((E==null?void 0:E.unsupportedModelIds)??[]),[E==null?void 0:E.unsupportedModelIds]),ht=p.useMemo(()=>U.filter(xe=>tUt(xe,tt)),[U,tt]),pe=(Z==null?void 0:Z.modelId)||H,We=p.useMemo(()=>{var tn;const xe=ht.map(In=>({value:In.id,label:In.displayName,description:[In.id,In.vendorName,In.lifecycleStatus==="Retiring"?y("model.retiring"):""].filter(Boolean).join(" · ")})),Xe=((Z==null?void 0:Z.modelId)||H||((tn=E==null?void 0:E.model)==null?void 0:tn.id)||"").trim(),Yt=(Z==null?void 0:Z.modelId)===Xe;return Xe&&(Yt||!tt.has(Xe))&&!xe.some(In=>In.value===Xe)&&xe.unshift({value:Xe,label:Xe,description:y("model.currentDefault")}),xe},[(ls=E==null?void 0:E.model)==null?void 0:ls.id,ht,H,Z==null?void 0:Z.modelId,y,tt]),vt=ze?Math.max(0,Math.floor((qe-ze)/1e3)):0,vn=jt==null?void 0:jt.items[jt.items.length-1],Ki=[(jt==null?void 0:jt.items.length)??0,(vn==null?void 0:vn.id)??"",(vn==null?void 0:vn.status)??"",((va=vn==null?void 0:vn.detail)==null?void 0:va.length)??0].join(":"),{ref:Fe,onScroll:Pt}=WEe(`${(Z==null?void 0:Z.id)??"new"}:${(Z==null?void 0:Z.state)??"new"}:${Ki}`);async function pn(xe,Xe=!0,Yt){try{const tn=await _L(xe,Yt);return Yt!=null&&Yt.aborted?null:(_(In=>Of(In,tn)),Le(""),Ie(!1),tn)}catch(tn){return Yt!=null&&Yt.aborted||Xe&&(Le(tn instanceof Error?tn.message:String(tn)),Ie(tn instanceof sl&&tn.retryable)),null}}async function Jt(xe){try{const Xe=await AL(xe);if(xe!=null&&xe.aborted)return;_(Xe),Le(""),Ie(!1)}catch(Xe){if(xe!=null&&xe.aborted)return;Le(Xe instanceof Error?Xe.message:String(Xe)),Ie(Xe instanceof sl&&Xe.retryable)}}p.useEffect(()=>{const xe=new AbortController;return X(!0),ke(""),Promise.all([NBt(xe.signal),AL(xe.signal)]).then(([Xe,Yt])=>{xe.signal.aborted||(C(Xe),_(Yt))}).catch(Xe=>{xe.signal.aborted||ke(Xe instanceof Error?Xe.message:String(Xe))}).finally(()=>{xe.signal.aborted||X(!1)}),()=>xe.abort()},[]),p.useEffect(()=>{const xe=new AbortController;return q(!0),ee(""),Ex({signal:xe.signal,refresh:le>0}).then(Xe=>{xe.signal.aborted||I(Xe.models)}).catch(Xe=>{xe.signal.aborted||ee(Xe instanceof Error?Xe.message:y("model.loadError"))}).finally(()=>{xe.signal.aborted||q(!1)}),()=>xe.abort()},[e,le,y]),p.useEffect(()=>{var Yt,tn;if(!E||H)return;const xe=((Yt=E.model)==null?void 0:Yt.id.trim())||"",Xe=xe&&!tt.has(xe)?xe:((tn=ht[0])==null?void 0:tn.id)||"";Xe&&K(Xe)},[E,ht,H,tt]),p.useEffect(()=>()=>{var xe;(xe=S.current)==null||xe.abort(),S.current=null},[]),p.useEffect(()=>{const xe=window.setInterval(()=>{const Xe=Date.now();Ae(Xe),_(Yt=>oUt(Yt,Xe))},1e3);return()=>window.clearInterval(xe)},[]),p.useEffect(()=>{if(!N.some(Yt=>fg(Yt.state)))return;const xe=new AbortController,Xe=window.setInterval(()=>{AL(xe.signal).then(Yt=>{xe.signal.aborted||_(Yt),Le(""),Ie(!1)}).catch(Yt=>{xe.signal.aborted||(Le(Yt instanceof Error?Yt.message:String(Yt)),Ie(Yt instanceof sl&&Yt.retryable),Yt instanceof sl&&Yt.retryable||window.clearInterval(Xe))})},KBt);return()=>{xe.abort(),window.clearInterval(Xe)}},[N.some(xe=>fg(xe.state))]),p.useEffect(()=>{var tn;if(!Z||!fg(Z.state)&&((tn=Z.persistence)==null?void 0:tn.state)!=="saving")return;const xe=new AbortController;let Xe;const Yt=async()=>{var In;try{const mr=await _L(Z.id,xe.signal);if(xe.signal.aborted)return;_(jr=>Of(jr,mr)),Le(""),Ie(!1),(fg(mr.state)||((In=mr.persistence)==null?void 0:In.state)==="saving")&&(Xe=window.setTimeout(()=>void Yt(),NL))}catch(mr){if(xe.signal.aborted)return;Le(mr instanceof Error?mr.message:String(mr)),Ie(mr instanceof sl&&mr.retryable),mr instanceof sl&&mr.retryable&&(Xe=window.setTimeout(()=>void Yt(),NL))}};return Xe=window.setTimeout(()=>void Yt(),NL),()=>{xe.abort(),Xe!==void 0&&window.clearTimeout(Xe)}},[Z==null?void 0:Z.id,Z==null?void 0:Z.state,(aa=Z==null?void 0:Z.persistence)==null?void 0:aa.state]),p.useEffect(()=>{const xe=Fe.current;xe&&(xe.scrollTop=xe.scrollHeight,Pt())},[P,Fe,Pt]),p.useEffect(()=>{ot(null),bt(""),Pe(!1)},[Z==null?void 0:Z.id]),p.useEffect(()=>{if(!Z||!eie(Z))return;const xe=new AbortController;let Xe;const Yt=async()=>{Pe(!0);try{const tn=await RBt(Z.id,xe.signal);if(xe.signal.aborted)return;ot(tn),bt(""),!tn.complete&&fg(Z.state)&&(Xe=window.setTimeout(()=>void Yt(),Zne))}catch(tn){if(xe.signal.aborted)return;bt(y("activity.loadError")),fg(Z.state)&&tn instanceof sl&&tn.retryable&&(Xe=window.setTimeout(()=>void Yt(),Zne))}finally{xe.signal.aborted||Pe(!1)}};return Yt(),()=>{xe.abort(),Xe!==void 0&&window.clearTimeout(Xe)}},[Z==null?void 0:Z.id,Z==null?void 0:Z.state,(ws=Z==null?void 0:Z.analysisRef)==null?void 0:ws.sha256,(Ua=Z==null?void 0:Z.confirmation)==null?void 0:Ua.framework,y]),p.useEffect(()=>{if(!(Z!=null&&Z.analysis)||!Z.analysisRef||!["needs_input","analysis_ready"].includes(Z.state))return;const xe=`${Z.id}:${Z.analysisRef.attempt}:${Z.analysisRef.sha256}`;if(k.current===xe||(k.current=xe,Se({}),Z.state!=="analysis_ready"))return;const Xe=Z.analysis.recommended;Xe&&(J(Xe.framework),_e(Xe.entry||""),at(tie(Z.sourceFileName)))},[Z]),p.useEffect(()=>{if(He(null),Ce(""),ln(!1),Ue(!1),zt({}),!(Z!=null&&Z.artifact.previewReady))return;const xe=new AbortController;return MBt(Z.id,xe.signal).then(Xe=>{xe.signal.aborted||He(Xe)}).catch(Xe=>{xe.signal.aborted||(Ce(Xe instanceof Error?Xe.message:String(Xe)),ln(Xe instanceof sl&&Xe.retryable))}),()=>xe.abort()},[Z==null?void 0:Z.id,Z==null?void 0:Z.artifact.previewReady,cn]),p.useEffect(()=>{if(!ve)return;const xe=kFt(ve,e);zt(Xe=>{var tn;const Yt={...Xe};for(const[In,mr]of Object.entries(xe))(tn=Yt[In])!=null&&tn.trim()||(Yt[In]=mr);return Yt})},[ve,e]);function en(xe){if(!S.current&&(ke(""),!!xe)){if(!xe.name.toLowerCase().endsWith(".zip")){M(null),ke(y("upload.zipOnly"));return}if(xe.name.length>255||/[/\\\u0000-\u001f]/.test(xe.name)){M(null),ke(y("upload.invalidName"));return}if(xe.size>Bt){M(null),ke(y("upload.tooLarge",{size:Qe}));return}if(xe.size===0){M(null),ke(y("upload.empty"));return}M(xe)}}function Un(xe){var Yt;const Xe=(Yt=xe.currentTarget.files)==null?void 0:Yt[0];xe.currentTarget.value="",en(Xe)}async function wn(){if(!L||ae||S.current)return;const xe=new AbortController;S.current=xe;const Xe=()=>S.current===xe&&!xe.signal.aborted,Yt=`migration-v1-${crypto.randomUUID().replace(/-/g,"")}`;ue("create"),Ee(Date.now()),ke("");try{const tn=await jBt({taskId:Yt,sourceFileName:L.name,instruction:"",modelId:H||void 0,signal:xe.signal});if(!Xe())return;_(mr=>Of(mr,tn)),R(tn.id),ue("upload"),Ee(null);const In=await Xne(tn.id,L,xe.signal);if(!Xe())return;_(mr=>Of(mr,In)),M(null)}catch(tn){if(!Xe())return;const In=await pn(Yt,!1,xe.signal);if(!Xe())return;if(In){if(R(In.id),In.state!=="awaiting_upload"){M(null);return}}else if(await Jt(xe.signal),!Xe())return;ke(tn instanceof Error?tn.message:String(tn))}finally{S.current===xe&&(S.current=null,Ee(null),ue(""))}}async function oi(){if(!(Z!=null&&Z.canUpload)||!L||ae||S.current)return;const xe=new AbortController;S.current=xe;const Xe=()=>S.current===xe&&!xe.signal.aborted;ue("upload"),ke("");try{const Yt=await Xne(Z.id,L,xe.signal);if(!Xe())return;_(tn=>Of(tn,Yt)),M(null)}catch(Yt){if(!Xe())return;const tn=await pn(Z.id,!0,xe.signal);if(!Xe())return;if(tn&&tn.state!=="awaiting_upload"){M(null);return}ke(Yt instanceof Error?Yt.message:String(Yt))}finally{S.current===xe&&(S.current=null,ue(""))}}const Oi=p.useMemo(()=>{var xe;return(((xe=Z==null?void 0:Z.analysis)==null?void 0:xe.entries)??[]).filter(Xe=>Xe.framework===De).map(Xe=>({value:Xe.value,label:Xe.value,description:Xe.evidence}))},[De,(oa=Z==null?void 0:Z.analysis)==null?void 0:oa.entries]),mi=(((Qa=Z==null?void 0:Z.analysis)==null?void 0:Qa.questions)??[]).every(xe=>{var Xe;return!xe.required||!!((Xe=wt[xe.id])!=null&&Xe.trim())}),bn=nUt(Ze),qi=!!(Z!=null&&Z.canConfirm&&Z.analysisRef&&!ae&&!bn&&(!jL.has(De)||he.trim())),ri=!!(Z!=null&&Z.canAnswer&&Z.analysisRef&&!ae&&mi);async function zi(){if(!(!(Z!=null&&Z.analysisRef)||!ri)){ue("answer"),ke("");try{const xe=await PBt({taskId:Z.id,analysisAttempt:Z.analysisRef.attempt,analysisSha256:Z.analysisRef.sha256,inputSha256:Z.analysisRef.inputSha256,answers:wt});_(Xe=>Of(Xe,xe))}catch(xe){const Xe=await pn(Z.id);if(Xe&&Xe.state!=="needs_input")return;ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function as(){if(!(!(Z!=null&&Z.analysisRef)||!qi)){ue("confirm"),ke("");try{const xe=await IBt({taskId:Z.id,framework:De,entry:jL.has(De)?he.trim():void 0,appName:Ze.trim(),instruction:"",analysisAttempt:Z.analysisRef.attempt,analysisSha256:Z.analysisRef.sha256,inputSha256:Z.analysisRef.inputSha256});_(Xe=>Of(Xe,xe))}catch(xe){const Xe=await pn(Z.id);if(Xe&&Xe.state!=="analysis_ready")return;ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function Lr(){if(!(!(Z!=null&&Z.canStop)||ae)){ue("stop"),ke("");try{const xe=await DBt(Z.id);_(Xe=>Of(Xe,xe)),$e(!1)}catch(xe){const Xe=await pn(Z.id);if(Xe&&!Xe.canStop){$e(!1);return}ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}async function _r(){if(!(!(Z!=null&&Z.artifact.downloadReady)||ae)){ue("download"),ke("");try{await FBt(Z.id,VA(Z.sourceFileName))}catch(xe){ke(xe instanceof Error?xe.message:String(xe))}finally{ue("")}}}function xs(){var xe,Xe;A("new"),T(""),R(""),M(null),ke(""),Le(""),Ie(!1),He(null),Ce(""),ln(!1),Ue(!1),$e(!1),K(((xe=E==null?void 0:E.model)==null?void 0:xe.id.trim())||((Xe=ht[0])==null?void 0:Xe.id)||"")}const os=ve?{name:((Jn=Z==null?void 0:Z.confirmation)==null?void 0:Jn.app_name)||tie((Z==null?void 0:Z.sourceFileName)||"migration.zip"),files:[{path:"migration-result.json",content:`${JSON.stringify(ve,null,2)} `}]}:null,ia=ve?ve.environment.required.filter(cb).filter(kk).map(xe=>({key:xe,label:xe})):[],Nr=ve?[...ve.environment.required.filter(cb).filter(xe=>!kk(xe)).map(xe=>({key:xe,required:!0,comment:xe,placeholder:y("deployment.requiredPlaceholder",{key:xe})})),...ve.environment.optional.filter(cb).map(xe=>({key:xe,required:!1,comment:xe,placeholder:y("deployment.optionalPlaceholder",{key:xe})}))]:[];async function As(xe,Xe,Yt){if(!Z||!ve)throw new Error(y("deployment.notReady"));const tn=ut&&ut.mode!=="public"?{mode:ut.mode,vpc_id:ut.vpcId,subnet_ids:ut.subnetIds,enable_shared_internet_access:ut.enableSharedInternetAccess}:void 0;return Ax(xe.name,xe.files,{region:Ke,projectName:"default",network:tn},{...Yt,migrationTaskId:Z.id,onStage:Xe})}if(ye&&os&&Z&&ve)return o.jsx("div",{className:"migration-deployment",children:o.jsx(WI,{cloudProvider:e,project:os,agentName:os.name,onDeploy:As,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,network:ut,onNetworkChange:Gt,deployRegion:Ke,onDeployRegionChange:ft,deploymentEnv:Nr,requiredSecretEnv:ia,deploymentEnvValues:Rt,onDeploymentEnvChange:(xe,Xe)=>zt(Yt=>({...Yt,[xe]:Xe})),deploymentTelemetry:{source:"migration",createMode:"migration",aiAssisted:!0},onBack:()=>Ue(!1),backLabel:y("deployment.back"),deploymentPrimaryPane:o.jsxs("section",{className:"migration-deployment-summary",children:[o.jsx("strong",{children:y("artifact.title")}),o.jsx("span",{children:Z.sourceFileName}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:y("confirmation.framework")}),o.jsx("dd",{children:ve.migration.framework})]}),o.jsxs("div",{children:[o.jsx("dt",{children:y("artifact.startupFile")}),o.jsx("dd",{children:ve.startup.module})]}),o.jsxs("div",{children:[o.jsx("dt",{children:y("artifact.fileCountLabel")}),o.jsx("dd",{children:ve.files.length})]})]})]})})});const Vs=L,Yr=ae==="create"||ae==="upload",ra=!Z||Z.canUpload,sa=Z?aUt(Z,qe):null;return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"migration-workspace",children:[o.jsxs("aside",{className:"migration-history",children:[o.jsxs("header",{children:[o.jsx("button",{type:"button",className:"migration-icon-button",onClick:t,"aria-label":y("workspace.backToAddAgent"),title:y("common.back"),children:o.jsx(BBt,{})}),o.jsx("h1",{children:y("workspace.title")})]}),o.jsxs("button",{type:"button",className:"migration-new-button","aria-current":j==="new"&&!Z?"page":void 0,onClick:xs,disabled:Yr,children:[o.jsx(QBt,{}),o.jsx("span",{children:y("workspace.newMigration")})]}),o.jsxs("button",{type:"button",className:`migration-new-button${j==="projects"?" is-active":""}`,"aria-current":j==="projects"?"page":void 0,onClick:()=>A("projects"),disabled:Yr,children:[o.jsx(Xw,{}),o.jsx("span",{children:y("projects.title")})]}),o.jsx("div",{className:"migration-history__label",children:y("workspace.recent")}),o.jsx("nav",{"aria-label":y("workspace.sessionsAria"),children:W?o.jsx(xn,{children:y("workspace.loadingSessions")}):N.length===0?o.jsx("p",{className:"migration-history__empty",children:y("workspace.noSessions")}):N.map(xe=>o.jsxs("button",{type:"button",className:xe.id===P?"is-active":"","aria-current":j==="new"&&xe.id===P?"page":void 0,disabled:Yr,onClick:()=>{A("new"),R(xe.id),ke(""),Le(""),Ie(!1)},children:[o.jsx("span",{children:VA(xe.sourceFileName)}),o.jsxs("small",{children:[o.jsx("span",{"data-state":xe.state,children:ZBt(xe.state)}),o.jsx("time",{children:sUt(xe.createdAt)})]})]},xe.id))})]}),j==="projects"?o.jsx(WBt,{capabilities:l,capabilitiesLoading:c,preparationStage:u,optimizationError:d,initialProjectId:F,onOptimize:f,onCancelOptimization:h,onDownload:m,onDeploy:g}):o.jsxs("main",{className:"migration-main",children:[o.jsxs("header",{className:"migration-main__header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:Z?VA(Z.sourceFileName):y("workspace.heading")}),o.jsx("p",{children:Z?RL(Z):y("workspace.intro")})]}),Z?o.jsxs("div",{className:"migration-main__header-actions",children:[Z!=null&&Z.canStop?o.jsx("button",{type:"button",className:"migration-stop-button",onClick:()=>$e(!0),disabled:!!ae,children:y(ae==="stop"?"actions.stopping":"actions.stop")}):null,sa?o.jsxs("div",{className:"migration-ttl","aria-live":"off",children:[o.jsx("strong",{children:sa.title}),o.jsx("small",{children:sa.detail})]}):null]}):null]}),o.jsxs("div",{className:"migration-conversation",role:"log","aria-live":"polite",ref:Fe,onScroll:Pt,children:[!(E!=null&&E.enabled)&&!W?o.jsxs("div",{className:"migration-system-state is-error",role:"alert",children:[o.jsx("strong",{children:y("capability.unavailable")}),o.jsx("p",{children:jd(E==null?void 0:E.reason,O)||y("capability.defaultReason")})]}):null,Z?o.jsxs(o.Fragment,{children:[o.jsx("article",{className:"migration-turn is-user",children:o.jsxs("div",{className:"migration-user-message",children:[o.jsxs("span",{className:"migration-file-chip",children:[o.jsx(Xw,{}),o.jsx("span",{title:Z.sourceFileName,children:Z.sourceFileName})]}),Z.instruction?o.jsx("p",{children:Z.instruction}):null]})}),o.jsxs("article",{className:"migration-turn is-assistant",children:[o.jsx("div",{className:"migration-assistant-mark",children:"AI"}),o.jsxs("div",{className:"migration-assistant-content",children:[ae==="upload"?o.jsxs(o.Fragment,{children:[o.jsx(IL,{stage:"upload"}),o.jsx("p",{className:"migration-running-note",children:y("conversation.uploadThenAnalyze")})]}):Z.state==="analyzing"?o.jsxs(o.Fragment,{children:[o.jsx(IL,{stage:"analysis"}),o.jsx("p",{className:"migration-running-note",children:y("conversation.analyzing")})]}):fg(Z.state)?o.jsxs(o.Fragment,{children:[o.jsx(xn,{children:RL(Z)}),o.jsx("p",{className:"migration-running-note",children:y("conversation.migrationLocked")})]}):Z.state==="needs_input"&&Z.analysis?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:Z.analysis.summary}),o.jsx("p",{children:y("conversation.analysisPaused")}),(Ni=Z.analysis.frameworks[0])!=null&&Ni.evidence.length?o.jsxs("details",{className:"migration-analysis__evidence",children:[o.jsx("summary",{children:y("analysis.viewSourceEvidence")}),o.jsx("ul",{children:Z.analysis.frameworks.flatMap(xe=>xe.evidence.map(Xe=>o.jsxs("li",{children:[o.jsxs("code",{children:[Xe.path,":",Xe.line]}),o.jsx("span",{children:Xe.reason})]},`${xe.id}:${Xe.path}:${Xe.line}`)))})]}):null]}):Z.state==="analysis_ready"&&Z.analysis?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:y("conversation.analysisComplete")}),o.jsx(uUt,{analysis:Z.analysis})]}):Z.state==="awaiting_upload"?o.jsx("p",{children:y("conversation.awaitingUpload")}):Z.state==="expired"?o.jsxs("div",{className:"migration-expired",children:[o.jsx("strong",{children:y("conversation.expiredTitle")}),o.jsx("p",{children:y("conversation.expiredDescription")})]}):Z.state==="failed"?((Eo=Z.error)==null?void 0:Eo.code)==="MIGRATION_ANALYSIS_UNSUPPORTED"&&Z.analysis?o.jsxs("div",{className:"migration-system-state is-error",children:[o.jsx("strong",{children:y("conversation.unsupportedTitle")}),o.jsx(Bu,{text:Z.analysis.summary,allowRawHtml:!1}),Z.analysis.warnings.length>0?o.jsx("ul",{children:Z.analysis.warnings.map(xe=>o.jsx("li",{children:xe},xe))}):null,o.jsx("p",{children:y("conversation.unsupportedHint")})]}):o.jsxs("div",{className:"migration-system-state is-error",children:[o.jsx("strong",{children:y("conversation.failedTitle")}),o.jsx("p",{children:Z.message})]}):Z.state==="cancelled"?o.jsx("p",{children:y("conversation.cancelled")}):o.jsx("p",{children:RL(Z)}),eie(Z)&&(gt||jt!=null&&jt.available||Et)?o.jsx(dUt,{activity:jt,loading:gt,error:Et,analyzing:Z.state==="analyzing"}):null]})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("article",{className:"migration-turn is-assistant",children:[o.jsx("div",{className:"migration-assistant-mark",children:"AI"}),o.jsxs("div",{children:[o.jsx("p",{children:y("conversation.requestZip")}),o.jsx("small",{children:y("conversation.zipHint",{size:Qe})})]})]}),ae==="create"&&L?o.jsxs(o.Fragment,{children:[o.jsx("article",{className:"migration-turn is-user",children:o.jsx("div",{className:"migration-user-message",children:o.jsxs("span",{className:"migration-file-chip",children:[o.jsx(Xw,{}),o.jsx("span",{title:L.name,children:L.name})]})})}),o.jsxs("article",{className:"migration-turn is-assistant",children:[o.jsx("div",{className:"migration-assistant-mark",children:"AI"}),o.jsxs("div",{className:"migration-assistant-content",children:[o.jsx(IL,{stage:"session"}),o.jsx(xn,{as:"strong",children:y("conversation.creatingSandbox")}),o.jsx("p",{className:"migration-running-note",children:y("conversation.initializing")}),o.jsx("small",{children:y("conversation.elapsed",{duration:rUt(vt)})})]})]})]}):null]}),(Z==null?void 0:Z.state)==="needs_input"&&Z.analysis?o.jsxs("section",{className:"migration-confirmation","aria-label":y("questions.ariaLabel"),children:[o.jsxs("div",{className:"migration-confirmation__heading",children:[o.jsx("strong",{children:y("questions.title")}),o.jsx("span",{children:y("questions.description")})]}),Z.analysis.questions.map(xe=>o.jsxs("label",{className:"migration-field",children:[o.jsxs("span",{children:[xe.prompt,xe.required?o.jsx("b",{"aria-hidden":"true",children:"*"}):null]}),o.jsx("textarea",{value:wt[xe.id]||"",maxLength:4e3,required:xe.required,"aria-required":xe.required,onChange:Xe=>{const Yt=Xe.currentTarget.value;Se(tn=>({...tn,[xe.id]:Yt}))},disabled:!!ae})]},xe.id)),o.jsx("div",{className:"migration-confirmation__actions",children:o.jsx("button",{type:"button",className:"migration-primary-button",onClick:()=>void zi(),disabled:!ri,children:y(ae==="answer"?"questions.submitting":"questions.submit")})})]}):null,(Z==null?void 0:Z.state)==="analysis_ready"&&Z.analysis?o.jsxs("section",{className:"migration-confirmation","aria-label":y("confirmation.ariaLabel"),children:[o.jsxs("div",{className:"migration-confirmation__heading",children:[o.jsx("strong",{children:y("confirmation.title")}),o.jsx("span",{children:y("confirmation.description")})]}),o.jsxs("div",{className:"migration-confirmation__grid",children:[o.jsx(fh,{label:y("confirmation.framework"),value:De,options:((E==null?void 0:E.frameworks)??[]).map(xe=>({value:xe,label:lIe(xe)})),onChange:xe=>{var tn;const Xe=xe;J(Xe);const Yt=(tn=Z.analysis)==null?void 0:tn.entries.find(In=>In.framework===Xe);_e((Yt==null?void 0:Yt.value)||"")},placeholder:y("confirmation.frameworkPlaceholder"),disabled:!!ae}),o.jsxs("label",{className:"migration-field",children:[o.jsxs("span",{children:[y("confirmation.agentName"),o.jsx("b",{"aria-hidden":"true",children:"*"})]}),o.jsx("input",{value:Ze,onChange:xe=>at(xe.currentTarget.value),maxLength:63,required:!0,disabled:!!ae,"aria-invalid":!!bn,"aria-required":"true"}),bn?o.jsx("small",{role:"alert",children:bn}):null]}),jL.has(De)?Oi.length>0?o.jsx(fh,{label:y("confirmation.entry"),value:he,options:Oi,onChange:_e,placeholder:y("confirmation.entryPlaceholder"),disabled:!!ae}):o.jsxs("label",{className:"migration-field",children:[o.jsxs("span",{children:[y("confirmation.entry"),o.jsx("b",{"aria-hidden":"true",children:"*"})]}),o.jsx("input",{value:he,onChange:xe=>_e(xe.currentTarget.value),placeholder:y("confirmation.entryExample"),maxLength:512,required:!0,disabled:!!ae,"aria-required":"true"})]}):null]}),o.jsx("p",{className:"migration-running-note",children:y("confirmation.consent")}),o.jsx("div",{className:"migration-confirmation__actions",children:o.jsx("button",{type:"button",className:"migration-primary-button",onClick:()=>void as(),disabled:!qi,children:y(ae==="confirm"?"confirmation.starting":"confirmation.start")})})]}):null,Z&&eUt(Z.state)&&Z.artifact.previewReady?o.jsxs("section",{className:"migration-result",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:y("artifact.title")}),o.jsx("span",{children:((xa=Z.persistence)==null?void 0:xa.state)==="saved"?y("artifact.saved"):((Xi=Z.persistence)==null?void 0:Xi.state)==="saving"?y("artifact.saving"):Z.artifact.deployReady?y("artifact.deployReady"):y("artifact.deployUnavailable")})]}),o.jsxs("div",{className:"migration-result__actions",children:[((Co=Z.persistence)==null?void 0:Co.state)==="saved"?o.jsx("button",{type:"button",onClick:()=>{var xe;T(((xe=Z.persistence)==null?void 0:xe.projectId)??""),A("projects")},children:o.jsx("span",{children:y("artifact.viewProjects")})}):null,o.jsxs("button",{type:"button",onClick:()=>void _r(),disabled:!Z.artifact.downloadReady||!!ae,children:[o.jsx(UBt,{}),o.jsx("span",{children:y(ae==="download"?"artifact.downloading":"artifact.downloadZip")})]}),o.jsxs("button",{type:"button",className:"is-primary",onClick:()=>Ue(!0),disabled:!Z.artifact.deployReady||!ve,title:Z.artifact.deployReady?y("artifact.deployTitle"):y("artifact.deployUnavailableTitle"),children:[o.jsx(zBt,{}),o.jsx("span",{children:y("artifact.deployRuntime")})]})]})]}),Z.persistence&&["failed","unavailable"].includes(Z.persistence.state)?o.jsx("div",{className:"migration-system-state is-error",role:"alert",children:o.jsx("p",{children:Z.persistence.message})}):null,Je?o.jsxs("div",{className:"migration-system-state is-error",role:"alert",children:[o.jsx("p",{children:Je}),Wt?o.jsx("button",{type:"button",className:"migration-retry-button",onClick:()=>{Ce(""),ln(!1),Ot(xe=>xe+1)},children:y("actions.reload")}):null]}):ve?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"migration-result__summary",children:[o.jsx("span",{children:y("artifact.fileCount",{count:ve.files.length})}),o.jsxs("span",{children:["CLI ",ve.cli.version]}),o.jsx("span",{children:y("artifact.startup",{module:ve.startup.module})}),o.jsx("span",{children:JBt(ve.verification.status)})]}),o.jsx(fUt,{task:Z,artifact:ve})]}):o.jsx(xn,{children:y("artifact.loading")})]}):null,st?o.jsxs("div",{className:"migration-inline-error",role:"alert",children:[o.jsx("span",{children:jd(st,O)||y("errors.refreshFailed")}),Me?o.jsx("button",{type:"button",onClick:()=>{Z&&(Le(""),Ie(!1),_L(Z.id).then(xe=>_(Xe=>Of(Xe,xe))).catch(xe=>{Le(xe instanceof Error?xe.message:String(xe)),Ie(xe instanceof sl&&xe.retryable)}))},children:y("actions.refreshStatus")}):null]}):null,Oe?o.jsxs("div",{className:"migration-inline-error",role:"alert",children:[o.jsx("span",{children:jd(Oe,O)||y("errors.loadFailed")}),o.jsx("button",{type:"button",onClick:()=>ke(""),"aria-label":y("errors.closeAria"),children:o.jsx(Yne,{})})]}):null]}),ra&&(E!=null&&E.enabled)?o.jsxs("div",{className:"migration-composer",children:[o.jsxs("div",{className:`migration-composer__box${re?" is-dragging":""}`,onDragEnter:xe=>{xe.preventDefault(),!Yr&&ge(!0)},onDragOver:xe=>{xe.preventDefault(),xe.dataTransfer.dropEffect=Yr?"none":"copy"},onDragLeave:xe=>{xe.currentTarget.contains(xe.relatedTarget)||ge(!1)},onDrop:xe=>{var Xe;xe.preventDefault(),ge(!1),!Yr&&en((Xe=xe.dataTransfer.files)==null?void 0:Xe[0])},children:[o.jsx("div",{className:"migration-composer__content",children:Vs?o.jsxs("div",{className:"migration-composer__file",children:[o.jsx(Xw,{}),o.jsx("span",{children:Vs.name}),o.jsx("small",{children:hj(Vs.size)}),o.jsx("button",{type:"button",onClick:()=>M(null),"aria-label":y("upload.removeAria"),disabled:Yr,children:o.jsx(Yne,{})})]}):o.jsx("p",{children:y(Z?"upload.reselectPrompt":"upload.selectPrompt")})}),o.jsxs("div",{className:"migration-composer__actions",children:[o.jsxs("div",{className:"migration-composer__tools",children:[o.jsxs("button",{type:"button",className:"migration-attach-button",onClick:()=>{var xe;return(xe=w.current)==null?void 0:xe.click()},disabled:Yr,children:[o.jsx(VBt,{}),o.jsx("span",{children:y(L?"upload.reselect":"upload.selectZip")})]}),o.jsx("div",{className:"migration-composer__model-select",children:o.jsx(fh,{label:y("model.label"),hideLabel:!0,value:pe,options:We,onChange:K,placeholder:y("model.placeholder"),searchable:!0,loading:Q,error:B,disabled:Yr||!!Z,onRetry:()=>se(xe=>xe+1)})})]}),o.jsx("button",{type:"button",className:"migration-confirm-upload-button",onClick:()=>void(Z?oi():wn()),disabled:!L||Yr,children:y(Z?"upload.continue":"upload.start")})]}),o.jsx("input",{ref:w,type:"file",accept:".zip,application/zip",onChange:Un,"aria-label":y("upload.inputAria"),disabled:Yr})]}),o.jsx("p",{children:y("upload.retention")})]}):null]})]}),Mt&&Z?o.jsx(pc,{title:y("stopDialog.title"),description:y("stopDialog.description"),confirmLabel:y(ae==="stop"?"actions.stopping":"actions.stop"),variant:"danger",busy:ae==="stop",onCancel:()=>$e(!1),onConfirm:()=>void Lr()}):null]})}const cIe=1,pUt="MODEL_AGENT_API_KEY",uIe="WorkspaceDraftError";function B8(e){const t=new Error($t(e));return t.name=uIe,t}function pj(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mUt(e){return pj(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&(e.creationMode===void 0||e.creationMode==="quick"||e.creationMode==="traditional")&&pj(e.draft)}function PL(e){return e.creationMode?e.creationMode:e.draft.dynamicAgentDelegation===!0?"quick":"traditional"}function YI(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function U8(e,t,n){const i=e.deployment,r=i==null?void 0:i.envValues,s=i?{...i,...r?{envValues:Object.fromEntries(Object.entries(r).filter(([a])=>a!==pUt&&!t.has(a)))}:{}}:void 0;return{...e,...e.mcpTools?{mcpTools:e.mcpTools.map(a=>{if(!a.authTokenEnv||!n.has(a.authTokenEnv))return a;const l={...a};return delete l.authTokenEnv,l})}:{},...s?{deployment:s}:{},subAgents:e.subAgents.map(a=>U8(a,t,n)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(a=>({...a,agent:U8(a.agent,t,n)}))}}:{}}}function Q8(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)=>Q8(n,t.subAgents[i]??n)),...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map((n,i)=>{var r,s;return{...n,agent:Q8(n.agent,((s=(r=t.workflow)==null?void 0:r.nodes[i])==null?void 0:s.agent)??n.agent)}})}}:{}}}function gUt(e){const t=KE(e),n=Q8(t.draft,e);return U8(n,new Set(GRe(t.draft)),new Set(Object.keys(t.envValues)))}function dIe(e){return{...e,draft:gUt(e.draft)}}function bUt(e){const t=Array.isArray(e)?e:pj(e)&&e.version===cIe?e.drafts:void 0;if(!Array.isArray(t)||!t.every(mUt))throw pj(e)&&typeof e.version=="number"?B8("helpers.drafts.unsupportedVersion"):B8("helpers.drafts.invalidFormat");return t.map(dIe)}function yUt(e,t){if(!t)return[];const n=e.getItem(YI(t));if(!n)return[];try{return bUt(JSON.parse(n))}catch(i){throw i instanceof Error&&i.name===uIe?i:B8("helpers.drafts.readFailed")}}function nie(e,t,n){if(!t)return;const i={version:cIe,drafts:n.map(dIe)};try{e.setItem(YI(t),JSON.stringify(i))}catch(r){throw r instanceof DOMException&&(r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error($t("helpers.drafts.quotaExceeded")):new Error($t("helpers.drafts.writeRejected"))}}const vUt=/[;;]/;function xUt(e){const t=new Set;for(const n of e)for(const i of n.split(vUt)){const r=i.trim();r&&t.add(r)}return[...t]}function wUt(e){return[]}const OUt=3*60*1e3,SUt=3e3,kUt=10*60*1e3,EUt=45e3,mj="veadk.studio.pending-update",yz="veadk.studio.update-handoff",fIe=["permissions","resolving","downloading","preparing","provisioning","scheduler","submitting","publishing"];function DL(e,t,n=!1){const i=n&&fIe.includes(e)?`studioUpdate.steps.${e}`:`studioUpdate.stages.${e}`;return t(i,{defaultValue:e||t("studioUpdate.stages.unknown")})}function CUt(e,t){return e<60?t("studioUpdate.duration.seconds",{count:e}):t("studioUpdate.duration.minutesSeconds",{minutes:Math.floor(e/60),seconds:e%60})}function TUt(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function AUt(e){return!!(e!=null&&e.some(t=>t.includes("部署应用成功")||t.toLowerCase().includes("application deployed successfully")))}function _Ut(){if(typeof window>"u")return null;const e=window.localStorage.getItem(mj);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.targetVersion=="string"&&typeof t.startedAt=="number")return{targetVersion:t.targetVersion,startedAt:t.startedAt}}catch{}return window.localStorage.removeItem(mj),null}function ML(e,t){window.localStorage.setItem(mj,JSON.stringify({targetVersion:e,startedAt:t}))}function pw(){window.localStorage.removeItem(mj)}function NUt(){return typeof window>"u"?"":window.sessionStorage.getItem(yz)??""}function jUt(e){window.sessionStorage.setItem(yz,e)}function iie(){window.sessionStorage.removeItem(yz)}function rie({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function RUt(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function IUt(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function z8(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 3.75H3.5v8.75h8.75V9.75"}),o.jsx("path",{d:"M8.5 3.5h4v4"}),o.jsx("path",{d:"m7.25 8.75 5-5"})]})}function sie({href:e}){const{t}=Te("ui");return o.jsxs("div",{className:"studio-update-permission-notice",role:"status",children:[o.jsxs("p",{children:[t("studioUpdate.logPermissionPrefix"),o.jsx("code",{children:"vefaas:GetApplicationRevisionLog"}),t("studioUpdate.logPermissionSuffix")]}),o.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",children:[t("studioUpdate.openIamConsole"),o.jsx(z8,{})]})]})}function aie({lines:e,phase:t,copyState:n,onCopy:i}){const{t:r}=Te("ui"),s=p.useRef(null),a=p.useRef(!0),[l,c]=p.useState(e);return p.useEffect(()=>{e.length&&c(e)},[e]),p.useEffect(()=>{const u=s.current;u&&a.current&&(u.scrollTop=u.scrollHeight)},[l]),o.jsxs("section",{className:"studio-update-live-log","aria-label":r("studioUpdate.deploymentProgress"),children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),r("studioUpdate.deploymentProgress"),o.jsx("small",{children:r(t==="active"?"studioUpdate.live":t==="complete"?"studioUpdate.completed":"studioUpdate.stopped")})]}),o.jsx("button",{type:"button",onClick:()=>i(l),disabled:!l.length,children:r(n==="copied"?"studioUpdate.copied":n==="error"?"studioUpdate.copyFailed":"studioUpdate.copyLog")})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off","aria-busy":t==="active",tabIndex:0,onScroll:u=>{const d=u.currentTarget;a.current=d.scrollHeight-d.scrollTop-d.clientHeight<24},children:l.length?l.map((u,d)=>o.jsx("div",{children:u},`${d}-${u}`)):o.jsx("p",{children:r(t==="active"?"studioUpdate.waitingForLogs":"studioUpdate.noLogs")})})]})}function PUt({variant:e="default"}){var Q,q;const{t}=Te("ui"),[n]=p.useState(_Ut),[i,r]=p.useState(null),[s,a]=p.useState(n?"submitting":"idle"),[l,c]=p.useState(!!n),[u,d]=p.useState(""),[f,h]=p.useState(null),[m,g]=p.useState((n==null?void 0:n.targetVersion)??""),[b,v]=p.useState(!1),[y,x]=p.useState("idle"),[O,w]=p.useState(0),k=p.useRef(null),S=p.useRef((n==null?void 0:n.targetVersion)??""),E=p.useRef((n==null?void 0:n.startedAt)??0),C=p.useRef(NUt()),N=p.useRef(0);p.useEffect(()=>{if(!b)return;const B=le=>{var se;le.target instanceof Node&&!((se=k.current)!=null&&se.contains(le.target))&&v(!1)},ee=le=>{le.key==="Escape"&&v(!1)};return window.addEventListener("pointerdown",B),window.addEventListener("keydown",ee),()=>{window.removeEventListener("pointerdown",B),window.removeEventListener("keydown",ee)}},[b]);const _=p.useCallback(async()=>{const B=await z0e(S.current||void 0,E.current||void 0);return r(B),B},[]);if(p.useEffect(()=>{let B=!0;const ee=()=>{_().catch(()=>{B&&r(se=>se)})};ee();const le=window.setInterval(ee,OUt);return()=>{B=!1,window.clearInterval(le)}},[_]),p.useEffect(()=>{if(s!=="submitting")return;const B=window.setInterval(()=>{_().then(ee=>{const le=S.current;if(le&&TUt(ee.currentVersion,le)||!le&&!ee.available&&ee.latestVersion){const se=Date.now();if(N.current||(N.current=se),ee.updateLogsVisible!==!1&&!AUt(ee.updateLogs)&&se-N.currentkUt&&(window.clearInterval(B),pw(),a("error"),d(t("studioUpdate.messages.timeout")))}).catch(()=>{})},SUt);return()=>window.clearInterval(B)},[s,_,t]),p.useEffect(()=>{s!=="idle"||(i==null?void 0:i.state)!=="updating"||(S.current=i.targetVersion,E.current=i.startedAt||Date.now(),ML(i.targetVersion,E.current),g(i.targetVersion),a("submitting"))},[s,i]),p.useEffect(()=>{if(s!=="submitting"){w(0);return}const B=()=>{const le=E.current||Date.now();w(Math.max(0,Math.floor((Date.now()-le)/1e3)))};B();const ee=window.setInterval(B,1e3);return()=>window.clearInterval(ee)},[s]),!(i!=null&&i.enabled)||!(i.available||i.state==="updating"||s!=="idle"))return null;const A=i.releases??[],F=m||((Q=A[0])==null?void 0:Q.version)||i.latestVersion,T=A.find(B=>B.version===F),P=xUt((T==null?void 0:T.changelog)??[]),R=async()=>{iie(),C.current="",S.current=F,E.current=Date.now(),a("checking-permissions"),d(""),x("idle");try{const B=await V0e();if(h(B),!B.ready){pw(),a("permission");return}h(null),ML(F,E.current),a("submitting");const ee=await H0e(F);S.current=ee.version,ML(ee.version,E.current),d(t("studioUpdate.messages.submitted"))}catch(B){if(B instanceof TypeError||B instanceof Error&&(B.name==="TimeoutError"||B.name==="AbortError")){d(t("studioUpdate.messages.connectionSwitched"));return}pw(),a("error");const ee=B instanceof Error?B.message:t("studioUpdate.messages.failed");try{const le=await _();d(le.message||ee)}catch{d(ee)}}},L=(q=i.updateLogs)!=null&&q.length?i.updateLogs:(i.errorLog||i.progressMessage||u).split(` `).filter(Boolean),M=fIe.map(B=>({id:B,label:DL(B,t,!0)})),U=M.findIndex(B=>B.id===i.progressStage),I=s==="submitting"&&i.progressStage!=="idle"&&U<0,H=async B=>{try{await navigator.clipboard.writeText(B.join(` `)),x("copied")}catch{x("error")}},K=()=>{var B;v(!1),x("idle"),d(""),h(null),g(S.current||((B=A[0])==null?void 0:B.version)||""),a("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:e==="feature-link"?"welcome-feature-link studio-update-trigger--feature":`studio-update-trigger is-${s}`,title:s==="checking-permissions"?t("studioUpdate.checkingPermissions"):s==="permission"?t("studioUpdate.authorizationRequired"):s==="submitting"?t("studioUpdate.updating"):s==="published"?t("studioUpdate.updated"):t("studioUpdate.updateToVersion",{version:i.latestVersion}),onClick:()=>{var B;s==="published"?window.location.reload():(s==="checking-permissions"||s==="permission"||s==="submitting"||s==="error"||(g(((B=A[0])==null?void 0:B.version)||i.latestVersion),a("confirm")),c(!0))},children:[e!=="feature-link"&&o.jsx(rie,{className:"studio-update-icon"}),s==="checking-permissions"?o.jsx(xn,{as:"span",children:t("studioUpdate.checkPermissions")}):s==="permission"?o.jsx("span",{children:t("studioUpdate.authorizationNeeded")}):s==="submitting"?o.jsx(xn,{as:"span",children:t("studioUpdate.updatingShort")}):s==="published"?o.jsx("span",{children:t("studioUpdate.refreshForNewVersion")}):s==="error"?o.jsx("span",{children:t("studioUpdate.updateFailed")}):e==="feature-link"?o.jsx("span",{children:t("studioUpdate.updateNow")}):o.jsx("span",{children:t("studioUpdate.newVersionAvailable")})]}),l&&s!=="idle"&&Li.createPortal(o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:`confirm-box studio-update-dialog${s==="submitting"||s==="published"||s==="error"?" is-progress":""}`,role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(rie,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:t(s==="error"?"studioUpdate.dialog.failed":s==="checking-permissions"?"studioUpdate.dialog.checkingPermissions":s==="permission"?"studioUpdate.dialog.authorizationRequired":s==="submitting"?"studioUpdate.dialog.updating":s==="published"?"studioUpdate.dialog.completed":"studioUpdate.dialog.newVersion")}),s==="checking-permissions"?o.jsxs("div",{className:"studio-update-permission-checking",role:"status",children:[o.jsx(xn,{as:"p",children:t("studioUpdate.permissionCheck")}),o.jsx("p",{children:t("studioUpdate.permissionCheckHint")})]}):s==="permission"&&f?o.jsxs("div",{className:"studio-update-authorization-panel",children:[o.jsx("p",{className:"confirm-text",children:t("studioUpdate.missingPermissionCount",{count:f.missingActions.length})}),o.jsxs("dl",{className:"studio-update-authorization-principal",children:[o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.functionRole")}),o.jsx("dd",{children:f.principalName||t("studioUpdate.currentRole")})]}),f.policyName&&o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.policyToUpdate")}),o.jsx("dd",{children:f.policyName})]})]}),o.jsxs("ol",{className:"studio-update-authorization-steps",children:[o.jsx("li",{children:t("studioUpdate.authorizationSteps.open")}),o.jsx("li",{children:t("studioUpdate.authorizationSteps.debug")}),o.jsx("li",{children:t("studioUpdate.authorizationSteps.return")})]}),o.jsxs("div",{className:"studio-update-missing-actions",children:[o.jsx("span",{children:t("studioUpdate.missingPermissions")}),o.jsx("ul",{children:f.missingActions.map(B=>o.jsx("li",{children:o.jsx("code",{children:B})},B))})]}),o.jsxs("a",{className:"studio-update-authorization-link",href:f.authorizationUrl||f.iamConsoleUrl,target:"_blank",rel:"noreferrer",children:[f.authorizationUrl?t("studioUpdate.openPrefilledAuthorization"):t("studioUpdate.openIamManually"),o.jsx(z8,{})]}),!f.authorizationUrl&&o.jsx("p",{className:"studio-update-authorization-note",children:t("studioUpdate.noSafePolicy")})]}):s==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:u}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.failedStage")}),o.jsx("dd",{children:DL(i.errorStage,t)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.errorId")}),o.jsx("dd",{children:i.errorId||t("studioUpdate.notGenerated")})]})]}),i.updateLogsVisible!==!1&&o.jsx(aie,{lines:L,phase:"error",copyState:y,onCopy:B=>void H(B)}),i.updateLogsVisible===!1&&o.jsx(sie,{href:i.permissionConsoleUrl}),i.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:i.consoleUrl,target:"_blank",rel:"noreferrer",children:[t("studioUpdate.openFunctionLogs"),o.jsx(z8,{})]})]}):s==="submitting"||s==="published"?o.jsxs("div",{className:"studio-update-progress-body",children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:t("studioUpdate.targetVersion")}),o.jsx("strong",{children:S.current||F})]}),o.jsxs("div",{children:[o.jsx("span",{children:t(s==="published"?"studioUpdate.updateStatus":"studioUpdate.elapsed")}),o.jsx("strong",{children:s==="published"?t("studioUpdate.completed"):CUt(O,t)})]})]}),o.jsxs("ol",{className:"studio-update-progress","aria-label":t("studioUpdate.progressAriaLabel"),children:[I&&o.jsxs("li",{className:"is-active","aria-current":"step",children:[o.jsx("span",{className:"studio-update-progress-dot","aria-hidden":!0}),o.jsxs("div",{children:[o.jsx("span",{children:DL(i.progressStage,t)||t("studioUpdate.processingUpdate")}),o.jsx(xn,{as:"small",children:i.progressMessage||u||t("studioUpdate.processing")})]})]}),M.map((B,ee)=>{const le=s==="published"||eevoid H(B)}),i.updateLogsVisible===!1&&o.jsx(sie,{href:i.permissionConsoleUrl}),o.jsx("p",{className:"studio-update-progress-note",children:t("studioUpdate.backgroundHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:t("studioUpdate.confirmDescription")}),o.jsxs("div",{className:"studio-update-field",ref:k,children:[o.jsx("span",{children:t("studioUpdate.selectVersion")}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":t("studioUpdate.selectVersion"),"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>v(B=>!B),onKeyDown:B=>{(B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),v(!0))},children:[o.jsx("span",{children:F}),o.jsx(RUt,{})]}),b&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":t("studioUpdate.selectVersion"),children:A.map(B=>{const ee=B.version===F;return o.jsxs("button",{type:"button",role:"option","aria-selected":ee,className:`studio-update-version-option${ee?" is-selected":""}`,onClick:()=>{g(B.version),v(!1)},children:[o.jsx("span",{children:B.version}),ee&&o.jsx(IUt,{})]},B.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.currentVersion")}),o.jsx("dd",{children:i.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.targetVersion")}),o.jsx("dd",{children:F})]}),o.jsxs("div",{children:[o.jsx("dt",{children:t("studioUpdate.commit")}),o.jsx("dd",{children:((T==null?void 0:T.gitSha)||i.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:t("studioUpdate.changelog")}),P.length?o.jsx("ul",{children:P.map(B=>o.jsx("li",{children:B},B))}):o.jsx("p",{children:t("studioUpdate.noChangelog")})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{c(!1),v(!1),s==="confirm"&&(a("idle"),d(""))},children:t(s==="submitting"?"studioUpdate.runInBackground":s==="confirm"?"common.cancel":"common.close")}),s==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:t("studioUpdate.updateNow")}),s==="permission"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:t("studioUpdate.authorizedRecheck")}),s==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:K,children:t("studioUpdate.tryAgain")})]})]})}),document.body)]})}const oie=wUt();function DUt({canUpdate:e=!1}){const{t}=Te("newChat"),n=oie.length?oie:[t("featureNotice.defaultNotes.multiRegion"),t("featureNotice.defaultNotes.switchAgent"),t("featureNotice.defaultNotes.visualCanvas")];return o.jsxs("div",{className:"welcome-feature-pill",children:[o.jsx("span",{children:t("featureNotice.badge")}),o.jsx("span",{className:"welcome-feature-divider","aria-hidden":"true"}),o.jsx("button",{type:"button",className:"welcome-feature-link","aria-describedby":"welcome-feature-popover",children:t("featureNotice.view")}),o.jsxs("section",{id:"welcome-feature-popover",className:"welcome-feature-popover",role:"tooltip",children:[o.jsx("strong",{children:t("featureNotice.title")}),o.jsx("ul",{children:n.map(i=>o.jsx("li",{children:i},i))})]}),e&&o.jsx(PUt,{variant:"feature-link"})]})}const MUt=1e4;async function hIe(e,t){const n=await fetch(Uo(e),{headers:Hu(Dh({Accept:"application/json"})),signal:Ol(t,MUt)});if(!n.ok)throw new Error(V("newChatCapabilities.loadFailed",{status:n.status}));const i=await n.json();if(typeof i.enabled!="boolean")throw new Error(V("newChatCapabilities.invalidResponse"));return{enabled:i.enabled,reason:typeof i.reason=="string"?i.reason:void 0,endpointExportEnabled:i.endpointExportEnabled===!0,persistentEnabled:i.persistentEnabled===!0,persistentReason:typeof i.persistentReason=="string"?i.persistentReason:void 0,persistentRequired:i.persistentRequired===!0,storageMode:i.storageMode==="disk"?"disk":"snapshot",diskGbDefault:typeof i.diskGbDefault=="number"?i.diskGbDefault:void 0,diskGbMin:typeof i.diskGbMin=="number"?i.diskGbMin:void 0,diskGbMax:typeof i.diskGbMax=="number"?i.diskGbMax:void 0}}async function pIe(e){return hIe("/web/sandbox/capabilities",e)}async function mIe(e,t){return hIe(`/web/${e}/capabilities`,t)}function LUt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function $Ut(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3.5v11m-4-4 4 4 4-4"}),o.jsx("path",{d:"M5 19.5h14"})]})}function lie(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"8",cy:"8",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.22"}),o.jsx("path",{d:"M8 2.5A5.5 5.5 0 0 1 13.5 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function FUt({open:e,task:t,onClose:n,onRetry:i,onDownload:r}){const{t:s,i18n:a}=Te("newChat"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),[f,h]=p.useState(()=>Date.now()),m=p.useRef(n);if(m.current=n,p.useEffect(()=>{if(!e||!t)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const C=document.body.style.overflow;document.body.style.overflow="hidden";const N=window.requestAnimationFrame(()=>{var j;return(j=u.current)==null?void 0:j.focus()}),_=j=>{var P;if(j.key==="Escape"){j.preventDefault(),m.current();return}if(j.key!=="Tab")return;const A=Array.from(((P=c.current)==null?void 0:P.querySelectorAll('button:not(:disabled), a[href], video[controls], [tabindex]:not([tabindex="-1"])'))??[]);if(A.length===0)return;const F=A[0],T=A[A.length-1];if(document.activeElement===u.current){j.preventDefault(),(j.shiftKey?T:F).focus();return}j.shiftKey&&document.activeElement===F?(j.preventDefault(),T.focus()):!j.shiftKey&&document.activeElement===T&&(j.preventDefault(),F.focus())};return window.addEventListener("keydown",_),()=>{var j;window.cancelAnimationFrame(N),document.body.style.overflow=C,window.removeEventListener("keydown",_),(j=d.current)!=null&&j.isConnected&&d.current.focus()}},[e,t==null?void 0:t.localId]),p.useEffect(()=>{if(!e||(t==null?void 0:t.status)!=="generating"||t.generationStartedAt===null)return;const C=()=>h(Date.now());C();const N=window.setInterval(C,1e3);return()=>window.clearInterval(N)},[e,t==null?void 0:t.localId,t==null?void 0:t.runId,t==null?void 0:t.status,t==null?void 0:t.generationStartedAt]),!e||!t)return null;const g=a.resolvedLanguage??a.language,b=mRe(t,g),v=t.status==="optimizing"||t.status==="generating",y=t.errorStage==="optimization"?s("video.task.retryOptimization"):s("video.task.retryGeneration"),x=pRe(t.resolvedMode??t.requestedMode,g),O=t.error.includes("尚未开通"),w=t9t(t,g),k=t.generationStartedAt===null?"":e9t(f-t.generationStartedAt,g),S=t.providerStatus==="queued"?s("video.task.providerQueued"):t.providerStatus==="running"?s("video.task.providerRunning"):s("video.task.providerSubmitting"),E=t.providerStatus==="queued"?s("video.task.queuedHint"):s("video.task.runningHint");return Li.createPortal(o.jsx("div",{className:"new-chat-video-task-backdrop",onMouseDown:C=>{C.target===C.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`new-chat-video-task-dialog is-${t.status}`,role:"dialog","aria-modal":"true","aria-labelledby":l,"aria-busy":v||void 0,children:[o.jsxs("header",{className:"new-chat-video-task-dialog__head",children:[o.jsxs("div",{children:[o.jsx("h2",{ref:u,id:l,tabIndex:-1,children:s("video.task.title")}),o.jsxs("p",{children:[x," · ",t.generationModel]})]}),o.jsx("button",{type:"button",className:"new-chat-video-task-dialog__close",onClick:n,"aria-label":s("video.task.closeAria"),children:o.jsx(LUt,{})})]}),o.jsxs("div",{className:"new-chat-video-task-dialog__body",children:[o.jsx("ol",{className:"new-chat-video-task-steps","aria-label":s("video.task.progressAria"),"aria-live":"polite","aria-atomic":"true",children:b.map(C=>o.jsx("li",{className:`is-${C.status}`,children:o.jsxs("span",{className:"new-chat-video-task-step__label",children:[C.status==="active"?o.jsx(lie,{className:"new-chat-video-task-step__loading"}):null,o.jsx("span",{children:C.label})]})},C.id))}),t.error?o.jsx("div",{className:"new-chat-video-task-error",role:"alert",children:o.jsx("p",{children:t.error})}):null,t.optimizedPrompt?o.jsxs("section",{className:"new-chat-video-task-prompt","aria-labelledby":`${l}-prompt`,children:[o.jsx("h3",{id:`${l}-prompt`,children:s("video.task.optimizedPrompt")}),o.jsx("p",{children:t.optimizedPrompt})]}):null,t.status==="generating"?o.jsxs("div",{className:"new-chat-video-task-preview is-loading",children:[o.jsx(lie,{className:"new-chat-video-task-preview__loading"}),o.jsx(xn,{as:"strong",duration:2.2,spread:18,"aria-live":"polite",children:w}),o.jsx("div",{className:"new-chat-video-task-progress",role:"progressbar","aria-label":s("video.task.processingAria",{task:x}),"aria-valuetext":k?s("video.task.waitingAria",{status:w,elapsed:k}):w,children:o.jsx("span",{"aria-hidden":"true"})}),o.jsxs("div",{className:"new-chat-video-task-progress__meta",children:[o.jsx("span",{children:S}),k?o.jsx("span",{children:s("video.task.elapsed",{elapsed:k})}):null]}),o.jsx("span",{children:E})]}):t.output?o.jsx("div",{className:"new-chat-video-task-preview",children:o.jsx("video",{src:t.output.previewUrl,controls:!0,playsInline:!0,preload:"metadata","aria-label":s("video.task.previewAria")})}):null]}),o.jsxs("footer",{className:"new-chat-video-task-dialog__actions",children:[o.jsx("p",{children:v?s("video.task.backgroundHint"):t.status==="success"?s("video.task.successHint"):s(O?"video.task.activationHint":"video.task.retryHint")}),o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"new-chat-video-task-button",onClick:n,children:s("video.task.close")}),t.status==="error"?o.jsx("button",{type:"button",className:"new-chat-video-task-button is-primary",onClick:i,children:y}):t.output?o.jsxs("button",{type:"button",className:"new-chat-video-task-button is-primary",onClick:r,children:[o.jsx($Ut,{}),s("video.task.download")]}):null]})]})]})}),document.body)}const mw="/web/agentkit-cli",T2=6e4,BUt=33e4;function gj(){return V("agentkitCli.unconfigured")}gj();function gw(e=!1){const t=Hu({Accept:"application/json"});return e&&t.set("Content-Type","application/json"),t}async function bw(e,t){return new Error(await on(e,t))}function cie(e){const t=e;if(typeof(t==null?void 0:t.sessionId)!="string"||typeof t.status!="string")throw new Error(V("agentkitCli.invalidSession"));return{id:t.sessionId,status:t.status,displayName:typeof t.displayName=="string"?t.displayName:"",expireAt:typeof t.expireAt=="string"?t.expireAt:""}}const uy={async capabilities(e={}){const t=await An(`${mw}/capabilities`,{headers:gw(),signal:e.signal},T2);if(!t.ok)throw await bw(t,V("agentkitCli.loadCapabilitiesFailed"));const n=await t.json();if(typeof n.enabled!="boolean")throw new Error(V("agentkitCli.invalidCapabilities"));return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:""}},async listSessions(e={}){const t=await An(`${mw}/sessions`,{headers:gw(),signal:e.signal},T2);if(!t.ok)throw await bw(t,V("agentkitCli.listSessionsFailed"));const n=await t.json();if(!Array.isArray(n.sessions))throw new Error(V("agentkitCli.invalidSessionList"));return n.sessions.map(cie)},async createSession(e={}){const t=await An(`${mw}/sessions`,{method:"POST",headers:gw(!0),body:JSON.stringify({persistent:!1}),signal:e.signal},BUt);if(!t.ok)throw await bw(t,V("agentkitCli.createSessionFailed"));return cie(await t.json())},async openSession(e,t={}){const n=await An(`${mw}/sessions/${encodeURIComponent(e)}/open`,{method:"POST",headers:gw(),signal:t.signal},T2);if(!n.ok)throw await bw(n,V("agentkitCli.openSessionFailed"))},async launchTerminal(e,t={}){const n=await An(`${mw}/sessions/${encodeURIComponent(e)}/terminal`,{method:"POST",headers:gw(),signal:t.signal},T2);if(!n.ok)throw await bw(n,V("agentkitCli.openTerminalFailed"));const i=await n.json();if(typeof i.url!="string"||!i.url)throw new Error(V("agentkitCli.invalidTerminalUrl"));return{url:i.url,...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}}};function f1({open:e,keepMounted:t=!1,title:n,subtitle:i,icon:r,className:s="",onClose:a,children:l}){const{t:c}=Te("sandbox"),u=p.useId(),d=p.useRef(null),f=p.useRef(null),h=p.useRef(a);return h.current=a,p.useEffect(()=>{var b;if(!e)return;f.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const m=document.body.style.overflow;document.body.style.overflow="hidden",(b=d.current)==null||b.focus();const g=v=>{var k;if(v.key==="Escape"){v.preventDefault(),h.current();return}if(v.key!=="Tab")return;const y=(k=d.current)==null?void 0:k.closest("[role=dialog]"),x=Array.from((y==null?void 0:y.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(x.length===0)return;const O=x[0],w=x[x.length-1];v.shiftKey&&document.activeElement===O?(v.preventDefault(),w.focus()):!v.shiftKey&&document.activeElement===w&&(v.preventDefault(),O.focus())};return window.addEventListener("keydown",g),()=>{var v;document.body.style.overflow=m,window.removeEventListener("keydown",g),(v=f.current)==null||v.focus()}},[e]),!e&&!t?null:Li.createPortal(o.jsx("div",{className:"sandbox-control-backdrop",hidden:!e,onMouseDown:m=>{m.target===m.currentTarget&&a()},children:o.jsxs("section",{className:`sandbox-control-dialog ${s}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":u,children:[o.jsxs("header",{className:"sandbox-control-head",children:[o.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:r}),o.jsxs("div",{children:[o.jsx("h2",{id:u,children:n}),i?o.jsx("p",{children:i}):null]}),o.jsx("button",{ref:d,type:"button",className:"sandbox-control-close","aria-label":c("common.closeDialog",{title:n}),onClick:a,children:o.jsx(dRe,{})})]}),l]})}),document.body)}function UUt({open:e,kind:t,launch:n,loading:i,error:r,onReload:s,onClose:a}){const{t:l}=Te("sandbox"),c=t==="terminal",u=l(c?"tool.terminalTitle":"tool.browserTitle");return o.jsxs(f1,{open:e,title:u,subtitle:l(c?"tool.terminalSubtitle":"tool.browserSubtitle"),icon:c?o.jsx($b,{}):o.jsx(uRe,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:a,children:[o.jsx("div",{className:"sandbox-tool-toolbar",children:o.jsxs("span",{children:[o.jsx("i",{className:i?"is-loading":n?"is-ready":""}),l(i?"tool.connecting":n?"tool.connected":"tool.notConnected")]})}),o.jsx("div",{className:"sandbox-tool-surface",children:i?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(ju,{className:"spin"}),o.jsx("strong",{children:l("tool.opening",{title:u})}),o.jsx("span",{children:l("tool.connectingSession")})]}):r?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsx("strong",{children:l("tool.openFailed",{title:u})}),o.jsx("span",{children:r}),o.jsx("button",{type:"button",onClick:s,children:l("common.retry")})]}):n?o.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 QUt({open:e,threads:t,currentThreadId:n,loading:i,error:r,onSelect:s,onClose:a}){const{t:l,i18n:c}=Te("sandbox");return o.jsx(f1,{open:e,title:l("threads.title"),subtitle:l("threads.subtitle"),icon:o.jsx(y8t,{}),className:"sandbox-threads-dialog",onClose:a,children:o.jsx("div",{className:"sandbox-thread-list",children:i?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(ju,{className:"spin"}),o.jsx("strong",{children:l("threads.loading")})]}):r?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsx("strong",{children:l("threads.loadFailed")}),o.jsx("span",{children:r})]}):t.length===0?o.jsx("div",{className:"sandbox-control-state",children:o.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 o.jsxs("button",{type:"button",className:d?"is-active":"",disabled:d,onClick:()=>s(u.id),children:[o.jsxs("span",{children:[o.jsx("strong",{children:f}),o.jsx("small",{children:u.preview||u.cwd||u.id})]}),o.jsx("time",{children:u.updatedAt?new Date(u.updatedAt*1e3).toLocaleString(c.resolvedLanguage??c.language):""}),o.jsx(N8,{})]},u.id)})})})}const zUt=[{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}],VUt=[{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}],HUt=[{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 qUt({open:e,value:t,busy:n,error:i,onSave:r,onClose:s}){const{t:a}=Te("sandbox"),[l,c]=p.useState(t);return p.useEffect(()=>{e&&c(t)},[e,t]),o.jsxs(f1,{open:e,title:a("permissions.title"),subtitle:a("permissions.subtitle"),icon:o.jsx(lz,{}),className:"sandbox-settings-dialog",onClose:s,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsx(LL,{label:a("permissions.sandboxMode"),choices:zUt.map(u=>({...u,label:a(u.labelKey),detail:a(u.detailKey)})),value:l.sandboxMode,disabled:n,onChange:u=>c(d=>({...d,sandboxMode:u,networkAccess:u==="danger-full-access"?!0:d.networkAccess}))}),o.jsx(LL,{label:a("permissions.approvalPolicy"),choices:VUt.map(u=>({...u,label:a(u.labelKey),detail:a(u.detailKey)})),value:l.approvalPolicy,disabled:n,onChange:u=>c(d=>({...d,approvalPolicy:u}))}),o.jsx(LL,{label:a("permissions.approvalMethod"),choices:HUt.map(u=>({...u,label:a(u.labelKey),detail:a(u.detailKey)})),value:l.approvalsReviewer,disabled:n,onChange:u=>c(d=>({...d,approvalsReviewer:u}))}),o.jsxs("label",{className:`sandbox-network-toggle${l.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[o.jsxs("span",{children:[o.jsx("strong",{children:a("permissions.networkAccess")}),o.jsx("small",{children:a("permissions.networkAccessHelp")})]}),o.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"?o.jsx("div",{className:"sandbox-control-note is-danger",children:a("permissions.fullAccessWarning")}):null,i?o.jsx("div",{className:"sandbox-control-error",children:i}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:s,disabled:n,children:a("common.cancel")}),o.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>r(l),children:[n?o.jsx(ju,{className:"spin"}):null,a("permissions.save")]})]})]})}function LL({label:e,choices:t,value:n,disabled:i,onChange:r}){return o.jsxs("fieldset",{className:"sandbox-choice-group",disabled:i,role:"radiogroup","aria-label":e,children:[o.jsx("legend",{children:e}),o.jsx("div",{className:"sandbox-choice-list",children:t.map(s=>o.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:a=>{var d,f;const l=t.findIndex(h=>h.value===s.value);let c=l;if(a.key==="ArrowRight"||a.key==="ArrowDown")c=(l+1)%t.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(a.key==="Home")c=0;else if(a.key==="End")c=t.length-1;else return;a.preventDefault(),r(t[c].value);const u=(d=a.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[o.jsx("i",{}),o.jsxs("span",{children:[o.jsx("strong",{children:s.label}),o.jsx("small",{children:s.detail})]})]},s.value))})]})}function WUt({open:e,cwd:t,locked:n,busy:i,error:r,browse:s,onSave:a,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 x=t||"/";d(x),y(x)},[t,e]);async function y(x){g(!0),v("");try{const O=await s(x);h(O),d(O.path)}catch(O){v(O instanceof Error?O.message:String(O))}finally{g(!1)}}return o.jsxs(f1,{open:e,title:c("workspace.title"),subtitle:c("workspace.subtitle"),icon:o.jsx(zA,{}),className:"sandbox-workspace-dialog",onClose:l,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsxs("label",{className:"sandbox-workspace-input",children:[o.jsx("span",{children:c("workspace.absolutePath")}),o.jsxs("div",{children:[o.jsx("input",{value:u,disabled:i||n,spellCheck:!1,onChange:x=>d(x.target.value),onKeyDown:x=>{x.key==="Enter"&&u.startsWith("/")&&(x.preventDefault(),y(u))}}),o.jsx("button",{type:"button",disabled:i||m||!u.startsWith("/"),onClick:()=>void y(u),children:c("workspace.browse")})]})]}),o.jsxs("div",{className:"sandbox-directory-browser",children:[o.jsxs("div",{className:"sandbox-directory-head",children:[o.jsx("span",{title:f==null?void 0:f.path,children:(f==null?void 0:f.path)??u}),m?o.jsx(ju,{className:"spin"}):null]}),o.jsxs("div",{className:"sandbox-directory-list",children:[f!=null&&f.parent?o.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(f.parent??"/"),children:[o.jsx(zA,{}),o.jsx("span",{children:c("workspace.parent")}),o.jsx("small",{children:f.parent}),o.jsx(N8,{})]}):null,f==null?void 0:f.directories.map(x=>o.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(x.path),children:[o.jsx(zA,{}),o.jsx("span",{children:x.name}),o.jsx(N8,{})]},x.path)),!m&&(f==null?void 0:f.directories.length)===0?o.jsx("div",{className:"sandbox-directory-empty",children:c("workspace.empty")}):null]})]}),n?o.jsx("div",{className:"sandbox-control-note",children:c("workspace.locked")}):null,b||r?o.jsx("div",{className:"sandbox-control-error",children:b||r}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:l,disabled:i,children:c("common.cancel")}),o.jsxs("button",{type:"button",className:"is-primary",disabled:i||n||!u.startsWith("/"),onClick:()=>a(u),children:[i?o.jsx(ju,{className:"spin"}):null,c("workspace.useDirectory")]})]})]})}function GUt({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(),a=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return o.jsxs(f1,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?r("approval.fileTitle"):r("approval.commandTitle"),subtitle:r("approval.subtitle"),icon:o.jsx(lz,{}),className:"sandbox-approval-dialog",onClose:()=>{t||i("cancel")},children:[o.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?o.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,s?o.jsx("pre",{children:s}):null,a?o.jsx("pre",{children:a}):null,e!=null&&e.cwd?o.jsxs("div",{className:"sandbox-approval-meta",children:[r("approval.workingDirectory")," ",o.jsx("code",{children:e.cwd})]}):null,n?o.jsx("div",{className:"sandbox-control-error",children:n}):null]}),o.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[o.jsx("button",{type:"button",disabled:t,onClick:()=>i("decline"),children:r("approval.decline")}),o.jsx("button",{type:"button",disabled:t,onClick:()=>i("accept"),children:r("approval.acceptOnce")}),o.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>i("acceptForSession"),children:[t?o.jsx(ju,{className:"spin"}):null,r("approval.acceptSession")]})]})]})}const gIe=new Set(["creating","pending","running","starting","initializing"]),bIe="ready",KUt=1500,XUt=80;function V8(e){return e.status.trim().toLowerCase()}function YUt(e){return new Promise((t,n)=>{const i=window.setTimeout(t,KUt);e.addEventListener("abort",()=>{window.clearTimeout(i),n(new DOMException("Aborted","AbortError"))},{once:!0})})}async function ZUt(e,t,n){let i=e;for(let r=0;rc.id===i.id);if(!l)throw new Error(n("agentKitCli.sessionExpired"));i=l}throw new Error(n("agentKitCli.initializationTimeout"))}async function JUt(e,t,n){t("searching");const i=await uy.capabilities({signal:e});if(!i.enabled)throw new Error(i.reason||gj());const r=await uy.listSessions({signal:e});let s=r.find(a=>V8(a)===bIe)??r.find(a=>gIe.has(V8(a)));return s?t("connecting"):(t("creating"),s=await uy.createSession({signal:e})),s=await ZUt(s,e,n),t("connecting"),await uy.openSession(s.id,{signal:e}),{launch:await uy.launchTerminal(s.id,{signal:e}),session:s}}function eQt(e){return e==="searching"||e==="creating"||e==="connecting"}function tQt(e,t){const n=Date.parse(e);return Number.isFinite(n)&&n>t}function nQt(e,t,n){const i=Date.parse(e);if(!Number.isFinite(i))return n("agentKitCli.nonPersistent");const r=Math.max(0,Math.ceil((i-t)/6e4)),s=Math.floor(r/60),a=r%60;return s>0?n("agentKitCli.recyclingHoursMinutes",{hours:s,minutes:a}):n("agentKitCli.recyclingMinutes",{minutes:a})}function iQt(e,t){const n=e instanceof Error?e.message:String(e);return e instanceof TypeError?t("agentKitCli.connectionError",{message:n}):n}function rQt({open:e,onClose:t}){const{t:n}=Te("workspaceTools"),[i,r]=p.useState("searching"),[s,a]=p.useState(null),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(0),[m,g]=p.useState(()=>Date.now());p.useEffect(()=>{if(!e||!l)return;g(Date.now());const v=window.setInterval(()=>g(Date.now()),6e4);return()=>window.clearInterval(v)},[l,e]),p.useEffect(()=>{if(!e)return;if(s&&tQt(l,Date.now())){d(""),r("ready");return}const v=new AbortController;return r("searching"),a(null),c(""),d(""),JUt(v.signal,r,n).then(({launch:y,session:x})=>{v.signal.aborted||(a(y),c(x.expireAt),r("ready"))}).catch(y=>{if(v.signal.aborted)return;const x=iQt(y,n);d(x),r(x.includes(gj())?"unconfigured":"error")}),()=>v.abort()},[f,l,s,e,n]);const b=eQt(i);return o.jsxs(f1,{open:e,keepMounted:!0,title:"AgentKit CLI",icon:o.jsx($b,{}),className:"sandbox-tool-dialog sandbox-tool-dialog--terminal agentkit-cli-dialog",onClose:t,children:[o.jsx("div",{className:"sandbox-tool-toolbar",children:o.jsxs("span",{children:[o.jsx("i",{className:b?"is-loading":i==="ready"?"is-ready":""}),b?n(`agentKitCli.loading.${i}`):i==="ready"?nQt(l,m,n):n("agentKitCli.unavailable")]})}),o.jsx("div",{className:"sandbox-tool-surface agentkit-cli-surface",children:b?o.jsxs("div",{className:"agentkit-cli-state",role:"status","aria-live":"polite",children:[o.jsx(Hk,{size:20}),o.jsx(xn,{as:"strong",children:n(`agentKitCli.loading.${i}`)})]}):i==="unconfigured"?o.jsxs("div",{className:"agentkit-cli-state",role:"status",children:[o.jsx($b,{}),o.jsx("strong",{children:gj()})]}):i==="error"?o.jsxs("div",{className:"agentkit-cli-state is-error",role:"alert",children:[o.jsx("strong",{children:n("agentKitCli.requestFailed")}),o.jsx("pre",{className:"agentkit-cli-error-detail",children:u}),o.jsx("button",{type:"button",onClick:()=>h(v=>v+1),children:n("agentKitCli.retry")})]}):s?o.jsx("iframe",{src:s.url,title:n("agentKitCli.terminalTitle"),allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function sQt({open:e,state:t,agentKind:n="codex",error:i,persistentEnabled:r=!0,persistentReason:s="",persistentRequired:a=!1,storageMode:l="snapshot",diskGbDefault:c=10,diskGbMin:u=5,diskGbMax:d=100,onCancel:f,onConfirm:h}){const{t:m}=Te("sandbox"),g=n==="codex"?"Codex":n==="deepseek-harness"?"DeepSeek Harness":n==="openclaw"?"OpenClaw":"Hermes",b=n==="codex"?m("launch.defaultName"):m("launch.namedDefault",{agent:g}),v=p.useRef(null),y=p.useRef(null),x=p.useRef(null),O=p.useRef(!1),w=p.useRef(f),[k,S]=p.useState(b),[E,C]=p.useState(!0),[N,_]=p.useState(c);if(w.current=f,p.useEffect(()=>{if(!e)return;S(b),C(a||r),_(c);const P=document.body.style.overflow;document.body.style.overflow="hidden";const R=window.requestAnimationFrame(()=>{var M,U;(M=y.current)==null||M.focus(),(U=y.current)==null||U.select()}),L=M=>{var K;if(M.key==="Escape"){M.preventDefault(),w.current();return}if(M.key!=="Tab")return;const U=(K=v.current)==null?void 0:K.querySelectorAll("input:not(:disabled), button:not(:disabled)");if(!(U!=null&&U.length))return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",L),()=>{window.cancelAnimationFrame(R),document.body.style.overflow=P,window.removeEventListener("keydown",L)}},[b,c,e,r,a]),!e)return null;const j=t==="loading",A=k.trim(),F=Number.isInteger(N)&&N>=u&&N<=d,T=j?m("launch.creatingTitle",{agent:g}):t==="error"?m("launch.failedTitle"):m("launch.createTitle",{agent:g});return Li.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!j&&f()},children:o.jsxs("form",{ref:v,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":t==="confirm"?void 0:"sandbox-dialog-description",onSubmit:P=>{P.preventDefault(),!j&&!O.current&&A&&(l!=="disk"||F)&&h(A,l==="disk"?!0:E,l==="disk"?N:void 0)},children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:j?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(wk,{kind:n})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:T}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:i||m("launch.fallbackError")}):j?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:m("launch.creatingDescription",{agent:g})}):null,o.jsxs("label",{className:"sandbox-dialog-field",children:[o.jsxs("span",{className:"sandbox-dialog-field-label",children:[o.jsx("span",{children:m("launch.name")}),o.jsxs("span",{"aria-hidden":"true",children:[k.length,"/",Cte]})]}),o.jsx("input",{ref:y,type:"text",required:!0,value:k,maxLength:Cte,disabled:j,placeholder:b,autoComplete:"off",onChange:P=>S(P.target.value),onCompositionStart:()=>{O.current=!0},onCompositionEnd:()=>{O.current=!1},onKeyDown:P=>{const{nativeEvent:R}=P;P.key==="Enter"&&(O.current||R.isComposing||R.keyCode===229)&&P.preventDefault()}})]}),l==="disk"?o.jsxs("label",{className:"sandbox-dialog-field sandbox-dialog-disk-field",children:[o.jsxs("span",{className:"sandbox-dialog-field-label",children:[o.jsx("span",{children:m("launch.storageSize")}),o.jsx("span",{children:"GiB"})]}),o.jsx("input",{type:"number",required:!0,min:u,max:d,step:1,value:N,disabled:j,onChange:P=>_(P.currentTarget.valueAsNumber)}),o.jsx("span",{className:"sandbox-dialog-field-help",children:m("launch.storageHelp",{min:u,max:d})})]}):o.jsxs("div",{className:"sandbox-dialog-persistence",role:"group","aria-describedby":"sandbox-persistence-description",children:[o.jsx(fz,{id:"sandbox-persistence",className:"sandbox-dialog-persistence-control",checked:E,disabled:j||!r||a,onCheckedChange:C,label:m("launch.persistent")}),o.jsx("p",{id:"sandbox-persistence-description",className:`sandbox-dialog-persistence-description${E?"":" is-warning"}`,role:E?void 0:"status",children:r?m(E?"launch.persistentHelp":"launch.temporaryHelp"):s||m("launch.persistenceUnsupported")})]})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:x,type:"button",onClick:f,children:m(j?"launch.cancelCreation":"common.cancel")}),!j&&o.jsx("button",{type:"submit",className:"is-primary",disabled:!A||l==="disk"&&!F,children:m(t==="error"?"launch.retry":"launch.confirm")})]})]})}),document.body)}function aQt({agentName:e,expireAt:t,exitLabel:n,onExit:i}){const{t:r,i18n:s}=Te("sandbox"),[a,l]=p.useState(()=>Date.now());p.useEffect(()=>{if(!t)return;const h=window.setInterval(()=>l(Date.now()),6e4);return()=>window.clearInterval(h)},[t]);const c=t?Date.parse(t):Number.NaN,u=Number.isFinite(c)?Math.max(0,Math.ceil((c-a)/6e4)):null,d=u===null?"":u===0?r("session.expired"):u>=60?r("session.remainingHours",{hours:Math.floor(u/60),minutes:u%60}):r("session.remainingMinutes",{minutes:u}),f=Number.isFinite(c)?new Date(c).toLocaleString(s.resolvedLanguage??s.language,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return o.jsxs("div",{className:`sandbox-session-warning${t?" is-expiring":""}`,role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:f?r("session.expiryWarning",{expiry:f,remaining:d}):r("session.usingAgent",{agent:e})}),o.jsx("button",{type:"button",onClick:i,children:n??r("session.exit")})]})}function oQt({activity:e,time:t}){var i;const{t:n}=Te("sandbox");return o.jsxs("aside",{className:"sandbox-activity-record",role:"status","aria-label":n("session.activityAria"),children:[o.jsxs("div",{className:"sandbox-activity-summary",children:[o.jsx("span",{className:"sandbox-activity-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-activity-label",children:n("session.activity")}),o.jsx("strong",{children:e.title}),t?o.jsx("time",{children:t}):null]}),(i=e.details)!=null&&i.length?o.jsx("dl",{className:"sandbox-activity-details",children:e.details.map(r=>o.jsxs("div",{children:[o.jsx("dt",{children:r.label}),o.jsx("dd",{title:r.value,children:r.code?o.jsx("code",{children:r.value}):r.value})]},`${r.label}:${r.value}`))}):null]})}function lQt(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function cQt({usage:e}){const{t,i18n:n}=Te("sandbox"),i=[["total",t("session.tokenLabels.total"),e.totalTokens],["input",t("session.tokenLabels.input"),e.inputTokens],...e.cachedInputTokens>0?[["cachedInput",t("session.tokenLabels.cachedInput"),e.cachedInputTokens]]:[],["output",t("session.tokenLabels.output"),e.outputTokens],...e.reasoningOutputTokens>0?[["reasoningOutput",t("session.tokenLabels.reasoningOutput"),e.reasoningOutputTokens]]:[]],r=n.resolvedLanguage??n.language;return o.jsx("div",{className:"sandbox-token-usage","aria-label":t("session.tokenUsageAria"),children:i.map(([s,a,l])=>o.jsxs("span",{title:t("session.tokens",{label:a,value:l.toLocaleString(r)}),children:[o.jsx("small",{children:a}),o.jsx("strong",{children:lQt(l)})]},s))})}const uQt={codex:"Codex","deepseek-harness":"DeepSeek Harness",openclaw:"OpenClaw",hermes:"Hermes"};function uie(e,t){if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function dQt({session:e,onBack:t,onOpen:n,onDelete:i}){var k;const{t:r,i18n:s}=Te("sandbox"),[a,l]=p.useState(!1),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=uQt[e.toolName],b=e.resourceType==="snapshot",v=b?e.sourceSessionId||e.snapshotId:e.id,y=e.displayName||r("common.agentFallback",{agent:g}),x=s.resolvedLanguage??s.language,O=async()=>{if(!(c||d)){u(!0),m("");try{await n()}catch(S){m(S instanceof Error?S.message:String(S))}finally{u(!1)}}},w=async()=>{if(!(d||c)){f(!0),m("");try{await i()}catch(S){m(S instanceof Error?S.message:String(S)),l(!1)}finally{f(!1)}}};return o.jsxs("section",{className:"sandbox-agent-details",children:[o.jsxs("header",{className:"sandbox-agent-details-header",children:[o.jsx(nRe,{label:r("agentDetails.back"),onClick:t}),o.jsxs("div",{children:[o.jsx("h1",{children:y}),o.jsx("p",{children:r("agentDetails.subtitle",{agent:g})})]})]}),h?o.jsx("div",{className:"sandbox-agent-detail-error",role:"alert",children:h}):null,o.jsxs("div",{className:"sandbox-agent-detail-panel",children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.type")}),o.jsx("dd",{children:g})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.status")}),o.jsx("dd",{children:XQ(FI(e.status))})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.createdBy")}),o.jsx("dd",{children:((k=e.createdBy)==null?void 0:k.trim())||r("common.unknownSource")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.createdAt")}),o.jsx("dd",{children:uie(e.createdAt,x)})]}),b?null:o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.expiresAt")}),o.jsx("dd",{children:uie(e.expireAt,x)})]}),o.jsxs("div",{className:"is-wide",children:[o.jsx("dt",{children:r("agentDetails.agentId")}),o.jsx("dd",{children:v})]})]}),b&&e.status.toLowerCase()==="wakeable"?o.jsx("p",{className:"sandbox-agent-wake-note",role:c?"status":void 0,children:c?o.jsx(xn,{children:r("agentDetails.wakingHint")}):r("agentDetails.sleepingHint")}):null,o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"sandbox-agent-delete",disabled:c||d,onClick:()=>l(!0),children:r("agentDetails.delete")}),o.jsx("button",{type:"button",className:"sandbox-agent-open",disabled:c||d||!["ready","wakeable"].includes(e.status.toLowerCase()),"aria-busy":c||void 0,onClick:()=>void O(),children:r(c?b?"agentDetails.waking":"agentDetails.opening":b?"agentDetails.wake":"agentDetails.open")})]})]}),a?o.jsx("div",{className:"confirm-scrim",onClick:()=>!d&&l(!1),children:o.jsxs("div",{className:"confirm-box",role:"alertdialog","aria-modal":"true","aria-labelledby":"sandbox-agent-delete-title",onClick:S=>S.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"sandbox-agent-delete-title",children:r("agentDetails.deleteTitle")}),o.jsx("div",{className:"confirm-text",children:r("agentDetails.deleteDescription",{name:y})}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",disabled:d,onClick:()=>l(!1),children:r("common.cancel")}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",disabled:d,onClick:()=>void w(),children:r(d?"agentDetails.deleting":"agentDetails.confirmDelete")})]})]})}):null]})}function fQt({workspace:e,onBack:t}){var g;const{t:n}=Te("sandbox"),[i,r]=p.useState("main"),[s,a]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=e.kind==="deepseek-harness"?"DeepSeek Harness":e.kind==="openclaw"?"OpenClaw":"Hermes",h=e.session.displayName||n("common.agentFallback",{agent:f});p.useEffect(()=>{r("main"),a(""),d(""),c(!1)},[e.session.id]);const m=async()=>{if(r("terminal"),!(s||l)){c(!0),d("");try{const b=await dr.launchAgentTerminal(e.kind,e.session.id);a(b.url)}catch(b){d(b instanceof Error?b.message:String(b))}finally{c(!1)}}};return o.jsxs("section",{className:"sandbox-agent-workspace",children:[o.jsxs("header",{children:[o.jsxs("div",{className:"sandbox-agent-workspace-title",children:[o.jsx("button",{type:"button",onClick:t,"aria-label":n("agentWorkspace.back"),children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),o.jsxs("div",{children:[o.jsx("h1",{children:h}),o.jsxs("p",{children:[o.jsx("span",{children:n("agentWorkspace.createdBy",{creator:((g=e.session.createdBy)==null?void 0:g.trim())||n("common.unknownSource")})}),o.jsx("span",{className:"sandbox-agent-workspace-status","data-ready":e.session.status.toLowerCase()==="ready"||void 0,children:XQ(e.session.status)})]})]})]}),o.jsxs(zc,{className:"sandbox-agent-workspace-tabs",value:i,size:"lg",gutterSize:"lg",block:!0,pill:!1,"aria-label":n("agentWorkspace.ariaLabel"),onChange:b=>{b==="terminal"?m():r("main")},children:[o.jsx(zc.Option,{value:"main",children:n("agentWorkspace.main")}),o.jsx(zc.Option,{value:"terminal",children:n("agentWorkspace.terminal")})]})]}),o.jsxs("div",{className:"sandbox-agent-workspace-surface",children:[o.jsx("iframe",{src:e.webuiUrl,title:n("agentWorkspace.mainTitle",{agent:f}),allow:"clipboard-read; clipboard-write",hidden:i!=="main"}),s?o.jsx("iframe",{src:s,title:n("agentWorkspace.terminalTitle",{agent:f}),hidden:i!=="terminal"}):i==="terminal"&&l?o.jsx("div",{className:"sandbox-agent-workspace-state",role:"status",children:n("agentWorkspace.openingTerminal")}):i==="terminal"&&u?o.jsxs("div",{className:"sandbox-agent-workspace-state is-error",role:"alert",children:[o.jsx("p",{children:u}),o.jsx("button",{type:"button",onClick:()=>void m(),children:n("common.tryAgain")})]}):null]})]})}an.hasResourceBundle("en-US","sandbox")||an.addResourceBundle("en-US","sandbox",Fae,!0,!0);an.hasResourceBundle("zh-CN","sandbox")||an.addResourceBundle("zh-CN","sandbox",nde,!0,!0);function ks(e,t={}){return an.t(e,{...t,ns:"sandbox"})}const ZI=[{name:"model",usage:"/model [model]"},{name:"models",usage:"/models"},{name:"skill",usage:"/skill"},{name:"skills",usage:"/skills"},{name:"new",usage:"/new"},{name:"resume",usage:"/resume [thread]"},{name:"fork",usage:"/fork"},{name:"compact",usage:"/compact"},{name:"archive",usage:"/archive"},{name:"status",usage:"/status"},{name:"clear",usage:"/clear"},{name:"help",usage:"/help"}];function yIe(e){return{...e,description:ks(`commands.${e.name}.description`),keywords:ks(`commands.${e.name}.keywords`).split(/\s+/)}}function hQt(e){var n;const t=e.trim().match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(t)return{name:t[1].toLocaleLowerCase(),argument:((n=t[2])==null?void 0:n.trim())??""}}function pQt(e){const t=e.toLocaleLowerCase();return ZI.map(yIe).filter(n=>!t||[n.name,n.description,...n.keywords].some(i=>i.toLocaleLowerCase().includes(t))).sort((n,i)=>die(n,t)-die(i,t)).slice(0,12)}function die(e,t){return t?e.name===t?0:e.name.startsWith(t)?1:e.name.includes(t)?2:3:ZI.findIndex(n=>n.name===e.name)}function mQt(e,t){const n=t.toLocaleLowerCase();return e.filter(i=>!n||`${i.id} ${i.displayName} ${i.description}`.toLocaleLowerCase().includes(n)).sort((i,r)=>{if(!n)return Number(r.isDefault)-Number(i.isDefault);const s=i.id.toLocaleLowerCase(),a=r.id.toLocaleLowerCase(),l=(c,u)=>c===n?0:c.startsWith(n)?1:u.toLocaleLowerCase().startsWith(n)?2:3;return l(s,i.displayName)-l(a,r.displayName)}).slice(0,12)}function gQt(){return ZI.map(yIe).map(e=>({label:e.usage,value:e.description}))}function bQt(e,t){return e.map(n=>{const i=n.displayName.trim(),r=i&&i!==n.id?`${i} · ${n.id}`:n.id;return{label:n.id===t?ks("commands.currentModel"):ks("commands.availableModel"),value:n.description?`${r} — ${n.description}`:r,code:!1}})}function yQt(e){const t=[{label:"Thread",value:e.threadId,code:!0},{label:ks("commands.workspace"),value:e.cwd||ks("commands.notSet"),code:!!e.cwd}];return e.model&&t.push({label:ks("commands.modelLabel"),value:e.model,code:!0}),t.push({label:ks("commands.statusLabel"),value:e.busy?ks("commands.running"):ks("commands.idle")}),e.threadTotal&&t.push({label:ks("commands.totalTokens"),value:e.threadTotal.totalTokens.toLocaleString(an.resolvedLanguage??an.language)}),e.modelContextWindow!==void 0&&t.push({label:ks("commands.contextWindow"),value:e.modelContextWindow.toLocaleString(an.resolvedLanguage??an.language)}),t}function vIe(e){return e.messages.map(t=>{var i,r;const n=[];return t.role==="user"&&((i=t.skillNames)!=null&&i.length)&&n.push({kind:"invocation",value:{skills:t.skillNames.map(s=>({name:s,description:""}))}}),t.role==="user"&&((r=t.images)!=null&&r.length)&&n.push({kind:"attachment",files:t.images.map((s,a)=>({id:`${t.id}-image-${a}`,mimeType:s.mimeType,data:s.data,name:s.alt||s.name||ks("commands.imageFallback")}))}),t.content&&n.push({kind:"text",text:t.content}),{role:t.role,blocks:n,meta:{localId:t.id,ts:t.timestamp/1e3}}})}function vQt({appName:e,value:t,onChange:n,onSubmit:i,onStop:r,disabled:s,busy:a,attachments:l,onAddFiles:c,onRemoveAttachment:u,actions:d,models:f,modelsLoading:h,modelsLoaded:m,currentModel:g,onRequestModels:b,skills:v,skillsLoading:y,skillsLoaded:x,selectedSkills:O,onRequestSkills:w,onSelectedSkillsChange:k,textOnly:S=!1}){const{t:E,i18n:C}=Te("sandbox"),N=p.useRef(null),_=p.useRef(null),j=p.useRef(null),A=p.useRef(null),[F,T]=p.useState(!1),[P,R]=p.useState(0),[L,M]=p.useState(!1);p.useLayoutEffect(()=>{const W=N.current;W&&(W.style.height="auto",W.style.height=`${Math.min(W.scrollHeight,200)}px`)},[t]);const U=p.useMemo(()=>{if(!t.startsWith("/")||t.includes(` `))return;const W=t.slice(1),X=W.search(/\s/),ae=(X<0?W:W.slice(0,X)).toLocaleLowerCase(),ue=X<0?"":W.slice(X).trim();if(!(X>=0&&ae!=="model"))return{command:ae,argument:ue,modelMode:X>=0}},[t]),I=p.useMemo(()=>{const W=/(^|\s)\$([^\s$]*)$/.exec(t);if(W)return{query:W[2],start:t.length-W[2].length-1,end:t.length}},[t]),H=p.useMemo(()=>{if(I){const W=I.query.toLocaleLowerCase();return v.filter(X=>!O.some(ae=>ae.id===X.id||ae.name===X.name)).filter(X=>`${X.name} ${X.description}`.toLocaleLowerCase().includes(W)).slice(0,12).map(X=>({kind:"skill",skill:X}))}return U!=null&&U.modelMode?mQt(f,U.argument).map(W=>({kind:"model",model:W})):U?pQt(U.command).map(W=>({kind:"command",command:W})):[]},[C.resolvedLanguage,I,f,O,v,U]),K=!S&&!L&&!!(I||U);p.useEffect(()=>{R(0)},[t]),p.useEffect(()=>{U!=null&&U.modelMode&&!m&&!h&&b()},[m,h,b,U==null?void 0:U.modelMode]),p.useEffect(()=>{I&&!x&&!y&&w()},[I,w,x,y]);const Q=l.some(W=>W.status!=="ready"),q=a&&!!r,B=!s&&!a&&!Q&&(t.trim().length>0||l.length>0);function ee(W){M(!1),T(!1),n(W)}function le(W){if(W.kind==="skill"){if(!I)return;const X=t.slice(0,I.start)+t.slice(I.end);k([...O,W.skill]),ee(X),M(!0),requestAnimationFrame(()=>{var ae,ue;(ae=N.current)==null||ae.focus(),(ue=N.current)==null||ue.setSelectionRange(I.start,I.start)});return}if(W.kind==="model"){ee(`/model ${W.model.id}`),M(!0),requestAnimationFrame(()=>{var X;return(X=N.current)==null?void 0:X.focus()});return}if(W.command.name==="model"){ee("/model "),b(),requestAnimationFrame(()=>{var X;return(X=N.current)==null?void 0:X.focus()});return}if(W.command.name==="skill"||W.command.name==="skills"){ee(`/${W.command.name}`),M(!0),requestAnimationFrame(()=>{var X;return(X=N.current)==null?void 0:X.focus()});return}ee(`/${W.command.name}`),M(!0),requestAnimationFrame(()=>{var X;return(X=N.current)==null?void 0:X.focus()})}function se(W){var X;T(!1),(X=W.current)==null||X.click()}function re(W){const X=W.target.files?Array.from(W.target.files):[];X.length&&c(X),W.target.value=""}const ge=I?E("composer.availableSkills"):U!=null&&U.modelMode?E("composer.selectModel"):E("composer.commands");return o.jsxs("div",{className:"composer sandbox-codex-composer",children:[l.length>0?o.jsx(oI,{appName:e,compact:!0,items:l,onRemove:u}):null,o.jsxs("div",{className:"composer-box",children:[K?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":ge,children:[o.jsxs("div",{className:"composer-command-head",children:[o.jsx(b8t,{}),o.jsx("span",{children:ge}),U!=null&&U.modelMode&&g?o.jsx("small",{children:E("composer.currentModel",{model:g})}):null,o.jsx("kbd",{children:I?"$":"/"})]}),I&&y?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(ju,{className:"spin"})," ",E("composer.loadingSkills")]}):U!=null&&U.modelMode&&h?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(ju,{className:"spin"})," ",E("composer.loadingModels")]}):H.length===0?o.jsx("div",{className:"composer-command-empty",children:I?E("composer.noSkillMatches"):U!=null&&U.modelMode?E("composer.noModelMatches"):E("composer.noCommandMatches")}):o.jsx("div",{className:"composer-command-list",children:H.map((W,X)=>{const ae=W.kind==="command"?`command:${W.command.name}`:W.kind==="model"?`model:${W.model.id}`:`skill:${W.skill.id}`,ue=W.kind==="command"?W.command.usage:W.kind==="model"?W.model.displayName:`$${W.skill.name}`,Oe=W.kind==="command"?W.command.description:W.kind==="model"?W.model.description||W.model.id:W.skill.description||E("composer.skillFallback");return o.jsxs("button",{type:"button",role:"option","aria-selected":X===P,className:`composer-command-item${X===P?" is-active":""}`,onMouseDown:ke=>{ke.preventDefault(),le(W)},onMouseEnter:()=>R(X),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${W.kind}`,"aria-hidden":"true",children:W.kind==="command"?"/":W.kind==="model"?"◇":"$"}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsx("strong",{children:ue}),o.jsx("span",{children:Oe})]}),X===P?o.jsx("kbd",{children:"↵"}):null]},ae)})})]}):null,o.jsx("div",{className:"composer-left-controls",children:!S&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:E("composer.add"),"aria-label":E("composer.add"),disabled:s,onClick:()=>T(W=>!W),children:o.jsx(d8t,{className:"icon"})}),F?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>se(_),children:[o.jsx(p8t,{className:"icon"}),E("composer.uploadImage")]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>se(j),children:[o.jsx(m8t,{className:"icon"}),E("composer.uploadDocument")]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>se(A),children:[o.jsx(g8t,{className:"icon"}),E("composer.uploadVideo")]}),o.jsx("div",{className:"composer-menu-separator",role:"separator"}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{T(!1),d.onOpenTerminal()},children:[o.jsx($b,{className:"icon"}),E("composer.openTerminal")]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{T(!1),d.onOpenBrowser()},children:[o.jsx(uRe,{className:"icon"}),E("composer.viewBrowser")]})]})]}):null]}),o.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:E("composer.permissions"),"aria-label":E("composer.permissions"),disabled:d.settingsBusy||a,onClick:d.onOpenPermissions,children:o.jsx(lz,{})}),o.jsx("button",{type:"button",className:`comp-icon sandbox-composer-control${d.workspaceLocked?" is-locked":""}`,title:d.workspaceLocked?E("composer.workspaceLocked"):E("composer.selectWorkspace"),"aria-label":E("composer.workspace"),disabled:d.settingsBusy||a,onClick:d.onOpenWorkspace,children:o.jsx(zA,{})}),d.endpointCopyEnabled&&d.onCopyEndpoint?o.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:d.endpointCopyState==="copied"?E("composer.endpointCopied"):E("composer.copyEndpoint"),"aria-label":d.endpointCopyState==="copied"?E("composer.endpointCopied"):E("composer.copyEndpoint"),disabled:d.endpointCopyState==="copying",onClick:d.onCopyEndpoint,children:d.endpointCopyState==="copying"?o.jsx(ju,{className:"spin"}):d.endpointCopyState==="copied"?o.jsx(x8t,{}):o.jsx(v8t,{})}):null]})}),o.jsxs("div",{className:"composer-input-stack sandbox-composer-input",children:[!S&&O.length>0?o.jsx(aI,{skillPrefix:"$",value:{skills:O.map(({name:W,description:X})=>({name:W,description:X}))},onRemoveSkill:W=>k(O.filter(X=>X.name!==W))}):null,o.jsx("textarea",{ref:N,className:"comp-input scroll",rows:1,value:t,disabled:s,placeholder:E(S?"composer.continuePlaceholder":"composer.messagePlaceholder"),"aria-expanded":K,onChange:W=>ee(W.target.value),onBlur:()=>window.setTimeout(()=>M(!0),0),onKeyDown:W=>{if(!VI(W.nativeEvent)){if(K){if((W.key==="ArrowDown"||W.key==="Tab"&&!W.shiftKey)&&H.length>0){W.preventDefault(),R(X=>(X+1)%H.length);return}if((W.key==="ArrowUp"||W.key==="Tab"&&W.shiftKey)&&H.length>0){W.preventDefault(),R(X=>(X-1+H.length)%H.length);return}if(W.key==="Enter"&&!W.shiftKey&&H[P]){W.preventDefault(),le(H[P]);return}if(W.key==="Escape"){W.preventDefault(),M(!0);return}}if(W.key==="Backspace"&&!t&&W.currentTarget.selectionStart===0&&O.length>0){W.preventDefault(),k(O.slice(0,-1));return}W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),B&&i(t))}}})]}),o.jsx("button",{type:"button",className:"comp-send",disabled:q?!1:!B,onClick:q?r:()=>i(t),"aria-label":E(q?"composer.stop":"composer.send"),title:q?E("composer.stop"):void 0,children:q?o.jsx(h8t,{className:"icon"}):a?o.jsx(ju,{className:"icon spin"}):o.jsx(f8t,{className:"icon"})})]}),o.jsx("input",{ref:_,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:re}),o.jsx("input",{ref:j,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:re}),o.jsx("input",{ref:A,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:re})]})}function xQt(e){return e.trim().replace(/\/+$/,"")||window.location.origin}function wQt(e){const t=xQt(e.studioUrl);return ks("handoff.prompt",{studioUrl:t,pairingCode:e.pairingCode})}function xIe(){return["codex plugin marketplace add volcengine/veadk-python","--sparse .agents/plugins","--sparse plugins/agentkit-studio","&& codex plugin add agentkit-studio@veadk-python"].join(" ")}function OQt(){return ks("handoff.installPrompt",{command:xIe()})}function fie(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function hie(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),o.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function $L(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.25 4.25L19 7"})})}function pie(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M19 8a8 8 0 1 0 .35 7"}),o.jsx("path",{d:"M19 4v4h-4"})]})}function SQt(e,t){const n=Math.max(0,Math.ceil((Date.parse(e)-t)/1e3)),i=Math.floor(n/3600),r=Math.floor(n%3600/60),s=n%60;return[i,r,s].map(a=>String(a).padStart(2,"0")).join(":")}const kQt=[{id:"request"},{id:"session"},{id:"restore"},{id:"continue"}];function EQt(e){switch(e.state){case"issued":return 0;case"creating":return 1;case"session-created":return 2;case"continuing":return 3;case"running":return 4;case"completed":return 4;case"failed":return e.failedStage==="creating-session"?1:e.failedStage==="uploading-project"||e.failedStage==="restoring-project"?2:3}}function CQt(e,t){const n=EQt(e);return e.state==="failed"&&t===n?"failed":tOQt(),[s.resolvedLanguage]),P=p.useMemo(()=>xIe(),[]),R=p.useMemo(()=>g?wQt(g):"",[s.resolvedLanguage,g]);if(p.useEffect(()=>{if(!e)return;b(null),y(null),m("conversation"),j(null),F(""),N(!1),E(Date.now());const Q=new AbortController,q=++u.current;return k(!0),dr.createCodexProjectHandoffPairing({signal:Q.signal}).then(B=>{u.current===q&&(b(B),y({state:"issued",expireAt:B.expireAt}))}).catch(B=>{(B==null?void 0:B.name)!=="AbortError"&&u.current===q&&j({message:B instanceof Error?B.message:String(B),retryPairing:!0})}).finally(()=>{u.current===q&&k(!1)}),()=>{Q.abort()}},[x,e]),p.useEffect(()=>{if(!e||!g)return;E(Date.now());const Q=window.setInterval(()=>E(Date.now()),1e3);return()=>window.clearInterval(Q)},[e,g]),p.useEffect(()=>{if(!e||!g)return;let Q=!1,q;const B=new AbortController,ee=async()=>{if(!(Q||Date.now()>=Date.parse(g.expireAt))){try{const le=await dr.getCodexProjectHandoffStatus(g.pairingCode,{signal:B.signal});if(Q||(y(le),le.state==="completed"||le.state==="failed"))return;q=window.setTimeout(()=>void ee(),1500);return}catch(le){if((le==null?void 0:le.name)==="AbortError"||Q)return;j({message:le instanceof Error?le.message:String(le),retryPairing:!1})}q=window.setTimeout(()=>void ee(),1500)}};return ee(),()=>{Q=!0,B.abort(),q!==void 0&&window.clearTimeout(q)}},[e,g]),p.useEffect(()=>{(v==null?void 0:v.state)!=="running"&&(v==null?void 0:v.state)!=="completed"||!g||f.current===g.pairingCode||(f.current=g.pairingCode,n())},[v==null?void 0:v.state,n,g]),p.useEffect(()=>()=>{d.current!==void 0&&window.clearTimeout(d.current)},[]),p.useEffect(()=>{if(!e)return;const Q=document.body.style.overflow;document.body.style.overflow="hidden";const q=window.requestAnimationFrame(()=>{var ee;return(ee=l.current)==null?void 0:ee.focus()}),B=ee=>{var ge;if(ee.key==="Escape"){ee.preventDefault(),c.current();return}if(ee.key!=="Tab")return;const le=(ge=a.current)==null?void 0:ge.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex]:not([tabindex="-1"])');if(!(le!=null&&le.length))return;const se=le[0],re=le[le.length-1];ee.shiftKey&&document.activeElement===se?(ee.preventDefault(),re.focus()):!ee.shiftKey&&document.activeElement===re&&(ee.preventDefault(),se.focus())};return window.addEventListener("keydown",B),()=>{window.cancelAnimationFrame(q),document.body.style.overflow=Q,window.removeEventListener("keydown",B)}},[e]),!e)return null;async function L(Q,q){var B;if(!(!Q||A)){j(null),F(q);try{if(!((B=navigator.clipboard)!=null&&B.writeText))throw new Error(r("handoff.clipboardUnsupported"));await navigator.clipboard.writeText(Q),d.current!==void 0&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{F(ee=>ee===q?"":ee),d.current=void 0},1400)}catch(ee){F(""),j({message:ee instanceof Error?ee.message:String(ee),retryPairing:!1})}}}async function M(){const Q=v==null?void 0:v.sessionId;if(!(!Q||C)){j(null),N(!0);try{await i(Q)}catch(q){j({message:q instanceof Error?q.message:String(q),retryPairing:!1}),N(!1)}}}function U(Q){var q;m(Q),(q=document.getElementById(`sandbox-project-upload-install-${Q}-tab`))==null||q.focus()}function I(Q){const q=["conversation","terminal"],B=q.indexOf(h);let ee=null;Q.key==="ArrowRight"&&(ee=(B+1)%q.length),Q.key==="ArrowLeft"&&(ee=(B-1+q.length)%q.length),Q.key==="Home"&&(ee=0),Q.key==="End"&&(ee=q.length-1),ee!==null&&(Q.preventDefault(),U(q[ee]))}const H=g?SQt(g.expireAt,S):"00:00:00",K=g?S>=Date.parse(g.expireAt):!1;return Li.createPortal(o.jsx("div",{className:"sandbox-project-upload-backdrop",onMouseDown:Q=>{Q.target===Q.currentTarget&&t()},children:o.jsxs("section",{ref:a,className:"sandbox-project-upload-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-project-upload-title","aria-describedby":"sandbox-project-upload-description",children:[o.jsxs("header",{className:"sandbox-project-upload-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"sandbox-project-upload-title-row",children:[o.jsx("h2",{id:"sandbox-project-upload-title",children:r("handoff.title")}),o.jsx(ba,{className:"sandbox-project-upload-beta",color:"discovery",size:"sm",pill:!0,children:"Beta"})]}),o.jsx("p",{id:"sandbox-project-upload-description",children:r("handoff.description")})]}),o.jsx("button",{ref:l,type:"button",className:"sandbox-project-upload-close",onClick:t,"aria-label":r("handoff.closeAria"),children:o.jsx(fie,{})})]}),o.jsxs("div",{className:"sandbox-project-upload-body",children:[_?o.jsxs("div",{className:"sandbox-project-upload-error",role:"alert",children:[o.jsx("span",{children:_.message}),_.retryPairing?o.jsxs("button",{type:"button",onClick:()=>O(Q=>Q+1),children:[o.jsx(pie,{}),r("common.retry")]}):null]}):null,o.jsxs("section",{className:"sandbox-project-upload-stage",children:[o.jsxs("div",{className:"sandbox-project-upload-stage-head",children:[o.jsx("span",{className:"sandbox-project-upload-stage-number",children:"1"}),o.jsxs("div",{children:[o.jsx("h3",{children:r("handoff.installTitle")}),o.jsx("p",{children:r("handoff.installDescription")})]}),o.jsxs("button",{type:"button",onClick:()=>void L(h==="conversation"?T:P,h==="conversation"?"install-conversation":"install-terminal"),disabled:A!=="",children:[A===`install-${h}`?o.jsx($L,{}):o.jsx(hie,{}),A===`install-${h}`?r("handoff.copied"):r(h==="conversation"?"handoff.copyInstallPrompt":"handoff.copyInstallCommand")]})]}),o.jsxs("div",{className:`sandbox-project-upload-install-tabs is-${h}`,role:"tablist","aria-label":r("handoff.installMethodAria"),children:[o.jsx("span",{"aria-hidden":"true"}),o.jsx("button",{id:"sandbox-project-upload-install-conversation-tab",type:"button",role:"tab","aria-controls":"sandbox-project-upload-install-panel","aria-selected":h==="conversation",tabIndex:h==="conversation"?0:-1,onClick:()=>m("conversation"),onKeyDown:I,children:r("handoff.conversationInstall")}),o.jsx("button",{id:"sandbox-project-upload-install-terminal-tab",type:"button",role:"tab","aria-controls":"sandbox-project-upload-install-panel","aria-selected":h==="terminal",tabIndex:h==="terminal"?0:-1,onClick:()=>m("terminal"),onKeyDown:I,children:r("handoff.terminalInstall")})]}),o.jsx("div",{id:"sandbox-project-upload-install-panel",className:`sandbox-project-upload-prompt${h==="terminal"?" is-command":""}`,role:"tabpanel","aria-labelledby":`sandbox-project-upload-install-${h}-tab`,children:o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:h==="conversation"?T:P})})})]}),o.jsxs("section",{className:"sandbox-project-upload-stage",children:[o.jsxs("div",{className:"sandbox-project-upload-stage-head",children:[o.jsx("span",{className:"sandbox-project-upload-stage-number",children:"2"}),o.jsxs("div",{children:[o.jsx("h3",{children:r("handoff.taskTitle")}),o.jsx("p",{children:r("handoff.taskDescription")})]}),o.jsxs("button",{type:"button",onClick:()=>void L(R,"handoff"),disabled:!R||w||A!=="",children:[A==="handoff"?o.jsx($L,{}):o.jsx(hie,{}),r(A==="handoff"?"handoff.copied":"handoff.copyHandoffPrompt")]})]}),o.jsxs("div",{className:"sandbox-project-upload-pairing-notice",role:"status",children:[o.jsx("span",{children:w?r("handoff.generatingPairing"):K?r("handoff.pairingExpired"):r("handoff.pairingRemaining",{countdown:H})}),o.jsxs("button",{type:"button",disabled:w,onClick:()=>O(Q=>Q+1),children:[o.jsx(pie,{}),r(w?"handoff.refreshing":"handoff.refreshPairing")]})]}),o.jsx("div",{className:"sandbox-project-upload-prompt",children:w?o.jsxs("div",{className:"sandbox-project-upload-loading",role:"status",children:[o.jsx("i",{"aria-hidden":"true"}),r("handoff.pairingLoading")]}):R?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:R})}):o.jsx("div",{className:"sandbox-project-upload-loading",children:r("handoff.pairingUnavailable")})}),g&&v?o.jsxs("section",{className:"sandbox-project-upload-progress","aria-live":"polite","aria-label":r("handoff.statusAria"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("span",{children:r("handoff.statusTitle")}),v.state!=="issued"?o.jsx("p",{children:v.agentName||v.projectName?r("handoff.requestReceivedNamed",{name:v.agentName||v.projectName}):r("handoff.requestReceivedCurrent")}):o.jsx("p",{children:r("handoff.requestHelp")})]}),o.jsx("strong",{"data-state":v.state,children:TQt(v)})]}),o.jsx("ol",{children:kQt.map((Q,q)=>{const B=CQt(v,q);return o.jsxs("li",{"data-state":B,children:[o.jsxs("span",{className:"sandbox-project-upload-progress-marker",children:[B==="done"?o.jsx($L,{}):null,B==="failed"?o.jsx(fie,{}):null]}),o.jsx("span",{children:r(`handoff.steps.${Q.id}`)})]},Q.id)})}),v.state==="failed"&&v.error?o.jsx("p",{className:"sandbox-project-upload-progress-error",role:"alert",children:v.error}):null]}):null]})]}),o.jsxs("footer",{className:"sandbox-project-upload-actions",children:[o.jsx("button",{type:"button",onClick:t,children:r("common.close")}),((v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="completed")&&v.sessionId?o.jsx("button",{type:"button",className:"is-primary",disabled:C,onClick:()=>void M(),children:r(C?"handoff.entering":"handoff.enterCodex")}):null]})]})}),document.body)}function _Qt({client:e=dr,allowSkillSelection:t=!0,allowThreadManagement:n=!0,session:i,conversationBusy:r,onInputChange:s,onSessionPatch:a,onSnapshot:l,onActivity:c,onError:u}){const{t:d}=Te("sandbox"),f=p.useRef((i==null?void 0:i.id)??""),h=p.useRef(0),m=p.useRef(null);f.current=(i==null?void 0:i.id)??"";const[g,b]=p.useState(!1),[v,y]=p.useState([]),[x,O]=p.useState(!1),[w,k]=p.useState(!1),[S,E]=p.useState([]),[C,N]=p.useState(!1),[_,j]=p.useState(!1),[A,F]=p.useState([]),[T,P]=p.useState(!1),[R,L]=p.useState([]),[M,U]=p.useState(!1),[I,H]=p.useState(""),[K,Q]=p.useState(""),[q,B]=p.useState("");p.useEffect(()=>{var Me;(Me=m.current)==null||Me.abort(),m.current=null,h.current+=1,b(!1),y([]),O(!1),k(!1),E([]),N(!1),j(!1),F([]),P(!1),L([]),U(!1),H(""),Q(""),B("")},[i==null?void 0:i.id]);const ee=p.useCallback(async()=>{const Me=f.current;if(!Me)return[];O(!0);try{const Ie=await e.listModels(Me);return f.current===Me&&(y(Ie),k(!0)),Ie}catch(Ie){return f.current===Me&&(k(!0),u(Ie instanceof Error?Ie.message:String(Ie))),[]}finally{f.current===Me&&O(!1)}},[e,u]),le=p.useCallback(async()=>{if(!t)return[];const Me=f.current;if(!Me)return[];N(!0);try{const Ie=await e.listSkills(Me);return f.current===Me&&(E(Ie),j(!0)),Ie}catch(Ie){return f.current===Me&&(j(!0),u(Ie instanceof Error?Ie.message:String(Ie))),[]}finally{f.current===Me&&N(!1)}},[t,e,u]),se=p.useCallback(async(Me="",Ie=!1)=>{var Ee;const qe=f.current;if(!qe)return;(Ee=m.current)==null||Ee.abort();const Ae=new AbortController;m.current=Ae;const ze=++h.current;U(!0),H("");try{const De=await e.listThreads(qe,Me?{cursor:Me}:{},{signal:Ae.signal});f.current===qe&&h.current===ze&&(L(J=>{if(!Ie)return De.threads;const he=new Map(J.map(_e=>[_e.id,_e]));for(const _e of De.threads)he.set(_e.id,_e);return[...he.values()]}),Q(De.nextCursor??""))}catch(De){if((De==null?void 0:De.name)==="AbortError")return;f.current===qe&&h.current===ze&&H(De instanceof Error?De.message:String(De))}finally{m.current===Ae&&(m.current=null),f.current===qe&&h.current===ze&&U(!1)}},[e]),re=p.useCallback(()=>se("",!1),[se]),ge=p.useCallback(async()=>{!K||M||await se(K,!0)},[se,M,K]),W=p.useCallback(async()=>{P(!0),await re()},[re]);p.useEffect(()=>{if(!(!n||!(i!=null&&i.id)))return re(),()=>{var Me;(Me=m.current)==null||Me.abort(),m.current=null,h.current+=1}},[n,re,i==null?void 0:i.id]);function X(Me){l(Me),L(Ie=>[Me.thread,...Ie.filter(qe=>qe.id!==Me.thread.id)]),F([]),E([]),j(!1),P(!1)}async function ae(Me){const Ie=await e.newThread(Me);f.current===Me&&(X(Ie),c(d("commands.activity.new"),[{label:"Thread",value:Ie.threadId,code:!0}]))}async function ue(){const Me=f.current;if(!(!Me||g||r)){b(!0),H(""),u("");try{await ae(Me)}catch(Ie){if(f.current===Me){const qe=Ie instanceof Error?Ie.message:String(Ie);H(qe),u(qe)}}finally{f.current===Me&&b(!1)}}}async function Oe(Me){const Ie=f.current;if(!(!Ie||g||r)){if(Me===(i==null?void 0:i.threadId)){P(!1);return}b(!0),u("");try{const qe=await e.resumeThread(Ie,Me);if(f.current!==Ie)return;X(qe),c(d("commands.activity.resumed"),[{label:"Thread",value:qe.threadId,code:!0}])}catch(qe){f.current===Ie&&u(qe instanceof Error?qe.message:String(qe))}finally{f.current===Ie&&b(!1)}}}async function ke(Me){const Ie=f.current;if(!Ie||g||r)return!1;h.current+=1,U(!1),b(!0),B(Me),H(""),u("");try{const qe=await e.deleteThread(Ie,Me);return f.current!==Ie?!1:(qe.snapshot&&X(qe.snapshot),L(Ae=>Ae.filter(ze=>ze.id!==Me)),c(d("commands.activity.deleted"),[{label:"Thread",value:Me,code:!0}]),!0)}catch(qe){if(f.current===Ie){const Ae=qe instanceof Error?qe.message:String(qe);H(Ae),u(Ae)}return!1}finally{f.current===Ie&&(b(!1),B(""))}}async function st(Me){const Ie=i,qe=Me.trim();if(!qe.startsWith("/"))return!1;if(!Ie||r||g)return!0;const Ae=hQt(qe),ze=Ae&&ZI.find(Ee=>Ee.name===Ae.name);if(!Ae||!ze)return u(d("commands.unknown",{command:qe.split(/\s/,1)[0]})),!0;if(u(""),F([]),ze.name==="model"&&!Ae.argument)return s("/model "),w||await ee(),!0;if(ze.name==="skill"||ze.name==="skills")return t?(s("$"),_||(await le()).length===0&&s(""),!0):(u(d("commands.automaticSkills")),!0);if(ze.name==="resume"&&!Ae.argument)return s(""),await W(),!0;s(""),b(!0);try{if(ze.name==="model"){const Ee=await e.setModel(Ie.id,Ae.argument);if(f.current!==Ie.id)return!0;a({model:Ee}),c(d("commands.activity.modelChanged"),[{label:d("commands.modelLabel"),value:Ee,code:!0}])}else if(ze.name==="models"){const Ee=w?v:await ee();if(f.current!==Ie.id)return!0;c(Ee.length>0?d("commands.activity.availableModels"):d("commands.activity.noModels"),bQt(Ee,Ie.model))}else if(ze.name==="new"||ze.name==="clear")await ae(Ie.id);else if(ze.name==="resume"){const Ee=await e.resumeThread(Ie.id,Ae.argument);if(f.current!==Ie.id)return!0;X(Ee),c(d("commands.activity.resumed"),[{label:"Thread",value:Ee.threadId,code:!0}])}else if(ze.name==="fork"){const Ee=await e.forkThread(Ie.id);if(f.current!==Ie.id)return!0;X(Ee),c(d("commands.activity.forked"),[{label:"Thread",value:Ee.threadId,code:!0}])}else if(ze.name==="compact"){if(await e.compactThread(Ie.id),f.current!==Ie.id)return!0;c(d("commands.activity.compacting"),[{label:"Thread",value:Ie.threadId,code:!0}])}else if(ze.name==="archive"){const Ee=Ie.threadId,De=await e.archiveThread(Ie.id,Ee);if(f.current!==Ie.id)return!0;De.snapshot&&X(De.snapshot),L(J=>J.filter(he=>he.id!==Ee)),c(d("commands.activity.archived"),[{label:"Thread",value:Ee,code:!0}])}else if(ze.name==="status"){const Ee=await e.getStatus(Ie.id);if(f.current!==Ie.id)return!0;a(Ee),c(d("commands.activity.status"),yQt(Ee))}else ze.name==="help"&&c(d("commands.activity.help"),gQt())}catch(Ee){f.current===Ie.id&&(s(qe),u(Ee instanceof Error?Ee.message:String(Ee)))}finally{f.current===Ie.id&&b(!1)}return!0}function Le(){E([]),j(!1),F([])}return{commandBusy:g,models:v,modelsLoading:x,modelsLoaded:w,loadModels:ee,skills:S,skillsLoading:C,skillsLoaded:_,loadSkills:le,selectedSkills:A,setSelectedSkills:F,invalidateSkills:Le,threadsOpen:T,threads:R,threadsLoading:M,threadsError:I,threadsHasMore:!!K,threadActionId:q,openThreads:W,refreshThreads:re,loadMoreThreads:ge,closeThreads:()=>{g||(P(!1),H(""))},newThread:ue,resumeThread:Oe,deleteThread:ke,executeSlash:st}}const NQt={volcengine:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",byteplus:"https://docs.byteplus.com/en/docs/legal"};function jQt(e){return e.toLowerCase()==="github"?o.jsx(k7e,{className:"icon"}):o.jsx(C7e,{className:"icon"})}function RQt({branding:e,cloudProvider:t,onUsername:n}){const{t:i}=Te("shell"),[r,s]=p.useState(null),[a,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(""),h=p.useRef(null);p.useEffect(()=>{let y=!0;return s(null),l(""),Rbe().then(x=>{y&&s(x)}).catch(x=>{y&&l(x instanceof Error?x.message:String(x))}),()=>{y=!1}},[c]);const m=r!==null&&r.length===0;p.useEffect(()=>{var y;m&&((y=h.current)==null||y.focus())},[m]);const g=z7e.test(d),b=t==="byteplus"?Y7:ER,v=()=>{g&&n(d)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||b,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(xn,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),a?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:a}),o.jsx("button",{type:"button",onClick:()=>u(y=>y+1),children:i("login.retry")})]}):r===null?null:r.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:i("login.signInToContinue")}),o.jsx("div",{className:"login-providers",children:r.map(y=>o.jsxs("button",{className:"login-btn",onClick:()=>H7e(y.loginUrl),children:[jQt(y.id),o.jsx("span",{children:i("login.signInWith",{provider:y.id==="veidentity"?i(`login.identityProvider.${t}`):y.label})})]},y.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:i("login.enterUsername")}),o.jsxs("form",{className:"login-name",onSubmit:y=>{y.preventDefault(),v()},children:[o.jsx("input",{ref:h,className:"login-name-input",value:d,onChange:y=>f(y.target.value),placeholder:i("login.usernamePlaceholder"),maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!g,"aria-label":i("login.enter"),children:o.jsx(bO,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:d&&!g?i("login.usernameInvalid"):""})]}),o.jsx("p",{className:"login-powered",children:i(`login.powered.${t}`)}),o.jsxs("p",{className:"login-legal",children:[i("login.legalPrefix")," ",o.jsx("a",{href:NQt[t],target:"_blank",rel:"noreferrer",children:i("login.terms")})]})]})}),o.jsx("footer",{className:"login-footer",children:i("login.copyright",{year:2026})})]})}function IQt({open:e,checking:t,error:n,onLogin:i}){const{t:r}=Te("shell"),s=p.useRef(null);return p.useEffect(()=>{var l;if(!e)return;const a=document.body.style.overflow;return document.body.style.overflow="hidden",(l=s.current)==null||l.focus(),()=>{document.body.style.overflow=a}},[e]),e?Li.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(X2,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:r("authExpired.title")}),o.jsx("p",{id:"auth-expired-description",children:r("authExpired.description")}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:i,disabled:t,children:r(t?"authExpired.waiting":"authExpired.signInAgain")})})]})}),document.body):null}const PQt=["slow","crash","incorrect","tool_error","other"];function DQt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function MQt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function LQt({onClose:e,onSubmit:t}){const{t:n}=Te("feedback"),i=p.useId(),r=p.useId(),s=p.useRef(null),a=p.useRef(null),l=p.useRef(!1),c=p.useRef(e),[u,d]=p.useState(()=>new Set),[f,h]=p.useState(""),[m,g]=p.useState(!1),[b,v]=p.useState(""),[y,x]=p.useState(!1);l.current=m,c.current=e,p.useEffect(()=>{var N;const S=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(N=a.current)==null||N.focus();const C=_=>{var T;if(_.key==="Escape"&&!l.current){_.preventDefault(),c.current();return}if(_.key!=="Tab")return;const j=Array.from(((T=s.current)==null?void 0:T.querySelectorAll("button:not(:disabled), textarea:not(:disabled)"))??[]);if(j.length===0)return;const A=j[0],F=j[j.length-1];_.shiftKey&&document.activeElement===A?(_.preventDefault(),F.focus()):!_.shiftKey&&document.activeElement===F&&(_.preventDefault(),A.focus())};return window.addEventListener("keydown",C),()=>{document.body.style.overflow=S,window.removeEventListener("keydown",C),E!=null&&E.isConnected&&E.focus()}},[]);const O=S=>{d(E=>{const C=new Set(E);return C.has(S)?C.delete(S):C.add(S),C})},w=async()=>{if(!(m||y)){g(!0),v("");try{await t({issues:[...u],description:f.trim()}),x(!0)}catch(S){v(S instanceof Error?S.message:String(S))}finally{g(!1)}}},k=u.size>0||f.trim().length>0;return Li.createPortal(o.jsx("div",{className:"issue-feedback-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!m&&e()},children:o.jsxs("section",{ref:s,className:"issue-feedback-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":y?`${r}-success`:r,"aria-busy":m||void 0,children:[o.jsxs("header",{className:"issue-feedback-head",children:[o.jsx("h2",{id:i,children:n("title")}),o.jsx("button",{type:"button",className:"issue-feedback-close",onClick:e,disabled:m,"aria-label":n("dialog.close"),children:o.jsx(DQt,{})})]}),y?o.jsxs("div",{className:"issue-feedback-success",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"issue-feedback-success-mark","aria-hidden":"true",children:o.jsx(MQt,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:n("success.title")}),o.jsx("p",{id:`${r}-success`,children:n("success.description")})]})]}):o.jsxs("div",{className:"issue-feedback-body",children:[o.jsx("p",{id:r,className:"issue-feedback-intro",children:n("dialog.intro")}),o.jsx("p",{className:"issue-feedback-privacy",role:"alert",children:n("dialog.privacy")}),o.jsx("div",{className:"issue-feedback-chips","aria-label":n("commonIssues"),children:PQt.map(S=>o.jsx("button",{type:"button",className:"issue-feedback-chip","aria-pressed":u.has(S),onClick:()=>O(S),disabled:m,children:n(`dialog.issues.${S}`)},S))}),o.jsxs("label",{className:"issue-feedback-field",children:[o.jsx("span",{children:n("descriptionLabel")}),o.jsx("textarea",{ref:a,value:f,onChange:S=>h(S.target.value),placeholder:n("dialog.descriptionPlaceholder"),maxLength:4e3,rows:5,disabled:m})]}),b&&o.jsx("p",{className:"issue-feedback-error",role:"alert",children:b})]}),o.jsx("footer",{className:"issue-feedback-actions",children:y?o.jsx("button",{type:"button",className:"is-primary",onClick:e,children:n("done")}):o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:e,disabled:m,children:n("cancel")}),o.jsx("button",{type:"button",className:"is-primary",onClick:()=>void w(),disabled:!k||m,children:n(m?"submitting":"submit")})]})})]})}),document.body)}function $Qt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),t&&(i.href=t),r.href=e,r.href}const FQt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function om(e){const t=[];for(let n=0,i=e.length;nBl||e.height>Bl)&&(e.width>Bl&&e.height>Bl?e.width>e.height?(e.height*=Bl/e.width,e.width=Bl):(e.width*=Bl/e.height,e.height=Bl):e.width>Bl?(e.height*=Bl/e.width,e.width=Bl):(e.width*=Bl/e.height,e.height=Bl))}function VQt(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const i=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),r=i.length,s=new Uint8Array(r);for(let a=0;a{const i=new Image;i.onload=()=>{i.decode().then(()=>{requestAnimationFrame(()=>t(i))})},i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}async function HQt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qQt(e,t,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),r.appendChild(s),s.appendChild(e),HQt(r)}const yl=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||yl(n,t)};function WQt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function GQt(e,t){return wIe(t).map(n=>{const i=e.getPropertyValue(n),r=e.getPropertyPriority(n);return`${n}: ${i}${r?" !important":""};`}).join(" ")}function KQt(e,t,n,i){const r=`.${e}:${t}`,s=n.cssText?WQt(n):GQt(n,i);return document.createTextNode(`${r}{${s}}`)}function mie(e,t,n,i){const r=window.getComputedStyle(e,n),s=r.getPropertyValue("content");if(s===""||s==="none")return;const a=FQt();try{t.className=`${t.className} ${a}`}catch{return}const l=document.createElement("style");l.appendChild(KQt(a,n,r,i)),t.appendChild(l)}function XQt(e,t,n){mie(e,t,":before",n),mie(e,t,":after",n)}const gie="application/font-woff",bie="image/jpeg",YQt={woff:gie,woff2:gie,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:bie,jpeg:bie,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ZQt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function vz(e){const t=ZQt(e).toLowerCase();return YQt[t]||""}function JQt(e){return e.split(/,/)[1]}function H8(e){return e.search(/^(data:)/)!==-1}function ezt(e,t){return`data:${t};base64,${e}`}async function SIe(e,t,n){const i=await fetch(e,t);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((s,a)=>{const l=new FileReader;l.onerror=a,l.onloadend=()=>{try{s(n({res:i,result:l.result}))}catch(c){a(c)}},l.readAsDataURL(r)})}const FL={};function tzt(e,t,n){let i=e.replace(/\?.*/,"");return n&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),t?`[${t}]${i}`:i}async function xz(e,t,n){const i=tzt(e,t,n.includeQueryParams);if(FL[i]!=null)return FL[i];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const s=await SIe(e,n.fetchRequestInit,({res:a,result:l})=>(t||(t=a.headers.get("Content-Type")||""),JQt(l)));r=ezt(s,t)}catch(s){r=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return FL[i]=r,r}async function nzt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):yj(t)}async function izt(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const l=s.toDataURL();return yj(l)}const n=e.poster,i=vz(n),r=await xz(n,i,t);return yj(r)}async function rzt(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await JI(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function szt(e,t){return yl(e,HTMLCanvasElement)?nzt(e):yl(e,HTMLVideoElement)?izt(e,t):yl(e,HTMLIFrameElement)?rzt(e,t):e.cloneNode(kIe(e))}const azt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",kIe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ozt(e,t,n){var i,r;if(kIe(t))return t;let s=[];return azt(e)&&e.assignedNodes?s=om(e.assignedNodes()):yl(e,HTMLIFrameElement)&&(!((i=e.contentDocument)===null||i===void 0)&&i.body)?s=om(e.contentDocument.body.childNodes):s=om(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),s.length===0||yl(e,HTMLVideoElement)||await s.reduce((a,l)=>a.then(()=>JI(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function lzt(e,t,n){const i=t.style;if(!i)return;const r=window.getComputedStyle(e);r.cssText?(i.cssText=r.cssText,i.transformOrigin=r.transformOrigin):wIe(n).forEach(s=>{let a=r.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),yl(e,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),i.setProperty(s,a,r.getPropertyPriority(s))})}function czt(e,t){yl(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),yl(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function uzt(e,t){if(yl(e,HTMLSelectElement)){const n=t,i=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function dzt(e,t,n){return yl(t,Element)&&(lzt(e,t,n),XQt(e,t,n),czt(e,t),uzt(e,t)),t}async function fzt(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const i={};for(let s=0;sszt(i,t)).then(i=>ozt(e,i,t)).then(i=>dzt(e,i,t)).then(i=>fzt(i,t))}const EIe=/url\((['"]?)([^'"]+?)\1\)/g,hzt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,pzt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mzt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function gzt(e){const t=[];return e.replace(EIe,(n,i,r)=>(t.push(r),n)),t.filter(n=>!H8(n))}async function bzt(e,t,n,i,r){try{const s=n?$Qt(t,n):t,a=vz(t);let l;return r||(l=await xz(s,a,i)),e.replace(mzt(t),`$1${l}$3`)}catch{}return e}function yzt(e,{preferredFontFormat:t}){return t?e.replace(pzt,n=>{for(;;){const[i,,r]=hzt.exec(n)||[];if(!r)return"";if(r===t)return`src: ${i};`}}):e}function CIe(e){return e.search(EIe)!==-1}async function TIe(e,t,n){if(!CIe(e))return e;const i=yzt(e,n);return gzt(i).reduce((s,a)=>s.then(l=>bzt(l,a,t,n)),Promise.resolve(i))}async function K0(e,t,n){var i;const r=(i=t.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(r){const s=await TIe(r,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function vzt(e,t){await K0("background",e,t)||await K0("background-image",e,t),await K0("mask",e,t)||await K0("-webkit-mask",e,t)||await K0("mask-image",e,t)||await K0("-webkit-mask-image",e,t)}async function xzt(e,t){const n=yl(e,HTMLImageElement);if(!(n&&!H8(e.src))&&!(yl(e,SVGImageElement)&&!H8(e.href.baseVal)))return;const i=n?e.src:e.href.baseVal,r=await xz(i,vz(i),t);await new Promise((s,a)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...c)=>{try{s(t.onImageErrorHandler(...c))}catch(u){a(u)}}:a;const l=e;l.decode&&(l.decode=s),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=r):e.href.baseVal=r})}async function wzt(e,t){const i=om(e.childNodes).map(r=>AIe(r,t));await Promise.all(i).then(()=>e)}async function AIe(e,t){yl(e,Element)&&(await vzt(e,t),await xzt(e,t),await wzt(e,t))}function Ozt(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const i=t.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),e}const yie={};async function vie(e){let t=yie[e];if(t!=null)return t;const i=await(await fetch(e)).text();return t={url:e,cssText:i},yie[e]=t,t}async function xie(e,t){let n=e.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let l=a.replace(i,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),SIe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(a,`url(${c})`),[a,c]))});return Promise.all(s).then(()=>n)}function wie(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(i);if(c===null)break;t.push(c[0])}i=i.replace(r,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(a,"gi");for(;;){let c=s.exec(i);if(c===null){if(c=l.exec(i),c===null)break;s.lastIndex=l.lastIndex}else l.lastIndex=s.lastIndex;t.push(c[0])}return t}async function Szt(e,t){const n=[],i=[];return e.forEach(r=>{if("cssRules"in r)try{om(r.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let l=a+1;const c=s.href,u=vie(c).then(d=>xie(d,t)).then(d=>wie(d).forEach(f=>{try{r.insertRule(f,f.startsWith("@import")?l+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:f,error:h})}})).catch(d=>{console.error("Error loading remote css",d.toString())});i.push(u)}})}catch(s){const a=e.find(l=>l.href==null)||document.styleSheets[0];r.href!=null&&i.push(vie(r.href).then(l=>xie(l,t)).then(l=>wie(l).forEach(c=>{a.insertRule(c,a.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",s)}}),Promise.all(i).then(()=>(e.forEach(r=>{if("cssRules"in r)try{om(r.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${r.href}`,s)}}),n))}function kzt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>CIe(t.style.getPropertyValue("src")))}async function Ezt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=om(e.ownerDocument.styleSheets),i=await Szt(n,t);return kzt(i)}function _Ie(e){return e.trim().replace(/["']/g,"")}function Czt(e){const t=new Set;function n(i){(i.style.fontFamily||getComputedStyle(i).fontFamily).split(",").forEach(s=>{t.add(_Ie(s))}),Array.from(i.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function NIe(e,t){const n=await Ezt(e,t),i=Czt(e);return(await Promise.all(n.filter(s=>i.has(_Ie(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return TIe(s.cssText,a,t)}))).join(` -`)}async function Tzt(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await NIe(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Azt(e,t={}){const{width:n,height:i}=OIe(e,t),r=await JI(e,t,!0);return await Tzt(r,t),await AIe(r,t),Ozt(r,t),await qQt(r,n,i)}async function _zt(e,t={}){const{width:n,height:i}=OIe(e,t),r=await Azt(e,t),s=await yj(r),a=document.createElement("canvas"),l=a.getContext("2d"),c=t.pixelRatio||QQt(),u=t.canvasWidth||n,d=t.canvasHeight||i;return a.width=u*c,a.height=d*c,t.skipAutoScale||zQt(a),a.style.width=`${u}`,a.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,a.width,a.height)),l.drawImage(s,0,0,a.width,a.height),a}async function Nzt(e,t={}){const n=await _zt(e,t);return await VQt(n)}async function jzt(e,t={}){return NIe(e,t)}const Rzt=816,HA=1154,Izt=12e3,Pzt=.72,Dzt=HA*1.12,A2=10,jIe=[".turn--user",".turn--assistant",".codex-sandbox-run__event",".block-tool",".block-thinking",".block-progress",".block-plan",".tool-result",".share-message-export-note","p","pre","li"].join(", ");function Mzt(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function Lzt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function $zt(){const e=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return e?`hsl(${e})`:"white"}function Fzt(e){const t=e.closest(".transcript");if(!t)return[e];const n=Array.from(t.children).filter(r=>r instanceof HTMLElement&&r.matches(".turn--user, .turn--assistant")),i=n.indexOf(e);return i>=0?n.slice(0,i+1):[e]}function Bzt(e){e.querySelectorAll(".block-tool, .block-thinking, .block-progress, .block-plan").forEach(t=>{t.style.opacity="1",t.style.transform="none",t.style.animation="none"}),e.querySelectorAll(".think-collapse").forEach(t=>{t.classList.add("open"),t.style.gridTemplateRows="1fr",t.style.transition="none"}),e.querySelectorAll(".codex-sandbox-run__stream, .think-body, .tool-result").forEach(t=>{t.style.height="auto",t.style.maxHeight="none",t.style.overflow="visible",t.scrollTop=0,t.scrollLeft=0}),e.querySelectorAll(".tool-args").forEach(t=>{t.style.maxWidth="100%",t.style.overflowWrap="anywhere",t.style.whiteSpace="pre-wrap"}),e.querySelectorAll(".think-collapse-inner").forEach(t=>{t.style.height="auto",t.style.overflow="visible"})}function Uzt(e){e.querySelectorAll(".codex-sandbox-run").forEach(t=>{var n,i;(i=(n=t.parentElement)==null?void 0:n.querySelector(":scope > .tool-detail"))==null||i.remove()})}function Qzt(e){const t=document.createElement("section");t.className="share-message-export",t.setAttribute("aria-hidden","true");for(const i of Fzt(e)){const r=i.cloneNode(!0);r.removeAttribute("data-share-message-source"),r.classList.remove("is-feedback-target"),r.style.opacity="1",r.style.transform="none",r.style.animation="none",r.querySelectorAll("[data-share-image-exclude]").forEach(s=>s.remove()),Bzt(r),Uzt(r),t.append(r)}const n=document.createElement("p");return n.className="share-message-export-note",n.textContent=an.t("share.exportNote",{ns:"conversation"}),t.append(n),document.body.append(t),t}function zzt(e){const t=Math.max(1,Math.ceil(e.scrollHeight)),n=e.getBoundingClientRect().top,i=Array.from(e.querySelectorAll(jIe)).map(a=>{const l=a.getBoundingClientRect();return{top:Math.floor(l.top-n),bottom:Math.ceil(l.bottom-n),height:Math.ceil(l.height)}}).filter(({bottom:a,height:l})=>a>0&&a0).sort((a,l)=>a.bottom-l.bottom),r=[];let s=0;for(;sh.top>=c&&h.top>s&&h.topl&&h.height<=HA?f===void 0?h.top:Math.min(f,h.top):f,void 0)??i.reduce((f,h)=>h.bottom>=c&&h.bottom<=l?h.bottom:f,l);r.push({top:s,height:Math.max(1,d-s)}),s=d}return r}function Vzt(e){const t=[];for(const n of e){const i=t[t.length-1],r=n.top+n.height;i&&r-i.top<=Izt?(i.pages.push(n),i.height=r-i.top):t.push({top:n.top,height:n.height,pages:[n]})}return t}function Hzt(e){const t=e.getBoundingClientRect().top,n=new WeakMap;return e.querySelectorAll("*").forEach(i=>{const r=i.getBoundingClientRect();n.set(i,{top:r.top-t,bottom:r.bottom-t,height:r.height,position:getComputedStyle(i).position})}),n}function RIe(e,t,n,i){if(e.matches(jIe))return;const r=Array.from(e.children).filter(l=>l instanceof HTMLElement),s=Array.from(t.children).filter(l=>l instanceof HTMLElement),a=n.top+n.height;for(let l=r.length-1;l>=0;l-=1){const c=r[l],u=s[l],d=i.get(c);if(!u||!d)continue;if(d.bottom>n.top&&d.top{e.toBlob(i=>{i?t(i):n(new Error(an.t("share.imageFailed",{ns:"conversation"})))},"image/png")})}async function Gzt(e,t,n){const i=await createImageBitmap(e),r=i.width/t,s=i.height/n.height,a=[];try{for(const l of n.pages){const c=document.createElement("canvas");c.width=t,c.height=l.height;const u=c.getContext("2d");if(!u)throw new Error(an.t("share.browserUnsupported",{ns:"conversation"}));u.drawImage(i,0,(l.top-n.top)*s,t*r,l.height*s,0,0,t,l.height),a.push({blob:await Wzt(c),width:t,height:l.height}),c.width=0,c.height=0}}finally{i.close()}return a}async function Kzt(e){var n;(n=document.fonts)!=null&&n.ready&&await document.fonts.ready;const t=Qzt(e);try{const i=Math.max(Rzt,Math.ceil(t.scrollWidth)),r=zzt(t),s=Vzt(r),a=Hzt(t),l=await jzt(t),c=[];for(const[u,d]of s.entries()){const f=qzt(t,d,u+1,s.length,a);try{const h=await Nzt(f,{width:i,height:d.height,pixelRatio:1,backgroundColor:$zt(),fontEmbedCSS:l,style:{position:"static",top:"auto",left:"auto",width:`${i}px`,height:`${d.height}px`,margin:"0",overflow:"hidden",animation:"none"}});if(!h)throw new Error(an.t("share.imageFailed",{ns:"conversation"}));c.push(...await Gzt(h,i,d))}finally{f.remove()}}return c}finally{t.remove()}}function Xzt(e){return`agentkit-conversation-${e}.pdf`}function IIe(e,t,n){const i=Math.max(2,String(t).length);return`agentkit-conversation-${n}-page-${String(e).padStart(i,"0")}.png`}function Yzt(e){return`agentkit-conversation-${e}-png-pages.zip`}const Zzt=Array.from({length:256},(e,t)=>{let n=t;for(let i=0;i<8;i+=1)n=n&1?3988292384^n>>>1:n>>>1;return n>>>0});function Jzt(e){let t=4294967295;for(const n of e)t=Zzt[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}async function eVt(e,t){const n=new TextEncoder,i=[],r=[];let s=0,a=0;for(const[u,d]of e.entries()){const f=IIe(u+1,e.length,t),h=n.encode(f),m=new Uint8Array(await d.blob.arrayBuffer()),g=Jzt(m),b=new ArrayBuffer(30),v=new DataView(b);v.setUint32(0,67324752,!0),v.setUint16(4,20,!0),v.setUint16(6,2048,!0),v.setUint16(8,0,!0),v.setUint32(14,g,!0),v.setUint32(18,m.byteLength,!0),v.setUint32(22,m.byteLength,!0),v.setUint16(26,h.byteLength,!0),i.push(b,h,m);const y=new ArrayBuffer(46),x=new DataView(y);x.setUint32(0,33639248,!0),x.setUint16(4,20,!0),x.setUint16(6,20,!0),x.setUint16(8,2048,!0),x.setUint16(10,0,!0),x.setUint32(16,g,!0),x.setUint32(20,m.byteLength,!0),x.setUint32(24,m.byteLength,!0),x.setUint16(28,h.byteLength,!0),x.setUint32(42,s,!0),r.push(y,h),s+=30+h.byteLength+m.byteLength,a+=46+h.byteLength}const l=new ArrayBuffer(22),c=new DataView(l);return c.setUint32(0,101010256,!0),c.setUint16(8,e.length,!0),c.setUint16(10,e.length,!0),c.setUint32(12,a,!0),c.setUint32(16,s,!0),new Blob([...i,...r,l],{type:"application/zip"})}async function tVt(e){const{jsPDF:t}=await Md(async()=>{const{jsPDF:l}=await import("../chunks/jspdf.es.min-nhrMhkEQ.js").then(c=>c.j);return{jsPDF:l}},[]),n=new t({orientation:"portrait",unit:"mm",format:"a4",compress:!0}),i=n.internal.pageSize.getWidth(),r=n.internal.pageSize.getHeight(),s=i-A2*2,a=r-A2*2;for(const[l,c]of e.entries()){const u=new Uint8Array(await c.blob.arrayBuffer()),d=Math.min(s/c.width,a/c.height),f=c.width*d,h=c.height*d;l>0&&n.addPage(),n.addImage(u,"PNG",A2+(s-f)/2,A2,f,h,`conversation-export-${l}`,"FAST")}return new Blob([n.output("arraybuffer")],{type:"application/pdf"})}function BL(e,t){const n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.style.display="none",document.body.append(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function nVt({targetTurn:e,onClose:t}){const{t:n}=Te("conversation"),i=p.useId(),r=p.useId(),s=p.useId(),a=p.useRef(null),l=p.useRef(null),c=p.useRef(t),u=p.useRef(void 0),d=p.useRef(!0),[f,h]=p.useState("generating"),[m,g]=p.useState(0),[b,v]=p.useState([]),[y,x]=p.useState(""),[O,w]=p.useState(""),[k,S]=p.useState("idle"),[E,C]=p.useState("idle"),[N,_]=p.useState("png");c.current=t,p.useEffect(()=>{var M;d.current=!0;const P=document.body.style.overflow,R=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(M=l.current)==null||M.focus();const L=U=>{var Q;if(U.key==="Escape"){U.preventDefault(),c.current();return}if(U.key!=="Tab")return;const I=Array.from(((Q=a.current)==null?void 0:Q.querySelectorAll("button:not(:disabled)"))??[]);if(I.length===0)return;const H=I[0],K=I[I.length-1];U.shiftKey&&document.activeElement===H?(U.preventDefault(),K.focus()):!U.shiftKey&&document.activeElement===K&&(U.preventDefault(),H.focus())};return window.addEventListener("keydown",L),()=>{d.current=!1,document.body.style.overflow=P,window.removeEventListener("keydown",L),u.current!==void 0&&window.clearTimeout(u.current),R!=null&&R.isConnected&&R.focus()}},[]),p.useEffect(()=>{let P=!1,R="";return h("generating"),v([]),x(""),w(""),S("idle"),(async()=>{try{if(await Mzt(),P)return;const M=await Kzt(e);if(M.length===0)throw new Error(n("share.imageFailed"));if(R=URL.createObjectURL(M[0].blob),P){URL.revokeObjectURL(R);return}v(M),x(R),h("ready")}catch(M){if(P)return;h("error"),w(M instanceof Error?M.message:String(M))}})(),()=>{P=!0,R&&URL.revokeObjectURL(R)}},[m,e]);const j=async()=>{var R;const P=b[0];if(!(!P||k==="copying")){S("copying"),w("");try{if(!((R=navigator.clipboard)!=null&&R.write)||typeof ClipboardItem>"u")throw new Error(n("share.copyUnsupported"));await navigator.clipboard.write([new ClipboardItem({"image/png":P.blob})]),S("copied"),u.current=window.setTimeout(()=>S("idle"),1500)}catch(L){S("idle"),w(L instanceof Error?L.message:String(L))}}},A=P=>{_(P),S("idle"),w("")},F=(P,R)=>{var H,K;const L=["png","pdf"],M=L.indexOf(R);let U=M;if(P.key==="ArrowRight"||P.key==="ArrowDown")U=(M+1)%L.length;else if(P.key==="ArrowLeft"||P.key==="ArrowUp")U=(M-1+L.length)%L.length;else if(P.key==="Home")U=0;else if(P.key==="End")U=L.length-1;else return;P.preventDefault();const I=L[U];A(I),(K=(H=a.current)==null?void 0:H.querySelector(`[data-export-format="${I}"]`))==null||K.focus()},T=async()=>{if(!(b.length===0||E==="downloading")){C("downloading"),w("");try{const P=new Date().toISOString().replace(/[:.]/g,"-");if(N==="pdf"){const R=await tVt(b);BL(R,Xzt(P))}else if(b.length===1)BL(b[0].blob,IIe(1,1,P));else{const R=await eVt(b,P);BL(R,Yzt(P))}}catch(P){d.current&&w(P instanceof Error?P.message:n("share.exportFailed"))}finally{d.current&&C("idle")}}};return Li.createPortal(o.jsx("div",{className:"share-message-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&t()},children:o.jsxs("section",{ref:a,className:"share-message-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":f==="generating"||E==="downloading",children:[o.jsxs("header",{className:"share-message-head",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("share.title")}),o.jsx("p",{id:r,children:n("share.description")})]}),o.jsx("button",{ref:l,type:"button",className:"share-message-close","aria-label":n("share.close"),title:n("share.close"),onClick:t,children:o.jsx(Lzt,{})})]}),o.jsxs("div",{className:"share-message-body",children:[f==="generating"?o.jsx("div",{className:"share-message-generating",role:"status",children:o.jsx(xn,{children:n("share.generatingContent")})}):f==="error"?o.jsxs("div",{className:"share-message-failure",children:[o.jsx("p",{role:"alert",children:O||n("share.imageFailed")}),o.jsx("button",{type:"button",onClick:()=>g(P=>P+1),children:n("share.retry")})]}):o.jsxs("figure",{className:"share-message-preview",children:[o.jsx("figcaption",{className:"share-message-preview-meta",children:n("share.previewPage",{count:b.length})}),o.jsx("img",{src:y,alt:n("share.previewAlt",{count:b.length})})]}),f!=="error"&&O&&o.jsx("p",{className:"share-message-error",role:"alert",children:O})]}),o.jsxs("div",{className:"share-message-options",children:[o.jsx("span",{id:s,className:"share-message-format-label",children:n("share.format")}),o.jsx("div",{className:"share-message-format",role:"radiogroup","aria-labelledby":s,children:["png","pdf"].map(P=>o.jsx("button",{type:"button",role:"radio","data-export-format":P,className:N===P?"is-active":"","aria-checked":N===P,tabIndex:N===P?0:-1,disabled:E==="downloading",onClick:()=>A(P),onKeyDown:R=>F(R,P),children:P.toUpperCase()},P))})]}),o.jsxs("footer",{className:"share-message-actions",children:[o.jsx("span",{className:"share-message-download-status","aria-live":"polite",children:E==="downloading"?n("share.generatingFormat",{format:N.toUpperCase()}):""}),N==="png"&&o.jsx("button",{type:"button",onClick:()=>void j(),disabled:b.length===0||f!=="ready"||k==="copying",children:k==="copying"?n("share.copying"):k==="copied"?b.length>1?n("share.copiedFirst"):n("share.copied"):b.length>1?n("share.copyFirst"):n("share.copyImage")}),o.jsx("button",{type:"button",className:"is-primary",onClick:()=>void T(),disabled:b.length===0||f!=="ready"||E==="downloading",children:E==="downloading"?n("share.generating"):N==="png"&&b.length>1?n("share.downloadArchive",{count:b.length}):n("share.downloadFormat",{format:N.toUpperCase()})})]})]})}),document.body)}const iVt=2e3,rVt=700,PIe=1200;function wz(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function DIe(e){return wz(e.trim(),rVt)}function MIe(e){return wz(e,PIe)}function Oie(e){return e.trim().length>0}function sVt(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=DIe(e),r=MIe(t.trim());return wz(`${n.selectedExcerpt}${n.separator}${i} +`)}async function Tzt(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await NIe(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Azt(e,t={}){const{width:n,height:i}=OIe(e,t),r=await JI(e,t,!0);return await Tzt(r,t),await AIe(r,t),Ozt(r,t),await qQt(r,n,i)}async function _zt(e,t={}){const{width:n,height:i}=OIe(e,t),r=await Azt(e,t),s=await yj(r),a=document.createElement("canvas"),l=a.getContext("2d"),c=t.pixelRatio||QQt(),u=t.canvasWidth||n,d=t.canvasHeight||i;return a.width=u*c,a.height=d*c,t.skipAutoScale||zQt(a),a.style.width=`${u}`,a.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,a.width,a.height)),l.drawImage(s,0,0,a.width,a.height),a}async function Nzt(e,t={}){const n=await _zt(e,t);return await VQt(n)}async function jzt(e,t={}){return NIe(e,t)}const Rzt=816,HA=1154,Izt=12e3,Pzt=.72,Dzt=HA*1.12,A2=10,jIe=[".turn--user",".turn--assistant",".codex-sandbox-run__event",".block-tool",".block-thinking",".block-progress",".block-plan",".tool-result",".share-message-export-note","p","pre","li"].join(", ");function Mzt(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function Lzt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function $zt(){const e=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return e?`hsl(${e})`:"white"}function Fzt(e){const t=e.closest(".transcript");if(!t)return[e];const n=Array.from(t.children).filter(r=>r instanceof HTMLElement&&r.matches(".turn--user, .turn--assistant")),i=n.indexOf(e);return i>=0?n.slice(0,i+1):[e]}function Bzt(e){e.querySelectorAll(".block-tool, .block-thinking, .block-progress, .block-plan").forEach(t=>{t.style.opacity="1",t.style.transform="none",t.style.animation="none"}),e.querySelectorAll(".think-collapse").forEach(t=>{t.classList.add("open"),t.style.gridTemplateRows="1fr",t.style.transition="none"}),e.querySelectorAll(".codex-sandbox-run__stream, .think-body, .tool-result").forEach(t=>{t.style.height="auto",t.style.maxHeight="none",t.style.overflow="visible",t.scrollTop=0,t.scrollLeft=0}),e.querySelectorAll(".tool-args").forEach(t=>{t.style.maxWidth="100%",t.style.overflowWrap="anywhere",t.style.whiteSpace="pre-wrap"}),e.querySelectorAll(".think-collapse-inner").forEach(t=>{t.style.height="auto",t.style.overflow="visible"})}function Uzt(e){e.querySelectorAll(".codex-sandbox-run").forEach(t=>{var n,i;(i=(n=t.parentElement)==null?void 0:n.querySelector(":scope > .tool-detail"))==null||i.remove()})}function Qzt(e){const t=document.createElement("section");t.className="share-message-export",t.setAttribute("aria-hidden","true");for(const i of Fzt(e)){const r=i.cloneNode(!0);r.removeAttribute("data-share-message-source"),r.classList.remove("is-feedback-target"),r.style.opacity="1",r.style.transform="none",r.style.animation="none",r.querySelectorAll("[data-share-image-exclude]").forEach(s=>s.remove()),Bzt(r),Uzt(r),t.append(r)}const n=document.createElement("p");return n.className="share-message-export-note",n.textContent=an.t("share.exportNote",{ns:"conversation"}),t.append(n),document.body.append(t),t}function zzt(e){const t=Math.max(1,Math.ceil(e.scrollHeight)),n=e.getBoundingClientRect().top,i=Array.from(e.querySelectorAll(jIe)).map(a=>{const l=a.getBoundingClientRect();return{top:Math.floor(l.top-n),bottom:Math.ceil(l.bottom-n),height:Math.ceil(l.height)}}).filter(({bottom:a,height:l})=>a>0&&a0).sort((a,l)=>a.bottom-l.bottom),r=[];let s=0;for(;sh.top>=c&&h.top>s&&h.topl&&h.height<=HA?f===void 0?h.top:Math.min(f,h.top):f,void 0)??i.reduce((f,h)=>h.bottom>=c&&h.bottom<=l?h.bottom:f,l);r.push({top:s,height:Math.max(1,d-s)}),s=d}return r}function Vzt(e){const t=[];for(const n of e){const i=t[t.length-1],r=n.top+n.height;i&&r-i.top<=Izt?(i.pages.push(n),i.height=r-i.top):t.push({top:n.top,height:n.height,pages:[n]})}return t}function Hzt(e){const t=e.getBoundingClientRect().top,n=new WeakMap;return e.querySelectorAll("*").forEach(i=>{const r=i.getBoundingClientRect();n.set(i,{top:r.top-t,bottom:r.bottom-t,height:r.height,position:getComputedStyle(i).position})}),n}function RIe(e,t,n,i){if(e.matches(jIe))return;const r=Array.from(e.children).filter(l=>l instanceof HTMLElement),s=Array.from(t.children).filter(l=>l instanceof HTMLElement),a=n.top+n.height;for(let l=r.length-1;l>=0;l-=1){const c=r[l],u=s[l],d=i.get(c);if(!u||!d)continue;if(d.bottom>n.top&&d.top{e.toBlob(i=>{i?t(i):n(new Error(an.t("share.imageFailed",{ns:"conversation"})))},"image/png")})}async function Gzt(e,t,n){const i=await createImageBitmap(e),r=i.width/t,s=i.height/n.height,a=[];try{for(const l of n.pages){const c=document.createElement("canvas");c.width=t,c.height=l.height;const u=c.getContext("2d");if(!u)throw new Error(an.t("share.browserUnsupported",{ns:"conversation"}));u.drawImage(i,0,(l.top-n.top)*s,t*r,l.height*s,0,0,t,l.height),a.push({blob:await Wzt(c),width:t,height:l.height}),c.width=0,c.height=0}}finally{i.close()}return a}async function Kzt(e){var n;(n=document.fonts)!=null&&n.ready&&await document.fonts.ready;const t=Qzt(e);try{const i=Math.max(Rzt,Math.ceil(t.scrollWidth)),r=zzt(t),s=Vzt(r),a=Hzt(t),l=await jzt(t),c=[];for(const[u,d]of s.entries()){const f=qzt(t,d,u+1,s.length,a);try{const h=await Nzt(f,{width:i,height:d.height,pixelRatio:1,backgroundColor:$zt(),fontEmbedCSS:l,style:{position:"static",top:"auto",left:"auto",width:`${i}px`,height:`${d.height}px`,margin:"0",overflow:"hidden",animation:"none"}});if(!h)throw new Error(an.t("share.imageFailed",{ns:"conversation"}));c.push(...await Gzt(h,i,d))}finally{f.remove()}}return c}finally{t.remove()}}function Xzt(e){return`agentkit-conversation-${e}.pdf`}function IIe(e,t,n){const i=Math.max(2,String(t).length);return`agentkit-conversation-${n}-page-${String(e).padStart(i,"0")}.png`}function Yzt(e){return`agentkit-conversation-${e}-png-pages.zip`}const Zzt=Array.from({length:256},(e,t)=>{let n=t;for(let i=0;i<8;i+=1)n=n&1?3988292384^n>>>1:n>>>1;return n>>>0});function Jzt(e){let t=4294967295;for(const n of e)t=Zzt[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}async function eVt(e,t){const n=new TextEncoder,i=[],r=[];let s=0,a=0;for(const[u,d]of e.entries()){const f=IIe(u+1,e.length,t),h=n.encode(f),m=new Uint8Array(await d.blob.arrayBuffer()),g=Jzt(m),b=new ArrayBuffer(30),v=new DataView(b);v.setUint32(0,67324752,!0),v.setUint16(4,20,!0),v.setUint16(6,2048,!0),v.setUint16(8,0,!0),v.setUint32(14,g,!0),v.setUint32(18,m.byteLength,!0),v.setUint32(22,m.byteLength,!0),v.setUint16(26,h.byteLength,!0),i.push(b,h,m);const y=new ArrayBuffer(46),x=new DataView(y);x.setUint32(0,33639248,!0),x.setUint16(4,20,!0),x.setUint16(6,20,!0),x.setUint16(8,2048,!0),x.setUint16(10,0,!0),x.setUint32(16,g,!0),x.setUint32(20,m.byteLength,!0),x.setUint32(24,m.byteLength,!0),x.setUint16(28,h.byteLength,!0),x.setUint32(42,s,!0),r.push(y,h),s+=30+h.byteLength+m.byteLength,a+=46+h.byteLength}const l=new ArrayBuffer(22),c=new DataView(l);return c.setUint32(0,101010256,!0),c.setUint16(8,e.length,!0),c.setUint16(10,e.length,!0),c.setUint32(12,a,!0),c.setUint32(16,s,!0),new Blob([...i,...r,l],{type:"application/zip"})}async function tVt(e){const{jsPDF:t}=await Md(async()=>{const{jsPDF:l}=await import("../chunks/jspdf.es.min-DYdURk6H.js").then(c=>c.j);return{jsPDF:l}},[]),n=new t({orientation:"portrait",unit:"mm",format:"a4",compress:!0}),i=n.internal.pageSize.getWidth(),r=n.internal.pageSize.getHeight(),s=i-A2*2,a=r-A2*2;for(const[l,c]of e.entries()){const u=new Uint8Array(await c.blob.arrayBuffer()),d=Math.min(s/c.width,a/c.height),f=c.width*d,h=c.height*d;l>0&&n.addPage(),n.addImage(u,"PNG",A2+(s-f)/2,A2,f,h,`conversation-export-${l}`,"FAST")}return new Blob([n.output("arraybuffer")],{type:"application/pdf"})}function BL(e,t){const n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.style.display="none",document.body.append(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function nVt({targetTurn:e,onClose:t}){const{t:n}=Te("conversation"),i=p.useId(),r=p.useId(),s=p.useId(),a=p.useRef(null),l=p.useRef(null),c=p.useRef(t),u=p.useRef(void 0),d=p.useRef(!0),[f,h]=p.useState("generating"),[m,g]=p.useState(0),[b,v]=p.useState([]),[y,x]=p.useState(""),[O,w]=p.useState(""),[k,S]=p.useState("idle"),[E,C]=p.useState("idle"),[N,_]=p.useState("png");c.current=t,p.useEffect(()=>{var M;d.current=!0;const P=document.body.style.overflow,R=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(M=l.current)==null||M.focus();const L=U=>{var Q;if(U.key==="Escape"){U.preventDefault(),c.current();return}if(U.key!=="Tab")return;const I=Array.from(((Q=a.current)==null?void 0:Q.querySelectorAll("button:not(:disabled)"))??[]);if(I.length===0)return;const H=I[0],K=I[I.length-1];U.shiftKey&&document.activeElement===H?(U.preventDefault(),K.focus()):!U.shiftKey&&document.activeElement===K&&(U.preventDefault(),H.focus())};return window.addEventListener("keydown",L),()=>{d.current=!1,document.body.style.overflow=P,window.removeEventListener("keydown",L),u.current!==void 0&&window.clearTimeout(u.current),R!=null&&R.isConnected&&R.focus()}},[]),p.useEffect(()=>{let P=!1,R="";return h("generating"),v([]),x(""),w(""),S("idle"),(async()=>{try{if(await Mzt(),P)return;const M=await Kzt(e);if(M.length===0)throw new Error(n("share.imageFailed"));if(R=URL.createObjectURL(M[0].blob),P){URL.revokeObjectURL(R);return}v(M),x(R),h("ready")}catch(M){if(P)return;h("error"),w(M instanceof Error?M.message:String(M))}})(),()=>{P=!0,R&&URL.revokeObjectURL(R)}},[m,e]);const j=async()=>{var R;const P=b[0];if(!(!P||k==="copying")){S("copying"),w("");try{if(!((R=navigator.clipboard)!=null&&R.write)||typeof ClipboardItem>"u")throw new Error(n("share.copyUnsupported"));await navigator.clipboard.write([new ClipboardItem({"image/png":P.blob})]),S("copied"),u.current=window.setTimeout(()=>S("idle"),1500)}catch(L){S("idle"),w(L instanceof Error?L.message:String(L))}}},A=P=>{_(P),S("idle"),w("")},F=(P,R)=>{var H,K;const L=["png","pdf"],M=L.indexOf(R);let U=M;if(P.key==="ArrowRight"||P.key==="ArrowDown")U=(M+1)%L.length;else if(P.key==="ArrowLeft"||P.key==="ArrowUp")U=(M-1+L.length)%L.length;else if(P.key==="Home")U=0;else if(P.key==="End")U=L.length-1;else return;P.preventDefault();const I=L[U];A(I),(K=(H=a.current)==null?void 0:H.querySelector(`[data-export-format="${I}"]`))==null||K.focus()},T=async()=>{if(!(b.length===0||E==="downloading")){C("downloading"),w("");try{const P=new Date().toISOString().replace(/[:.]/g,"-");if(N==="pdf"){const R=await tVt(b);BL(R,Xzt(P))}else if(b.length===1)BL(b[0].blob,IIe(1,1,P));else{const R=await eVt(b,P);BL(R,Yzt(P))}}catch(P){d.current&&w(P instanceof Error?P.message:n("share.exportFailed"))}finally{d.current&&C("idle")}}};return Li.createPortal(o.jsx("div",{className:"share-message-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&t()},children:o.jsxs("section",{ref:a,className:"share-message-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":f==="generating"||E==="downloading",children:[o.jsxs("header",{className:"share-message-head",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("share.title")}),o.jsx("p",{id:r,children:n("share.description")})]}),o.jsx("button",{ref:l,type:"button",className:"share-message-close","aria-label":n("share.close"),title:n("share.close"),onClick:t,children:o.jsx(Lzt,{})})]}),o.jsxs("div",{className:"share-message-body",children:[f==="generating"?o.jsx("div",{className:"share-message-generating",role:"status",children:o.jsx(xn,{children:n("share.generatingContent")})}):f==="error"?o.jsxs("div",{className:"share-message-failure",children:[o.jsx("p",{role:"alert",children:O||n("share.imageFailed")}),o.jsx("button",{type:"button",onClick:()=>g(P=>P+1),children:n("share.retry")})]}):o.jsxs("figure",{className:"share-message-preview",children:[o.jsx("figcaption",{className:"share-message-preview-meta",children:n("share.previewPage",{count:b.length})}),o.jsx("img",{src:y,alt:n("share.previewAlt",{count:b.length})})]}),f!=="error"&&O&&o.jsx("p",{className:"share-message-error",role:"alert",children:O})]}),o.jsxs("div",{className:"share-message-options",children:[o.jsx("span",{id:s,className:"share-message-format-label",children:n("share.format")}),o.jsx("div",{className:"share-message-format",role:"radiogroup","aria-labelledby":s,children:["png","pdf"].map(P=>o.jsx("button",{type:"button",role:"radio","data-export-format":P,className:N===P?"is-active":"","aria-checked":N===P,tabIndex:N===P?0:-1,disabled:E==="downloading",onClick:()=>A(P),onKeyDown:R=>F(R,P),children:P.toUpperCase()},P))})]}),o.jsxs("footer",{className:"share-message-actions",children:[o.jsx("span",{className:"share-message-download-status","aria-live":"polite",children:E==="downloading"?n("share.generatingFormat",{format:N.toUpperCase()}):""}),N==="png"&&o.jsx("button",{type:"button",onClick:()=>void j(),disabled:b.length===0||f!=="ready"||k==="copying",children:k==="copying"?n("share.copying"):k==="copied"?b.length>1?n("share.copiedFirst"):n("share.copied"):b.length>1?n("share.copyFirst"):n("share.copyImage")}),o.jsx("button",{type:"button",className:"is-primary",onClick:()=>void T(),disabled:b.length===0||f!=="ready"||E==="downloading",children:E==="downloading"?n("share.generating"):N==="png"&&b.length>1?n("share.downloadArchive",{count:b.length}):n("share.downloadFormat",{format:N.toUpperCase()})})]})]})}),document.body)}const iVt=2e3,rVt=700,PIe=1200;function wz(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function DIe(e){return wz(e.trim(),rVt)}function MIe(e){return wz(e,PIe)}function Oie(e){return e.trim().length>0}function sVt(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=DIe(e),r=MIe(t.trim());return wz(`${n.selectedExcerpt}${n.separator}${i} ${n.annotation}${n.separator}${r}`,iVt)}function Sie(e){return e?e instanceof Element?e:e.parentElement:null}function aVt(e,t){if(!t||t.isCollapsed||t.rangeCount===0)return null;const n=Sie(t.anchorNode),i=Sie(t.focusNode);if(!n||!i||!e.contains(n)||!e.contains(i)||!n.closest(".bubble")||!i.closest(".bubble"))return null;const r=t.toString().trim();if(!r)return null;const s=t.getRangeAt(0).getBoundingClientRect();return s.width<=0||s.height<=0?null:{text:r,anchor:{left:s.left+s.width/2,top:s.top,height:s.height}}}function oVt({anchor:e,selectedText:t,onClose:n,onSubmit:i}){const{t:r}=Te("conversation"),s=p.useRef(!1),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[h,m]=p.useState(!1),g=DIe(t),b=p.useCallback(()=>{var y;(y=window.getSelection())==null||y.removeAllRanges(),n()},[n]);s.current=c,p.useEffect(()=>{const y=()=>{s.current||b()},x=O=>{const w=O.target;w instanceof Element&&w.closest(".response-annotation-popover")||s.current||b()};return window.addEventListener("resize",y),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",x,!0)}},[b]);const v=async()=>{if(!(c||h||!Oie(a))){u(!0),f("");try{await i(a.trim()),m(!0)}catch(y){f(y instanceof Error?y.message:String(y))}finally{u(!1)}}};return o.jsxs(im,{open:!0,onOpenChange:y=>{!y&&!c&&b()},children:[o.jsx(im.Trigger,{children:o.jsx("span",{className:"response-annotation-anchor",style:{left:e.left,top:e.top,height:e.height},"aria-hidden":"true"})}),o.jsx(im.Content,{side:"top",sideOffset:8,align:"center",minWidth:"auto",className:"response-annotation-popover",children:h?o.jsxs("div",{className:"response-annotation-success",role:"status","aria-live":"polite",children:[o.jsxs("div",{children:[o.jsx("strong",{children:r("annotation.successTitle")}),o.jsx("p",{children:r("annotation.successDescription")})]}),o.jsx(Ht,{type:"button",color:"secondary",size:"sm",pill:!1,onClick:b,children:r("annotation.done")})]}):o.jsxs("form",{className:"response-annotation-form","aria-label":r("annotation.ariaLabel"),"aria-busy":c||void 0,onSubmit:y=>{y.preventDefault(),v()},children:[o.jsx("div",{className:"response-annotation-header",children:o.jsx("h2",{children:r("annotation.title")})}),o.jsx("blockquote",{title:g,children:g}),o.jsxs("label",{className:"response-annotation-field",children:[o.jsx("span",{children:r("annotation.content")}),o.jsx(Rm,{value:a,rows:3,maxRows:6,autoResize:!0,maxLength:PIe,disabled:c,invalid:!!d,"aria-label":r("annotation.content"),placeholder:r("annotation.placeholder"),onChange:y=>{l(MIe(y.target.value)),d&&f("")}})]}),d&&o.jsx("p",{className:"response-annotation-error",role:"alert",children:r("annotation.retryError",{error:d})}),o.jsxs("div",{className:"response-annotation-actions",children:[o.jsx(Ht,{className:"response-annotation-action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:c,onClick:b,children:r("annotation.cancel")}),o.jsx(Ht,{className:"response-annotation-action",type:"submit",color:"primary",size:"sm",pill:!1,loading:c,disabled:!Oie(a),children:r("annotation.submit")})]})]})})]})}const lVt=["conversation","agents","applications","search","other"],cVt=["page_slow","feature_unavailable","display_error","no_response","other"],uVt=["noResponse","loading","incomplete","error"];function dVt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function fVt({initialModule:e,onSubmit:t}){const{t:n}=Te("feedback"),i=p.useRef(null),[r,s]=p.useState(()=>new Set),[a,l]=p.useState(e),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(!1),v=w=>{s(k=>{const S=new Set(k);return S.has(w)?S.delete(w):S.add(w),S})},y=w=>{var k;u(S=>S.trim()?S.includes(w)?S:`${S.trimEnd()} ${w}`:w),(k=i.current)==null||k.focus()},x=async w=>{if(w.preventDefault(),!(d||g)){f(!0),m("");try{await t({module:a,issues:[...r],description:c.trim()}),b(!0)}catch(k){m(k instanceof Error?k.message:String(k))}finally{f(!1)}}},O=r.size>0||c.trim().length>0;return o.jsxs("div",{className:"platform-feedback-page",children:[o.jsxs("header",{className:"platform-feedback-header",children:[o.jsx("h1",{children:n("title")}),o.jsx("p",{children:n("page.description")})]}),o.jsx("div",{className:"platform-feedback-scroll",children:g?o.jsxs("section",{className:"platform-feedback-success","aria-labelledby":"feedback-success-title","aria-live":"polite",role:"status",children:[o.jsx("span",{className:"platform-feedback-success-icon","aria-hidden":"true",children:o.jsx(dVt,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"feedback-success-title",children:n("success.title")}),o.jsx("p",{children:n("success.description")})]})]}):o.jsxs("form",{className:"platform-feedback-form",onSubmit:w=>void x(w),children:[o.jsxs("section",{className:"platform-feedback-section",children:[o.jsx("div",{className:"platform-feedback-section-heading",children:o.jsx("h2",{children:n("page.module")})}),o.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.module"),children:lVt.map(w=>o.jsx("button",{type:"button","aria-pressed":a===w,onClick:()=>l(w),disabled:d,children:n(`page.modules.${w}`)},w))})]}),o.jsx("section",{className:"platform-feedback-section",children:o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:n("page.commonIssuesMultiple")}),o.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.issueTypes"),children:cVt.map(w=>o.jsx("button",{type:"button","aria-pressed":r.has(w),onClick:()=>v(w),disabled:d,children:n(`page.issues.${w}`)},w))})]})}),o.jsxs("section",{className:"platform-feedback-section",children:[o.jsxs("label",{className:"platform-feedback-field",children:[o.jsx("span",{children:n("descriptionLabel")}),o.jsx("textarea",{ref:i,value:c,onChange:w=>u(w.target.value),placeholder:n("page.descriptionPlaceholder"),maxLength:4e3,rows:6,disabled:d})]}),o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:n("page.quickAdd")}),o.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.suggestionsLabel"),children:uVt.map(w=>{const k=n(`page.suggestions.${w}`);return o.jsx("button",{type:"button",onClick:()=>y(k),disabled:d,children:k},w)})})]})]}),o.jsx("p",{className:"platform-feedback-privacy",role:"alert",children:n("page.privacy")}),h&&o.jsx("p",{className:"platform-feedback-error",role:"alert",children:h}),o.jsx("div",{className:"platform-feedback-actions",children:o.jsx("button",{type:"submit",disabled:!O||d,children:n(d?"submitting":"submit")})})]})})]})}function hVt({node:e,ctx:t}){const n=e.variant??"default";return o.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}s0("Button",hVt);function pVt({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}s0("Card",pVt);const mVt={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},gVt={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function LIe(e){return mVt[e]??"flex-start"}function $Ie(e){return gVt[e]??"stretch"}function bVt({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:LIe(e.justify),alignItems:$Ie(e.align)},children:n.map(i=>t.render(i))})}s0("Column",bVt);function yVt({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}s0("Divider",yVt);const vVt={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function xVt({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:vVt[t]??"•"})}s0("Icon",xVt);function wVt({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:LIe(e.justify),alignItems:$Ie(e.align??"center")},children:n.map(i=>t.render(i))})}s0("Row",wVt);const OVt=new Set(["h1","h2","h3","h4","h5"]);function SVt({node:e,ctx:t}){const n=e.variant??"body",i=t.resolveString(e.text),r=OVt.has(n)?n:"p";return o.jsx(r,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:i})}s0("Text",SVt);function kVt(e){return e==="agents"?"agents":e==="applications"?"applications":e==="search"?"search":["conversation","new-chat","sandbox"].includes(e)?"conversation":"other"}async function UL(e){const[t,n,i]=await Promise.allSettled([pIe(),mIe("deepseek-harness"),sI()]);return{agentId:e,ready:!0,temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,deepseekHarnessEnabled:n.status==="fulfilled"&&n.value.enabled,sandboxEndpointExportEnabled:t.status==="fulfilled"&&t.value.endpointExportEnabled===!0,skillCustomizationEnabled:i.status==="fulfilled"&&i.value.enabled}}async function kie(e,t){const n=await GF(e,t),i=await Promise.allSettled(n.map(s=>{var a;return(a=s.events)!=null&&a.length?Promise.resolve(s):iR(e,t,s.id)})),r=i.find(s=>s.status==="rejected"&&!/get session failed:\s*404\b/i.test(String(s.reason)));if((r==null?void 0:r.status)==="rejected")throw r.reason;return i.flatMap(s=>s.status==="fulfilled"?[s.value]:[])}const yu={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},EVt=600,CVt=1e3,Eie=5e3,TVt=500,AVt=new Set,_Vt=[],Sf=["list_envs","get_env_manifest","execute_in_sandbox","delegate_to_codex_sandbox"],FIe="veadk.sessionEnvironmentMounts.v1";function Cie(){return{mounts:{},workspaceIds:{}}}function NVt(){if(typeof localStorage>"u")return Cie();try{const e=JSON.parse(localStorage.getItem(FIe)??"{}"),t=(r,s)=>!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).slice(-200).map(([a,l])=>[a,s(l)])),n=t(e.mounts,r=>Array.isArray(r)?r.slice(0,20).flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const a=s;return typeof a.environment_id!="string"||typeof a.environment_version_id!="string"||a.mount_instance_id!==void 0&&typeof a.mount_instance_id!="string"?[]:[{environment_id:a.environment_id,environment_version_id:a.environment_version_id,...a.mount_instance_id?{mount_instance_id:a.mount_instance_id}:{}}]}):[]),i=t(e.workspaceIds,r=>Array.isArray(r)?r.filter(s=>typeof s=="string").slice(0,20):[]);return{mounts:n,workspaceIds:i}}catch{return Cie()}}function jVt(e,t){if(!(typeof localStorage>"u"))try{localStorage.setItem(FIe,JSON.stringify({mounts:e,workspaceIds:t}))}catch{}}function Ul(){return{skills:[]}}function yw(e,t,n){return`${e}\0${t}\0${n}`}async function Tie(e){let t;if(e.threadId)try{const r=await dr.readThread(e.id,e.threadId);if(r.messages.length>0)return r}catch(r){t=r}const n=await dr.listThreads(e.id),i=n.threads.find(r=>r.id!==e.threadId)??n.threads[0];if(!i){if(t)throw t;return null}return dr.resumeThread(e.id,i.id)}function QL(e,t){const n=vIe(e),i=n[n.length-1];return!t||(i==null?void 0:i.role)!=="user"?n:[...n,{role:"assistant",blocks:[],meta:{localId:`sandbox-background-${e.threadId}`}}]}function zL(e){return`${YI(e)}.active`}function q8(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function RVt(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(q8(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function W8(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const i=W8(n,t);if(i)return i}}function Aie(e){return e.replace(/__[0-9a-f]{10}(?:__.*)?$/i,"")}function _ie(e,t,n,i,r){var s,a;return((s=e.meta)==null?void 0:s.streaming)===!0||((a=e.meta)==null?void 0:a.streaming)!==!1&&t===n-1&&(i||r)}function BIe(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...BIe(n)));return t}function Nie(){const e=typeof localStorage<"u"?localStorage.getItem(yu.view):null;return e==="intelligent"?e:["menu","custom","template","workflow"].includes(e??"")?"custom":e==="package"||e==="migration"?e:null}function VL(e){const t=e.trim().toLowerCase();switch(t){case"creating":case"starting":case"initializing":case"pending":case"running":case"ready":case"failed":case"error":case"stopped":case"expired":case"deleting":case"deleted":return t;default:return"unknown"}}function jie({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.75",y:"3.75",width:"16.5",height:"16.5",rx:"3.25"}),o.jsx("path",{d:"M12 8.5v7M8.5 12h7"}),o.jsx("path",{d:"M6.75 6.75h1M16.25 17.25h1",opacity:"0.6"})]})}function IVt({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.5",y:"5",width:"17",height:"14.75",rx:"2.25"}),o.jsx("path",{d:"M3.5 9h17M9.25 12.25 7.1 14.4l2.15 2.15M14.75 12.25l2.15 2.15-2.15 2.15M12.8 11.85l-1.6 5.1"})]})}function PVt({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"2.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M5.25 8.5h1.5M5.25 11.5h1.5"}),o.jsx("rect",{x:"14.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M17.25 15.5h1.5M17.25 12.5h1.5M8.75 12h6.5m-2.5-2.5 2.5 2.5-2.5 2.5"})]})}function DVt(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function G8(e){return e?new Date(e*1e3).toLocaleString(an.resolvedLanguage??an.language,{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function MVt(e){if(!e)return"";const t=[];return e.ts&&t.push(G8(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function yp(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}function HL(e,t){for(let n=t-1;n>=0;n-=1)if(e[n].role==="user")return yp(e[n]);return""}const LVt="send_a2ui_json_to_client";function qL(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="delivery"?!0:t.kind==="tool"?!(t.name===LVt&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?qEe(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function WL(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function $Vt(e){return new Promise((t,n)=>{let i="";try{i=new URL(e,window.location.href).protocol}catch{}if(i!=="http:"&&i!=="https:"){n(new Error(Tt("oauth.unsupportedUrl")));return}const r=window.open(e,"veadk_oauth","width=520,height=720");if(!r){n(new Error(Tt("oauth.popupBlocked")));return}let s=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",c)},l=d=>{if(!s){s=!0,a();try{r.close()}catch{}t(d)}},c=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&l(f.url)};window.addEventListener("message",c);const u=setInterval(()=>{if(!s){if(r.closed){a();const d=window.prompt(Tt("oauth.pasteCallbackUrl"));d&&d.trim()?(s=!0,t(d.trim())):n(new Error(Tt("oauth.cancelled")));return}try{const d=r.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&l(d)}catch{}}},500)})}function FVt(e,t){const n=JSON.parse(JSON.stringify(e??{})),i=n.exchangedAuthCredential??n.exchanged_auth_credential??{},r=i.oauth2??{};return r.authResponseUri=t,r.auth_response_uri=t,i.oauth2=r,n.exchangedAuthCredential=i,n}function Rie({text:e}){const[t,n]=p.useState(!1);return o.jsx("button",{className:"icon-btn",title:Tt(t?"actions.copied":"actions.copy"),disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?o.jsx(Vu,{className:"icon"}):o.jsx(Xj,{className:"icon"})})}function BVt({onClick:e}){return o.jsx("button",{type:"button",className:"icon-btn","aria-label":Tt("actions.exportConversation"),title:Tt("actions.exportConversation"),onClick:e,children:o.jsx(YFe,{className:"icon","aria-hidden":"true"})})}const Iie=Array.from({length:14},(e,t)=>`greetings.${t}`),Pie=()=>Iie[Math.floor(Math.random()*Iie.length)];function Tt(e,t){return an.t(e,{ns:"app",...t})}function GL(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function Die(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Mie(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}const UVt={"read-only":"sandbox.mode.readOnly","workspace-write":"sandbox.mode.workspaceWrite","danger-full-access":"sandbox.mode.fullAccess"},QVt={untrusted:"sandbox.approvalPolicy.untrusted","on-request":"sandbox.approvalPolicy.onRequest",never:"sandbox.approvalPolicy.never"},zVt={user:"sandbox.reviewer.user",auto_review:"sandbox.reviewer.autoReview"};function VVt(e,t){const n=Tt(e.kind==="file"?"approval.subject.file":"approval.subject.command");return Tt(`approval.decision.${t}`,{subject:n})}function HVt(e){var n,i,r;const t=[];return(n=e.command)!=null&&n.trim()&&t.push({label:Tt("approval.details.command"),value:e.command.trim(),code:!0}),(i=e.grantRoot)!=null&&i.trim()&&t.push({label:Tt("approval.details.grantRoot"),value:e.grantRoot.trim(),code:!0}),(r=e.cwd)!=null&&r.trim()&&t.push({label:Tt("approval.details.cwd"),value:e.cwd.trim(),code:!0}),t}function Lie(e){return e.flatMap(t=>t.apps.map(n=>Lu(t.id,n)))}function qVt(e,t){var n;return((n=e.find(i=>i.runtimeId&&i.apps.some(r=>Lu(i.id,r)===t)))==null?void 0:n.runtimeId)??""}function $ie(e,t){for(const n of e){const i=n.apps.find(r=>Lu(n.id,r)===t);if(i&&n.runtimeId)return{runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:i}}return null}function Fie(e){return e.taskMode==="text_to_video"?[]:(e.taskMode==="first_last_frame"?[e.firstFrame?{file:e.firstFrame,kind:"first_frame"}:null,e.lastFrame?{file:e.lastFrame,kind:"last_frame"}:null]:[e.referenceImage?{file:e.referenceImage,kind:"reference_image"}:null,e.referenceVideo?{file:e.referenceVideo,kind:"reference_video"}:null]).filter(n=>n!==null)}function WVt(e,t){return`video-${e.replace(/[^A-Za-z0-9_-]/g,"").slice(0,36)||"result"}.${t}`}function vw(e,t){return`${e}${t}`}function GVt(){var oV;const{t:e}=Te("app"),[t,n]=p.useState([]),[i,r]=p.useState(""),[s,a]=p.useState([]),[l,c]=p.useState(""),u=p.useRef(null),d=p.useRef(0),f=p.useRef(0),h=p.useRef(null),[m,g]=p.useState(!1),[b,v]=p.useState([]),[y,x]=p.useState(null),[O,w]=p.useState([]),[k,S]=p.useState(!1),[E,C]=p.useState(!1),[N,_]=p.useState(""),[j,A]=p.useState(!1),[F,T]=p.useState(!1),[P,R]=p.useState(null),[L,M]=p.useState(null),[U,I]=p.useState(!1),[H,K]=p.useState(""),[Q,q]=p.useState(null),[B,ee]=p.useState(!1),[le,se]=p.useState(""),[re,ge]=p.useState(!1),[W,X]=p.useState("idle"),[ae,ue]=p.useState(!1),[Oe,ke]=p.useState("confirm"),[st,Le]=p.useState(""),[Me,Ie]=p.useState("codex"),[qe,Ae]=p.useState(!0),[ze,Ee]=p.useState(""),[De,J]=p.useState(!1),[he,_e]=p.useState("snapshot"),[Ze,at]=p.useState(10),[wt,Se]=p.useState(5),[ve,He]=p.useState(100),[Je,Ce]=p.useState(!1),[Wt,ln]=p.useState(!1),[cn,Ot]=p.useState(0),[jt,ot]=p.useState("general"),[gt,Pe]=p.useState(null),[Et,bt]=p.useState(null),[Mt,$e]=p.useState(null),ye=p.useRef(null),Ue=p.useRef(null),Ke=p.useRef(null),ft=p.useRef(null),ut=p.useRef(null),[Gt,Rt]=p.useState(!1),zt=p.useRef(null),Z=p.useRef((y==null?void 0:y.id)??""),Bt=p.useRef(""),Qe=p.useRef(0),tt=p.useRef(void 0),ht=p.useRef(new Set);Z.current=(y==null?void 0:y.id)??"",p.useEffect(()=>()=>{var $;($=Ue.current)==null||$.abort()},[]),p.useEffect(()=>()=>{tt.current!==void 0&&window.clearTimeout(tt.current);for(const $ of ht.current)URL.revokeObjectURL($);ht.current.clear()},[]);function pe($){const z=URL.createObjectURL($);return ht.current.add(z),z}function We($){!$||!ht.current.delete($)||URL.revokeObjectURL($)}function vt(){for(const $ of ht.current)URL.revokeObjectURL($);ht.current.clear()}const vn=p.useCallback(()=>{tt.current!==void 0&&(window.clearTimeout(tt.current),tt.current=void 0),X("idle")},[]);p.useEffect(()=>{vn()},[vn,y==null?void 0:y.id]);const[Ki,Fe]=p.useState({}),[Pt,pn]=p.useState({}),Jt=l?Ki[l]??[]:b,en=y?O:Jt,Un=l?Pt[vw(i,l)]??rA:rA,wn=($,z)=>Fe(G=>({...G,[$]:typeof z=="function"?z(G[$]??[]):z})),oi=($,z,G)=>{const ie=vw($,z);pn(fe=>{const Ne=fe[ie]??rA,Re=pye(Ne,G);return Re===Ne?fe:{...fe,[ie]:Re}})};function Oi($,z,G=[],ie=""){if(Z.current!==$)return;const fe=crypto.randomUUID(),Ne={role:"system",blocks:[],activity:{id:fe,title:z,...G.length>0?{details:G}:{}},meta:{localId:fe,ts:Date.now()/1e3}};w(Re=>{if(!ie)return[...Re,Ne];const ct=Re.findIndex(rt=>{var nn;return((nn=rt.meta)==null?void 0:nn.localId)===ie});return ct<0?[...Re,Ne]:[...Re.slice(0,ct),Ne,...Re.slice(ct)]})}const[mi,bn]=p.useState(""),[qi,ri]=p.useState("agent"),[zi,as]=p.useState("agent"),[Lr,_r]=p.useState("create"),[xs,os]=p.useState(null),[ia,Nr]=p.useState(null),[As,Vs]=p.useState(null),[Yr,ra]=p.useState(!0),[sa,ls]=p.useState(""),[va,aa]=p.useState(null),[ws,Ua]=p.useState(),[oa,Qa]=p.useState(null),Jn=p.useCallback($=>{Qa($);const z=new URL(window.location.href);if($)z.searchParams.set("view","runtime-deploy"),z.searchParams.set("source","intelligent-development"),z.searchParams.set("sessionId",$.sessionId),z.searchParams.set("artifactSha256",$.artifactSha256),z.searchParams.set("validationReportSha256",$.validationReportSha256),$.projectId&&$.versionId?(z.searchParams.set("projectId",$.projectId),z.searchParams.set("versionId",$.versionId)):(z.searchParams.delete("projectId"),z.searchParams.delete("versionId"));else for(const G of["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"])z.searchParams.delete(G);window.history.replaceState(null,"",z)},[]),Ni=p.useCallback($=>$.projectId&&$.versionId?One($.projectId,$.versionId,$.sessionId,$.artifactSha256,$.validationReportSha256):Sne($.sessionId,$.artifactSha256,$.validationReportSha256),[]),Eo=p.useCallback(async $=>{if(!$.projectId||!$.versionId||!$.parentVersionId)throw new Error(Tt("errors.noOptimizationBaseline"));const z=await vRe($.projectId),G=z.find(Re=>Re.versionId===$.versionId),ie=z.find(Re=>Re.versionId===$.parentVersionId);if(!G||!ie)throw new Error(Tt("errors.optimizationVersionMissing"));const[fe,Ne]=await Promise.all([Fy(ie),Fy(G)]);return{base:fe,target:Ne}},[]),xa=p.useCallback(async $=>{const z=oRe({agentId:$.agentName,deployAction:"create",deploySource:"intelligent_development",createMode:"intelligent",aiAssisted:1});try{const{blob:G,filename:ie}=await b9t($),fe=URL.createObjectURL(G),Ne=document.createElement("a");Ne.href=fe,Ne.download=ie,Ne.hidden=!0;try{document.body.appendChild(Ne),Ne.click()}finally{Ne.remove(),window.setTimeout(()=>URL.revokeObjectURL(fe),1e3)}z.succeed({fileCount:$.fileCount,zipSizeBytes:G.size})}catch(G){throw z.fail({fileCount:$.fileCount,...Wa(G)}),G}},[]),[Xi,Co]=p.useState(null),[xe,Xe]=p.useState(!1),[Yt,tn]=p.useState(!1),In=p.useRef(null),mr=p.useRef(null),[jr,_s]=p.useState({}),Si=p.useRef(new Map),la=jr.ready===!0&&jr.agentId===i,[Hs,$r]=p.useState([]),[wa,cs]=p.useState(Ul),[Vi,so]=p.useState(null),[ao,Go]=p.useState(!1),[oo,ed]=p.useState(""),[bc,uu]=p.useState(null),[To,yc]=p.useState([]),[Cl,td]=p.useState({}),[Oa,Wh]=p.useState([]),[Gh,ce]=p.useState([]),[li,ci]=p.useState(!1),[Sa,Hn]=p.useState(""),ji=p.useRef(null),nd=p.useRef(null);nd.current===null&&(nd.current=NVt());const[vc,du]=p.useState(()=>{var $;return(($=nd.current)==null?void 0:$.mounts)??{}}),[us,Tl]=p.useState(()=>{var $;return(($=nd.current)==null?void 0:$.workspaceIds)??{}});p.useEffect(()=>{jVt(vc,us)},[vc,us]);const[xc,Sr]=p.useState({}),[Qn,za]=p.useState(null),[rf,Al]=p.useState(0),[be,Ye]=p.useState(!1),Ct=p.useRef(new Set),[_n,Dt]=p.useState(()=>new Set),[fn,On]=p.useState(()=>new Set),[Y,we]=p.useState(()=>new Set),Ge=p.useRef(new Map),_t=p.useRef(new Map),un=p.useRef(void 0),Nn=p.useRef(()=>{}),Yi=($,z)=>Dt(G=>{const ie=new Set(G);return z?ie.add($):ie.delete($),ie}),Ri=$=>{const z=_t.current.get($);z!==void 0&&window.clearTimeout(z),_t.current.delete($),On(G=>new Set(G).add($))},Kn=$=>{const z=_t.current.get($);z!==void 0&&window.clearTimeout(z),_t.current.delete($),On(G=>{if(!G.has($))return G;const ie=new Set(G);return ie.delete($),ie})},zn=$=>{const z=_t.current.get($);z!==void 0&&window.clearTimeout(z);const G=window.setTimeout(()=>{Kn($)},2400);_t.current.set($,G)},ds=($,z)=>{we(G=>{if(G.has($)===z)return G;const ie=new Set(G);return ie.delete($),ie})},$n=p.useRef(""),[ca,lt]=p.useState("");function Sn($,z,G){const ie=In.current;if(!ie||ie.localId!==$||ie.runId!==z)return null;const fe=mne(ie,G);return In.current=fe,Co(fe),fe}async function Qt($,z,G){var Ne;(Ne=mr.current)==null||Ne.abort();const ie=new AbortController;mr.current=ie;let fe=G;try{let Re=In.current;if(!Re||Re.localId!==$||Re.runId!==z)return;if(fe==="optimization"&&Re.assetIds.length===0){const rt=Fie(Re.config);if(rt.length>0){const nn=await Promise.all(rt.map(It=>i8t(It.file,It.kind,ie.signal)));if(ie.signal.aborted||(Re=Sn($,z,{type:"assets_uploaded",assetIds:nn.map(It=>It.assetId)}),!Re))return}}if(fe==="optimization"){const rt=await r8t({prompt:Re.requestedPrompt,taskMode:Re.requestedMode,assetIds:Re.assetIds,ratio:Re.config.aspectRatio,resolution:Re.config.resolution,durationSeconds:Re.config.durationSeconds},ie.signal);if(ie.signal.aborted||(Re=Sn($,z,{type:"optimization_succeeded",optimizedPrompt:rt.enhancedPrompt,resolvedMode:rt.resolvedTaskMode,enhancerModel:rt.enhancerModel}),!Re))return;fe="generation"}if(!Re.optimizedPrompt||!Re.resolvedMode)throw new Error(Tt("errors.incompletePromptOptimization"));const ct=await s8t({enhancedPrompt:Re.optimizedPrompt,resolvedTaskMode:Re.resolvedMode,assetIds:Re.assetIds,ratio:Re.config.aspectRatio,resolution:Re.config.resolution,durationSeconds:Re.config.durationSeconds},ie.signal);if(ie.signal.aborted||(Re=Sn($,z,{type:"generation_started",remoteTaskId:ct.taskId,generationModel:ct.generationModel,startedAt:Date.now()}),!Re))return;for(;!ie.signal.aborted;){const rt=await a8t(ct.taskId,ie.signal);if(ie.signal.aborted)return;if((rt.status==="queued"||rt.status==="running")&&Sn($,z,{type:"generation_status_changed",providerStatus:rt.status}),rt.status==="failed")throw new Error(rt.error||Tt("errors.videoGenerationFailed"));if(rt.status==="succeeded"){if(!rt.videoUrl)throw new Error(Tt("errors.videoPreviewMissing"));Sn($,z,{type:"generation_succeeded",output:{previewUrl:l8t(rt.videoUrl),fileName:WVt(ct.taskId,rt.outputFormat),mimeType:rt.outputFormat==="mov"?"video/quicktime":"video/mp4"}});return}await new Promise(nn=>window.setTimeout(nn,1800))}}catch(Re){if(ie.signal.aborted)return;Sn($,z,{type:"failed",stage:fe,error:Re instanceof Error?Re.message:String(Re)})}}function si($,z,G){if(gRe(In.current)){Xe(!0);return}if(z.taskMode==="video_editing"&&!z.referenceVideo){lt(Tt("errors.videoEditRequiresVideo"));return}if(z.taskMode==="video_extension"&&!z.referenceVideo){lt(Tt("errors.videoExtendRequiresVideo"));return}if(z.taskMode==="reference_to_video"&&!z.referenceImage&&!z.referenceVideo){lt(Tt("errors.videoReferenceRequired"));return}if(z.taskMode==="text_to_video"&&(z.referenceImage||z.referenceVideo||z.firstFrame||z.lastFrame)){lt(Tt("errors.textVideoRejectsReferences"));return}if(z.taskMode==="first_last_frame"&&!z.firstFrame){lt(Tt("errors.firstFrameRequired"));return}if(G.supportedModes.length>0&&z.taskMode!=="auto"&&!G.supportedModes.includes(z.taskMode)){lt(Tt("errors.videoModeUnsupported"));return}const ie=Fie(z);if(ie.length>0&&!G.assetStorageAvailable){lt(Tt("errors.persistentStorageNotConfigured"));return}const fe=ie.find(({file:Re})=>G.maxAssetBytes>0&&Re.size>G.maxAssetBytes);if(fe){lt(Tt("errors.mediaTooLarge",{fileName:fe.file.name}));return}const Ne=J8t({prompt:$,config:z,enhancerModel:G.enhancerModel,generationModel:G.generationModel});In.current=Ne,Co(Ne),Xe(!0),bn(""),lt(""),Qt(Ne.localId,Ne.runId,"optimization")}function fs(){const $=In.current;if(!$||$.status!=="error"||!$.errorStage)return;const z=$.errorStage,G=mne($,{type:"retry",stage:z});In.current=G,Co(G),Xe(!0),Qt(G.localId,G.runId,z)}async function or(){const $=In.current;if(!(!($!=null&&$.remoteTaskId)||!$.output))try{const z=await o8t($.remoteTaskId),G=URL.createObjectURL(z),ie=document.createElement("a");ie.href=G,ie.download=$.output.fileName,ie.click(),window.setTimeout(()=>URL.revokeObjectURL(G),1e3)}catch(z){lt(z instanceof Error?z.message:String(z))}}p.useEffect(()=>()=>{var $;($=mr.current)==null||$.abort()},[]);const[hs,wc]=p.useState(""),[Oc,Kh]=p.useState(()=>new Set),[Ko,fu]=p.useState(null),[sf,af]=p.useState(null),[Sc,Xo]=p.useState(null),[lo,ka]=p.useState(null);p.useEffect(()=>{Xo(null)},[i,l]);const[_l,of]=p.useState(!1),[qm,lf]=p.useState(),[Fr,cf]=p.useState(Pie),eP=e(Fr),[Br,l0]=p.useState(null),[YE,h1]=p.useState(!1),[ZE,JE]=p.useState(!1),[eC,Wm]=p.useState(""),c0=p.useRef(!1),[tC,nC]=p.useState(null),[Lt,u0]=p.useState(""),[p1,d0]=p.useState(),[Wi,Xh]=p.useState(null),iC=(Wi==null?void 0:Wi.capabilities.runtimeScope)??"mine",[f0,rC]=p.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0}),[kc,sC]=p.useState("cloud"),[Yh,aC]=p.useState(bS),[te,je]=p.useState("volcengine"),[Ve,mt]=p.useState(""),[dn,nt]=p.useState(""),[ei,ua]=p.useState(!1),[Xn,Ns]=p.useState(!1),[Ao,m1]=p.useState(!1),[oC,Gm]=p.useState({}),[UIe,Oz]=p.useState({}),[QIe,h0]=p.useState({}),Sz=_n.has(l),g1=fn.has(l),p0=Sz||m,m0=y?k:p0,zIe=m0||!y&&g1,Zh=(y==null?void 0:y.intelligentDevelopment)===!0?fp:dr,gi=_Qt({client:Zh,allowSkillSelection:(y==null?void 0:y.intelligentDevelopment)!==!0,allowThreadManagement:(y==null?void 0:y.intelligentDevelopment)!==!0,session:y,conversationBusy:k,onInputChange:bn,onSessionPatch:$=>{const z=Z.current;x(G=>(G==null?void 0:G.id)===z?{...G,...$}:G)},onSnapshot:$=>{const z=Z.current;vt(),w(vIe($)),x(G=>(G==null?void 0:G.id)===z?{...G,threadId:$.threadId,cwd:$.cwd??G.cwd,model:$.model??G.model,workspaceLocked:$.workspaceLocked,permissions:$.permissions,busy:!1}:G)},onActivity:($,z=[])=>{const G=Z.current;G&&Oi(G,$,z)},onError:lt});p.useEffect(()=>{const $=y;if(!$||!k||ft.current)return;let z=!1,G;const ie=new AbortController,fe=async()=>{try{const Ne=$.intelligentDevelopment?fp:dr,Re=await Ne.getStatus($.id,{signal:ie.signal});if(z||Z.current!==$.id)return;const ct=Re.threadId?await Ne.readThread($.id,Re.threadId,{signal:ie.signal}):null;if(z||Z.current!==$.id)return;if(ct&&w(QL(ct,Re.busy)),x(rt=>(rt==null?void 0:rt.id)===$.id?{...rt,...Re,...ct?{threadId:ct.threadId,cwd:ct.cwd??Re.cwd,model:ct.model??Re.model,workspaceLocked:ct.workspaceLocked,permissions:ct.permissions}:{}}:rt),S(Re.busy),!Re.busy){const rt=ct==null?void 0:ct.messages[ct.messages.length-1];(rt==null?void 0:rt.role)==="user"&<(Tt("errors.cloudCodexEmptyReply"));return}}catch(Ne){if((Ne==null?void 0:Ne.name)==="AbortError"||z)return;if($.intelligentDevelopment){lt(Tte(Ne)),G=window.setTimeout(fe,1500);return}S(!1),x(Re=>(Re==null?void 0:Re.id)===$.id?{...Re,busy:!1}:Re),lt(Ne instanceof Error?Ne.message:String(Ne));return}G=window.setTimeout(fe,1500)};return G=window.setTimeout(fe,1500),()=>{z=!0,ie.abort(),G!==void 0&&window.clearTimeout(G)}},[k,y==null?void 0:y.id]);const VIe=oC[l]??"",HIe=UIe[l]??AVt,qIe=QIe[l]??_Vt,ps=Qn==null?void 0:Qn.graph,kz=[Qn==null?void 0:Qn.name,ps==null?void 0:ps.name,ps==null?void 0:ps.id].filter($=>!!$),tP=wa.targetAgent&&ps?W8(ps,wa.targetAgent.name):ps,WIe=(tP==null?void 0:tP.skills)??(wa.targetAgent?[]:(Qn==null?void 0:Qn.skills)??[]),GIe=ps?BIe(ps):[],Ez=(ps==null?void 0:ps.instruction)??((oV=Qn==null?void 0:Qn.draft)==null?void 0:oV.instruction),KIe=Qn&&Ez!==void 0?hUe({instruction:Ez,tools:[...new Set([...(ps==null?void 0:ps.tools)??Qn.tools,...l?Cl[yw(i,Lt,l)]??[]:To])],skills:(ps==null?void 0:ps.skills)??Qn.skills}):null;function lC($){GL($);for(const z of $)z.status==="uploading"?Ct.current.add(z.id):z.uri&&eA(i,z.uri).catch(G=>lt(String(G)))}async function Cz($){try{await v4(i,Lt,$),await y4(i,Lt,$),a(z=>z.filter(G=>G.id!==$)),Fe(z=>{const{[$]:G,...ie}=z;return ie})}catch(z){lt(String(z))}}function XIe($){const z=Hs.find(fe=>fe.id===$);if(!z)return;const G=Hs.filter(fe=>fe.id!==$);GL([z]),z.status==="uploading"&&Ct.current.add($),$r(G),G.length===0&&!mi.trim()&&!!l&&en.length===0?($n.current="",c(""),Cz(l)):z.uri&&eA(i,z.uri).catch(fe=>lt(String(fe)))}const Tz=($,z)=>{var Ne,Re,ct,rt,nn;const G=z.author&&z.author!=="user"?z.author:void 0;G&&(Gm(It=>({...It,[$]:G})),Oz(It=>({...It,[$]:new Set(It[$]??[]).add(G)})),h0(It=>{var Vn;return(Vn=It[$])!=null&&Vn.length?It:{...It,[$]:[G]}}));const ie=((Ne=z.actions)==null?void 0:Ne.transferToAgent)??((Re=z.actions)==null?void 0:Re.transfer_to_agent);ie&&h0(It=>{const Vn=It[$]??[];return Vn[Vn.length-1]===ie?It:{...It,[$]:[...Vn,ie]}}),(((ct=z.actions)==null?void 0:ct.endOfAgent)??((rt=z.actions)==null?void 0:rt.end_of_agent)??((nn=z.actions)==null?void 0:nn.escalate))&&h0(It=>{const Vn=It[$]??[];return Vn.length<=1?It:{...It,[$]:Vn.slice(0,-1)}})},[Nl,Bn]=p.useState(Nie),[Az,_z]=p.useState([]),[YIe,nP]=p.useState({}),g0=p.useCallback($=>{_z(z=>{const G=z.findIndex(fe=>fe.id===$.id);if(G===-1)return[$,...z];const ie=[...z];return ie[G]={...ie[G],...$},ie})},[]),[ZIe,JIe]=p.useState(!0),[b0,ms]=p.useState(!1),[ePe,iP]=p.useState("skills"),[cC,rP]=p.useState({kind:"key",key:"titles.skillLibrary"}),tPe=cC.kind==="key"?e(cC.key,{name:cC.name}):cC.title,nPe=p.useCallback($=>{rP(z=>z.kind==="literal"&&z.title===$?z:{kind:"literal",title:$})},[]),[iPe,uC]=p.useState(null),[dC,Ur]=p.useState(!1),[y0,ui]=p.useState(!1),[rPe,uf]=p.useState("entry"),[sP,v0]=p.useState("traditional"),[Nz,Va]=p.useState(null),[sPe,b1]=p.useState("custom"),[jz,aP]=p.useState([]),Jh=p.useRef([]),ep=p.useRef(null),x0=p.useRef(null),[Rz,fC]=p.useState([]),[qs,jl]=p.useState(""),Yo=p.useRef(null),[y1,gs]=p.useState(!1),[tp,rr]=p.useState(!1),[Iz,oP]=p.useState(""),[aPe,oPe]=p.useState("good"),[lPe,hC]=p.useState("basic"),[cPe,uPe]=p.useState("good"),[v1,pC]=p.useState(""),[dPe,fPe]=p.useState(null),[Rl,sr]=p.useState(!1),[mC,Ec]=p.useState(!1),[lP,Cc]=p.useState(!1),[Pz,_o]=p.useState([]),w0=Pz[Pz.length-1],O0=w0==null?void 0:w0.page,cP=O0==="system-info",uP=O0==="developer-resources",dP=p.useCallback($=>{_o(z=>{var G;return((G=z[z.length-1])==null?void 0:G.page)===$.page?z:[...z,$]})},[]),Km=p.useCallback($=>{_o(z=>{var ie;if(((ie=z[z.length-1])==null?void 0:ie.page)===$)return z.slice(0,-1);const G=z.findIndex(fe=>fe.page===$);return G===-1?z:z.filter((fe,Ne)=>Ne!==G)})},[]),[Tc,Ea]=p.useState(null),[gC,Il]=p.useState(!1),fP=p.useRef(null),[hu,x1]=p.useState(()=>{const $=ku();return o1($),$}),[hPe,Dz]=p.useState(!1),[pPe,Mz]=p.useState(""),[Lz,bC]=p.useState(null),[mPe,$z]=p.useState({}),[gPe,Fz]=p.useState(()=>new Set),[pu,Ac]=p.useState(null),[S0,yC]=p.useState(Ji(te)),[Bz,da]=p.useState(""),[Uz,fa]=p.useState(""),[Ii,Ca]=p.useState(null),id=p.useCallback(()=>{Km("agent-detail"),Ca(null),sr(!1),rr(!1)},[Km]),[bPe,hP]=p.useState(!1),vC=p.useRef(!1),k0=p.useRef(!1),rd=p.useCallback($=>{if(!Lt)return!1;try{nie(localStorage,Lt,$)}catch(z){return wc(z instanceof Error?z.message:Tt("errors.saveDraftRejected")),!1}return Jh.current=$,aP($),wc(""),!0},[Lt]),sd=p.useCallback($=>{var z;$&&((z=ep.current)==null?void 0:z.id)!==$||(ep.current=null,x0.current!==null&&(window.clearTimeout(x0.current),x0.current=null))},[]),np=p.useCallback(()=>{const $=ep.current;if(!$)return!0;const z=rd([$,...Jh.current.filter(G=>G.id!==$.id)]);return z&&sd(),z},[sd,rd]),yPe=p.useCallback(($,z,G,ie)=>{!$||!Lt||(ep.current&&ep.current.id!==$&&np(),ep.current={id:$,draft:z,updatedAt:Date.now(),deploymentTarget:G,creationMode:ie},x0.current!==null&&window.clearTimeout(x0.current),x0.current=window.setTimeout(np,EVt))},[np,Lt]),pP=p.useCallback($=>{!$||!Lt||(sd($),rd(Jh.current.filter(z=>z.id!==$)))},[sd,rd,Lt]),Qz=p.useCallback($=>{if(!Lt||$.length===0)return;const z=new Set($.map(G=>G.id));ep.current&&z.has(ep.current.id)&&sd(),rd(Jh.current.filter(G=>!z.has(G.id))),nP(G=>Object.fromEntries(Object.entries(G).filter(([ie])=>!z.has(ie)))),z.has(qs)&&(jl(""),Va(null),Ac(null),Yo.current=null,localStorage.removeItem(zL(Lt)))},[sd,rd,qs,Lt]),zz=p.useCallback($=>{if(!$||!Lt)return;sd($);const z=Yo.current,G=Jh.current.filter(ie=>ie.id!==$);rd((z==null?void 0:z.id)===$?[z,...G]:G)},[sd,rd,Lt]);p.useEffect(()=>(window.addEventListener("pagehide",np),()=>{window.removeEventListener("pagehide",np)}),[np]),p.useEffect(()=>{if(!Lt){sd(),Jh.current=[],aP([]),fC([]),jl(""),wc(""),Yo.current=null;return}let $=[],z="";try{$=yUt(localStorage,Lt),localStorage.getItem(YI(Lt))!==null&&nie(localStorage,Lt,$),z=localStorage.getItem(zL(Lt))||"",wc("")}catch(ie){wc(ie instanceof Error?ie.message:Tt("errors.readDraftFailed"))}Jh.current=$,aP($),fC(RVt(Lt));const G=$.find(ie=>ie.id===z);Yo.current=G??null,Nl==="custom"&&G&&(jl(G.id),Va(G.draft),v0(PL(G)==="quick"?"vulcan":"traditional"),Ac(G.deploymentTarget??null))},[sd,Lt]),p.useEffect(()=>{if(!Lt)return;const $=zL(Lt);try{Nl==="custom"&&qs?localStorage.setItem($,qs):localStorage.removeItem($)}catch{wc(Tt("errors.saveDraftLocationRejected"))}},[Nl,qs,Lt]);const vPe=p.useCallback($=>{if(!Lt)return;const z=[...new Set($.filter(Boolean))];fC(z),localStorage.setItem(q8(Lt),JSON.stringify(z))},[Lt]),xPe=p.useCallback(async $=>{const z=$.filter(rt=>!!rt.runtimeId&&rt.canDelete===!0);if(z.length===0)return;const G=qVt(hu,i),ie=new Set(z.map(rt=>rt.runtimeId));Fz(rt=>{const nn=new Set(rt);for(const It of ie)nn.add(It);return nn}),b2(ie);const fe=new Set,Ne=new Set,Re=new Set,ct=[];for(const rt of z)try{if(!rt.region)throw new Error(Tt("errors.runtimeRegionMissingForDelete"));await iye(rt.runtimeId,rt.region),lj(rt.runtimeId),fe.add(rt.runtimeId),Ne.add(rt.id)}catch(nn){const It=nn instanceof Error?nn.message:String(nn);Re.add(rt.runtimeId),ct.push(`${rt.label}: ${It}`)}if(fe.size>0&&(b2(fe),x1(ku()),bC(nn=>{if(!nn)return nn;const It=new Set(nn);for(const Vn of fe)It.delete(Vn);return It}),$z(nn=>Object.fromEntries(Object.entries(nn).filter(([It])=>!fe.has(It)))),fC(nn=>{const It=nn.filter(Vn=>!Ne.has(Vn));return Lt&&localStorage.setItem(q8(Lt),JSON.stringify(It)),It}),rd(Jh.current.filter(nn=>{var It;return!((It=nn.deploymentTarget)!=null&&It.runtimeId)||!fe.has(nn.deploymentTarget.runtimeId)})),(G?fe.has(G):z.some(nn=>nn.id===i))&&(KPe(),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),Ca(null),da(""),fa(""),sr(!0),lt("")),Ii!=null&&Ii.runtime&&fe.has(Ii.runtime.runtimeId)&&(Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),id(),da(""),fa(""),sr(!0),lt(""))),Re.size>0&&Fz(rt=>{const nn=new Set(rt);for(const It of Re)nn.delete(It);return nn}),ct.length>0){const rt=ct.slice(0,3).join(";"),nn=ct.length>3?Tt("errors.additionalAgentDeleteFailures",{count:ct.length-3}):"";throw new Error(Tt("errors.agentDeleteFailures",{count:ct.length,failures:rt,suffix:nn}))}},[Ii,i,rd,hu,id,Lt]),mP=p.useCallback(async()=>{Dz(!0),Mz("");try{const $=[];let z="";do{const G=await _x({scope:iC,region:"all",pageSize:100,nextToken:z});$.push(...G.runtimes),z=G.nextToken}while(z&&$.length<2e3);bC(new Set($.map(G=>G.runtimeId))),$z(Object.fromEntries($.map(G=>[G.runtimeId,{canDelete:G.canDelete}])))}catch($){Mz($ instanceof Error?$.message:String($))}finally{Dz(!1)}},[iC]);function wPe($){console.log("create agent draft:",$),Bn(null),df()}function gP($,z){console.log("Agent added, navigating to:",$,z),x1(ku()),bC(null),b2(),pP(qs),jl(""),Yo.current=null,Ac(null),da(""),fa($),hC("basic"),Bn(null),rr(!0),r($)}const bP=p.useCallback($=>{Bn(null),ui(!1),id(),rr(!0),fa(""),hC("basic"),da($.id),lt("")},[id]),xC=p.useCallback($=>{np();const z=qs?{...$,draftId:qs}:$;qs&&nP(G=>({...G,[qs]:$.id})),g0(z),bP(z)},[qs,np,bP,g0]),wC=p.useCallback(async $=>{if(!$.runtimeId)throw new Error(Tt("errors.deploymentRuntimeIdMissing"));const z=qs;z&&(pP(z),nP(Ne=>{if(!Ne[z])return Ne;const Re={...Ne};return delete Re[z],Re})),jl(""),Yo.current=null,Ac(null);const G=(pu==null?void 0:pu.region)??S0,ie=await UA($.runtimeId,$.runtimeName,$.region??G,$.version,{waitForReady:!0,agentName:$.agentName});x1(ku()),Al(Ne=>Ne+1);const fe=await UL(ie);Si.current.set(ie,fe),_s(fe),bC(Ne=>{const Re=new Set(Ne??[]);return Re.add($.runtimeId),Re}),b2(),fa(ie),hC("basic"),da(""),Bn(null),rr(!0),r(ie)},[qs,S0,pP,pu]),E0=p.useRef(null),yP=p.useRef(new Map),OPe=p.useRef(0),Vz=p.useRef(new Map),Hz=hu.some($=>!!($.runtimeId&&$.region)&&$.apps.some(z=>Lu($.id,z)===i));p.useLayoutEffect(()=>{const $=new Map;en.forEach((z,G)=>{var Re;const ie=((Re=z.meta)==null?void 0:Re.eventId)??"",fe=!!(Hz&&ie&&yp(z)),Ne=_ie(z,G,en.length,m0,g1);$.set(G,{enabled:!!(fe&&te!=="byteplus"&&!Ne&&!WL(z)),turn:z,input:fe?HL(en,G):""})}),Vz.current=$},[m0,te,g1,Hz,en]);const qz=p.useCallback(()=>{var Re;const $=window.getSelection(),z=($==null?void 0:$.anchorNode)instanceof Element?$.anchorNode:(Re=$==null?void 0:$.anchorNode)==null?void 0:Re.parentElement,G=z==null?void 0:z.closest(".turn--assistant");if(!G)return;const ie=Number(G.dataset.responseAnnotationIndex);if(!Number.isInteger(ie))return;const fe=Vz.current.get(ie);if(!(fe!=null&&fe.enabled))return;const Ne=aVt(G,$);Ne&&Xo({selectionId:++OPe.current,turn:fe.turn,input:fe.input,selectedText:Ne.text,anchor:Ne.anchor})},[]);p.useEffect(()=>{let $=null;const z=G=>{G.target instanceof Element&&G.target.closest(".response-annotation-popover")||($!==null&&window.cancelAnimationFrame($),$=window.requestAnimationFrame(()=>{$=null,qz()}))};return document.addEventListener("mouseup",z,!0),document.addEventListener("keyup",z,!0),()=>{$!==null&&window.cancelAnimationFrame($),document.removeEventListener("mouseup",z,!0),document.removeEventListener("keyup",z,!0)}},[qz]);const ip=p.useRef(!0),rp=p.useRef(!1),Xm=p.useRef(null),Wz=p.useRef({key:"",turnCount:0}),vP=(y==null?void 0:y.id)??l;p.useLayoutEffect(()=>{const $=E0.current,z=Wz.current,G=z.key!==vP,ie=!G&&en.length>z.turnCount;if(Wz.current={key:vP,turnCount:en.length},!$||en.length===0||!G&&!ie)return;ip.current=!0,rp.current=!1,Xm.current!==null&&(window.clearTimeout(Xm.current),Xm.current=null);const fe=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(G||fe){$.scrollTop=$.scrollHeight;return}rp.current=!0,$.scrollTo({top:$.scrollHeight,behavior:"smooth"}),Xm.current=window.setTimeout(()=>{rp.current=!1,Xm.current=null;const Ne=E0.current;Ne&&ip.current&&(Ne.scrollTop=Ne.scrollHeight)},450)},[vP,en.length]),p.useLayoutEffect(()=>{const $=E0.current;!$||!ip.current||rp.current||($.scrollTop=$.scrollHeight)},[m0,en]),p.useEffect(()=>{if(!v1||tp||en.length===0)return;const $=yP.current.get(v1);if(!$)return;ip.current=!1,$.scrollIntoView({behavior:"smooth",block:"center"});const z=window.setTimeout(()=>{pC("")},2600);return()=>window.clearTimeout(z)},[v1,tp,en]),p.useEffect(()=>()=>{Xm.current!==null&&window.clearTimeout(Xm.current)},[]);const SPe=p.useCallback(()=>{const $=E0.current;!$||rp.current||(ip.current=$.scrollHeight-$.scrollTop-$.clientHeight<32)},[]),kPe=p.useCallback($=>{$.deltaY<0&&(rp.current=!1,ip.current=!1)},[]),EPe=p.useCallback(()=>{rp.current=!1,ip.current=!1},[]),CPe=p.useCallback(()=>{const $=E0.current;!$||!ip.current||rp.current||($.scrollTop=$.scrollHeight)},[]),xP=p.useCallback(()=>{nC(null),p4().then($=>{u0($.userId),d0($.info),Ns(!!$.local),l0($.status),$.status==="authenticated"&&(vC.current=!0,k0.current=!0,localStorage.removeItem(yu.app),r(""),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),sr(!1))}).catch($=>{nC($ instanceof Error?$.message:String($))})},[]);p.useEffect(()=>{xP()},[xP]),p.useEffect(()=>{const $=()=>{Wm(""),h1(!0)};return window.addEventListener(m4,$),eBe()&&$(),()=>window.removeEventListener(m4,$)},[]);const TPe=p.useCallback(async()=>{if(c0.current)return;c0.current=!0;const $=q7e();if(!$){c0.current=!1,Wm(Tt("errors.loginPopupBlocked"));return}JE(!0),Wm("");try{for(;;){await new Promise(z=>window.setTimeout(z,1e3));try{const z=await p4();if(z.status==="authenticated"){u0(z.userId),d0(z.info),Ns(!!z.local),l0(z.status),h1(!1),tBe(),$.close();return}}catch{}if($.closed){Wm(Tt("errors.loginPopupClosed"));return}}}finally{c0.current=!1,JE(!1)}},[]);p.useEffect(()=>{Xn&&Lt&&SW(Lt)},[Xn,Lt]),p.useEffect(()=>{if(Br!=="authenticated"||!Lt||oa)return;const $=new URLSearchParams(window.location.search);if($.get("view")!=="runtime-deploy"||$.get("source")!=="intelligent-development")return;const z=$.get("sessionId")??"",G=$.get("artifactSha256")??"",ie=$.get("validationReportSha256")??"",fe=$.get("projectId")??"",Ne=$.get("versionId")??"";if(!z||!G||!ie)return;const Re=new AbortController;return(fe&&Ne?One(fe,Ne,z,G,ie,Re.signal):Sne(z,G,ie,Re.signal)).then(rt=>{if(!Re.signal.aborted){if(!rt.deployable){ls(Tt("errors.sourceNotReady"));return}Qa({...rt,validatedAt:rt.validatedAt||"",gateSummary:rt.gateSummary||[]})}}).catch(rt=>{Re.signal.aborted||ls(rt instanceof Error?rt.message:String(rt))}),()=>Re.abort()},[Br,oa,Lt]),p.useEffect(()=>{if(!y0&&!["intelligent","migration"].includes(Nl??""))return;if(Br!=="authenticated"||!Lt){Vs(null),ls(""),ra(!0);return}const $=new AbortController;return ra(!0),ls(""),fetch(Uo("/web/intelligent-development/capabilities"),{headers:Dh({Accept:"application/json"}),signal:$.signal}).then(async z=>{if(!z.ok)throw new Error(Tt("errors.intelligentCapabilityCheckFailed",{status:z.status}));return z.json()}).then(z=>{if($.signal.aborted)return;const G={enabled:z.enabled===!0,reason:typeof z.reason=="string"?z.reason:"",projectStorageEnabled:z.projectStorageEnabled===!0,projectStorageReason:typeof z.projectStorageReason=="string"?z.projectStorageReason:""};if(z.model!==void 0){if(typeof z.model!="object"||z.model===null)throw new Error(Tt("errors.invalidIntelligentCapability"));const ie=z.model;if(typeof ie.configured=="boolean"&&typeof ie.id=="string")G.model={configured:ie.configured,id:ie.id};else throw new Error(Tt("errors.invalidIntelligentCapability"))}Vs(G)}).catch(z=>{$.signal.aborted||ls(z instanceof Error?z.message:String(z))}).finally(()=>{$.signal.aborted||ra(!1)}),()=>$.abort()},[y0,Br,Nl,Lt]),p.useEffect(()=>{if(Br!=="authenticated"||!Lt){_s({});return}const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Lt)return;const z=Si.current.get(i);if(z){_s(z);return}let G=!1;return _s({}),UL(i).then(ie=>{G||(Si.current.set(i,ie),_s(ie))}),()=>{G=!0}},[i,Br,Lt]),p.useLayoutEffect(()=>{!la||jr.skillCustomizationEnabled!==!1||zi!=="skill"||(as("agent"),os(null),Nr(null))},[jr.skillCustomizationEnabled,la,zi]),p.useEffect(()=>{if(Br!=="authenticated"||!Lt){Xh(null);return}let $=!1;return Xh(null),Q0e().then(z=>{$||Xh(z)}).catch(z=>{console.warn("[app] /web/access failed; using ordinary-user access:",z),$||Xh(U0e)}),()=>{$=!0}},[Br,Lt]),p.useEffect(()=>{B0e().then($=>{const z="prod";f$t({enabled:$.telemetry.enabled,environment:z});const G=$.telemetry.studio;h$t({userPoolId:(G==null?void 0:G.userPoolId)??"",studioDeployId:(G==null?void 0:G.deployId)??"",applicationId:(G==null?void 0:G.applicationId)??"",functionId:(G==null?void 0:G.functionId)??"",studioRegion:(G==null?void 0:G.region)??"",studioProject:(G==null?void 0:G.project)??"",studioVersion:(G==null?void 0:G.version)||$.version,environment:z,cloudProvider:$.provider,accountId:(G==null?void 0:G.accountId)??"",accountIdResolutionError:(G==null?void 0:G.accountIdResolutionError)??""}),m$t({authState:"anonymous"}),rC($.features),sC($.agentsSource),je($.provider),nt((G==null?void 0:G.region)||Ji($.provider)),aC($.branding),mt($.version),ua(!0)})},[]),p.useEffect(()=>{if(Br!=="authenticated"||!p1||!Wi||!ei)return;const $=String(Wi.telemetry.userId).trim();$&&(p$t({userUniqueId:$,accountId:Wi.telemetry.accountId??"",userRole:Wi.role==="admin"?"admin":"member",userSource:Xn?"local":"sso"}),g$t({agentsSource:kc}))},[Wi,kc,Br,Xn,ei,p1]),p.useEffect(()=>{yC($=>{const z=Ji(te);return!$||te==="byteplus"&&$.startsWith("cn-")||te==="volcengine"&&$.startsWith("ap-")?z:$})},[te]),p.useEffect(()=>{Wi&&(Wi.capabilities.createAgents||(Bn(null),Va(null),Ur(!1),ui(!1),_z([])),Wi.capabilities.manageAgents||rr(!1))},[Wi]);let No={kind:"home"};if(Br==="authenticated"){if(lo!==null)No={kind:"page",title:e("titles.issueFeedback")};else if(cP)No={kind:"page",title:e("titles.systemInfo")};else if(gC)No={kind:"page",title:e("titles.cronJobs")};else if(Tc)No={kind:"page",title:Tc==="catalog"?e("titles.automations"):e(`cards.${Tc}.name`,{ns:"automations"})};else if(Et)No={kind:"page",title:Et.session.displayName||e("titles.agent")};else if(gt)No={kind:"page",title:gt.displayName||e("titles.agent")};else if(Rl||tp)No={kind:"page",title:(Ii==null?void 0:Ii.name)||e("titles.agent")};else if(y0)No={kind:"page",title:e("titles.createAgent")};else if(y1)No={kind:"page",title:e("titles.search")};else if(dC)No={kind:"page",title:e("titles.addAgent")};else if(b0)No={kind:"page",title:tPe||e("titles.library")};else if(Nl)No={kind:"page",title:Nl==="custom"?pu!=null&&pu.name?e("titles.updateAgent",{name:pu.name}):e("titles.createAgent"):e(Nl==="package"?"titles.addFromPackage":"titles.migrateAgent")};else if(y){const $=gi.threads.find(z=>z.id===y.threadId);No={kind:"conversation",title:($==null?void 0:$.name)||($==null?void 0:$.preview)||y.displayName}}else if(l){const $=s.find(ie=>ie.id===l),z=e("titles.newConversation"),G=cR($==null?void 0:$.events,z);No=G===z?{kind:"home"}:{kind:"conversation",title:G}}}const Gz=J$t(Yh.title,No);p.useEffect(()=>{Br!=="authenticated"||kc!=="cloud"||!ei||!tp||Ii||mP()},[Ii,kc,Br,tp,mP,ei]),p.useEffect(()=>{document.title=Gz;let $=document.querySelector('link[rel~="icon"]');$||($=document.createElement("link"),$.rel="icon",document.head.appendChild($)),$.removeAttribute("type"),$.href=Yh.logoUrl||(te==="byteplus"?Y7:ER)},[te,Yh.logoUrl,Gz]),p.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then($=>$.ok?$.json():null).then($=>{$&&JIe(!!$.credentials)}).catch($=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",$)})},[]);function APe($){SW($),vC.current=!0,k0.current=!0,localStorage.removeItem(yu.app),Xh(null),Bn(null),Va(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),df(),r(""),sr(!1),u0($),d0({name:$}),Ns(!0),l0("authenticated")}function _Pe(){Xh(null),Xn?(V7e(),u0(""),d0(void 0),l0("unauthenticated")):G7e()}p.useEffect(()=>{if(Br==="authenticated"){if(kc==="cloud"){const $=Lie(hu);r(z=>z&&$.includes(z)?z:(z&&(k0.current=!0,localStorage.removeItem(yu.app)),""));return}Fbe().then($=>{n($);const z=Lie(hu);r(G=>G&&($.includes(G)||z.includes(G))?G:(G&&(k0.current=!0,localStorage.removeItem(yu.app)),""))}).catch($=>lt(String($)))}},[Br,kc,hu]),p.useEffect(()=>{i?(k0.current=!1,localStorage.setItem(yu.app,i)):localStorage.removeItem(yu.app)},[i]),p.useEffect(()=>{const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Lt){Ye(!1);return}let z=!1;if(za(null),cs(Ul()),Br!=="authenticated"||Rl||Ii||!i){Ye(!1);return}return Ye(!0),w4(i).then(G=>{z||za(G)}).catch(()=>{z||za(null)}).finally(()=>{z||Ye(!1)}),()=>{z=!0}},[Ii,i,rf,Br,Rl]),p.useEffect(()=>{Wi&&localStorage.setItem(yu.view,Wi.capabilities.createAgents?Nl??"chat":"chat")},[Wi,Nl]),p.useEffect(()=>{localStorage.setItem(yu.session,l),$n.current=l},[l]),p.useEffect(()=>{const $=$ie(hu,i);if(!$||!Lt){Nn.current=()=>{},we($i=>$i.size===0?$i:new Set);return}const{runtimeId:z,region:G,appName:ie}=$;let fe=!1,Ne=0;function Re(){un.current!==void 0&&(window.clearTimeout(un.current),un.current=void 0)}function ct($i){Re(),un.current=window.setTimeout(()=>void nn(),$i)}function rt($i){const Mn=new Set($i.items.filter(Kt=>Kt.state==="running").map(Kt=>Kt.sessionId));if(we(Kt=>Kt.size===Mn.size&&[...Mn].every(ar=>Kt.has(ar))?Kt:Mn),Mn.size>0){ct(CVt);return}const Yn=$i.items.filter(Kt=>Kt.state==="pending").map(Kt=>Date.parse(Kt.dueAt)).filter(Number.isFinite);Yn.length>0&&ct(Math.max(TVt,Math.min(...Yn)-Date.now()))}async function nn(){const $i=++Ne;try{const Mn=await b4({runtimeId:z,region:G,appName:ie,userId:Lt});if(fe||$i!==Ne)return;rt(Mn)}catch{!fe&&$i===Ne&&ct(Eie)}}const It=()=>{Re(),nn()};Nn.current=It;const Vn=h.current;return(Vn==null?void 0:Vn.agentId)===i&&Vn.userId===Lt?Vn.automaticEvaluationStatuses?rt(Vn.automaticEvaluationStatuses):ct(Eie):It(),()=>{fe=!0,Ne+=1,Re(),Nn.current===It&&(Nn.current=()=>{})}},[i,hu,Lt]),p.useEffect(()=>()=>{f.current+=1,h.current=null},[]),p.useEffect(()=>()=>Ge.current.forEach($=>$.abort()),[]),p.useEffect(()=>()=>_t.current.forEach($=>{window.clearTimeout($)}),[]),p.useEffect(()=>()=>{var $,z,G;($=ye.current)==null||$.abort(),(z=Ke.current)==null||z.abort(),(G=ft.current)==null||G.abort()},[]),p.useEffect(()=>{if(Rl||Ii||y||!i||!Lt)return;const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Lt){h.current=null;return}let z=!1;return(async()=>{const G=await w1(i);if(!z){if(!vC.current){vC.current=!0;const ie=localStorage.getItem(yu.session)||"";if(Nie()===null&&ie&&G.some(fe=>fe.id===ie)){O1(ie);return}}df()}})(),()=>{z=!0}},[Ii,i,Rl,y,Lt]),p.useEffect(()=>{const $=fP.current;$&&$.app===i&&(fP.current=null,O1($.sid))},[i]);function Kz($,z){gs(!1),$===i?O1(z):(fP.current={app:$,sid:z},r($))}function Xz($,z){pn(G=>{const ie={...G};for(const fe of z)ie[vw($,fe.id)]=NW(fe.events??[]);return ie}),a(z)}async function w1($){const z=d.current+1;d.current=z;try{const G=await kie($,Lt);return d.current!==z||Xz($,G),G}catch(G){return d.current===z&<(String(G)),[]}}function wP($="codex",z=!1){var fe;if(y)return;lt(""),Le(""),ke("confirm"),Ie($),Ae(!1),Ee(Tt("sandbox.checkingPersistence")),J(!1),_e("snapshot"),at(10),Se(5),He(100),(fe=Ue.current)==null||fe.abort();const G=new AbortController;Ue.current=G,($==="codex"?pIe(G.signal):mIe($,G.signal)).then(Ne=>{G.signal.aborted||(Ae(Ne.persistentEnabled===!0),Ee(Ne.persistentReason??""),J(Ne.persistentRequired===!0),_e(Ne.storageMode??"snapshot"),at(Ne.diskGbDefault??10),Se(Ne.diskGbMin??5),He(Ne.diskGbMax??100))}).catch(Ne=>{(Ne==null?void 0:Ne.name)!=="AbortError"&&(Ae(!1),Ee(Tt("sandbox.persistenceUnknown")))}),Ce(z),ue(!0)}function NPe(){var $,z;($=Ue.current)==null||$.abort(),Ue.current=null,(z=ye.current)==null||z.abort(),ye.current=null,ue(!1),ke("confirm"),Le(""),!y&&qi!=="agent"&&!Je&&ri("agent")}async function jPe($,z,G){var Ne;(Ne=ye.current)==null||Ne.abort();const ie=new AbortController;ye.current=ie,ke("loading"),Le("");const fe=b$t({sandboxKind:Me,sandboxSource:Je?"my_agents":"new_chat"});try{const Re=Me==="codex"?await dr.startSession({displayName:$,persistent:z,diskGb:G,signal:ie.signal}):await dr.startAgentSession(Me,{displayName:$,persistent:z,diskGb:G,signal:ie.signal});if(ye.current!==ie){fe.fail({errorKind:"abort"});return}if(fe.succeed({sandboxId:String(Re.id)}),Je){Ot(rt=>rt+1),ue(!1),ke("confirm"),sr(!0);return}if(Me!=="codex"){const rt=await dr.openAgentSession(Me,Re.id,{signal:ie.signal});if(ye.current!==ie)return;$n.current="",c(""),v([]),bn(""),cs(Ul()),ri(Me==="deepseek-harness"?"deepseek-harness":"agent"),lC(Hs),$r([]),vt(),w([]),x(null),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),Ca(null),sr(!1),Pe(null),bt(rt),ue(!1),ke("confirm");return}const ct=await dr.connectSession(Re.id,{signal:ie.signal});if(ye.current!==ie)return;$n.current="",c(""),v([]),bn(""),cs(Ul()),ri("temporary"),lC(Hs),$r([]),vt(),w([]),x(ct),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),Ca(null),sr(!1),Pe(null),bt(null),ue(!1),ke("confirm")}catch(Re){if(fe.fail(Wa(Re)),(Re==null?void 0:Re.name)==="AbortError"||ye.current!==ie)return;Le(Re instanceof Error?Re.message:String(Re)),ke("error")}finally{ye.current===ie&&(ye.current=null)}}function RPe($,z){$n.current="",c(""),v([]),bn(""),cs(Ul()),lC(Hs),$r([]),vt(),w(z),Z.current=$.id,x($),S($.busy),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),Ca(null),sr(!1),_o([]),Ea(null),Il(!1),Pe(null),bt(null)}async function OC($,z="my_agents"){lt("");const G=w2({targetId:String($.id),agentKind:$.toolName,connectSource:z});try{const ie=$.resourceType==="snapshot"?await dr.resumeSnapshot($.toolName,$.snapshotId):$;if($.resourceType==="snapshot"&&Ot(Ne=>Ne+1),ie.toolName==="codex"){const Ne=await dr.connectSession(ie.id),Re=await Tie(Ne);G.succeed({sandboxStatus:VL(Ne.status)}),$n.current="",c(""),v([]),bn(""),cs(Ul()),vt(),Re?(w(QL(Re,Ne.busy)),x({...Ne,threadId:Re.threadId,cwd:Re.cwd??Ne.cwd,workspaceLocked:Re.workspaceLocked,permissions:Re.permissions,...Re.model?{model:Re.model}:{}})):(w([]),x(Ne)),S(Ne.busy),Km("sandbox-agent-detail"),Pe(null),bt(null),sr(!1),rr(!1);return}const fe=await dr.openAgentSession(ie.toolName,ie.id);G.succeed({sandboxStatus:VL(fe.session.status)}),Km("sandbox-agent-detail"),bt(fe),Pe(null),sr(!1),rr(!1)}catch(ie){throw G.fail(Wa(ie)),lt(ie instanceof Error?ie.message:String(ie)),ie}}async function IPe($){const G=(await dr.listSessions()).find(ie=>ie.resourceType==="session"&&ie.toolName==="codex"&&ie.id===$);if(!G)throw new Error(Tt("errors.cloudCodexSessionMissing"));await OC(G,"my_agents"),ln(!1)}async function PPe($,z="my_agents"){lt("");const G=w2({targetId:String($),agentKind:"codex",connectSource:z});try{const ie=await dr.connectSession($),fe=await Tie(ie);G.succeed({sandboxStatus:VL(ie.status)}),$n.current="",c(""),v([]),bn(""),cs(Ul()),vt(),fe?(w(QL(fe,ie.busy)),x({...ie,threadId:fe.threadId,cwd:fe.cwd??ie.cwd,workspaceLocked:fe.workspaceLocked,permissions:fe.permissions,...fe.model?{model:fe.model}:{}})):(w([]),x(ie)),S(ie.busy),Bn(null),ms(!1),Ur(!1),ui(!1),gs(!1),rr(!1),Ca(null),sr(!1),Ea(null),Il(!1),Pe(null),bt(null)}catch(ie){throw G.fail(Wa(ie)),lt(ie instanceof Error?ie.message:String(ie)),ie}}function DPe($){ot($.toolName),dP({page:"sandbox-agent-detail",returnTo:"agents"}),Pe($),bt(null),sr(!0),rr(!1),lt("")}async function MPe($){$.resourceType==="snapshot"?await dr.deleteSnapshot($.toolName,$.snapshotId):((y==null?void 0:y.id)===$.id&&_c(),$.toolName==="codex"?await dr.deleteSession($.id):await dr.deleteAgentSession($.toolName,$.id)),ot($.toolName),Km("sandbox-agent-detail"),Pe(null),bt(null),Ot(z=>z+1),sr(!0)}async function LPe(){const $=Mt;if(!$)return;await gi.deleteThread($.id)&&$e(null)}function _c($=!0){var G;(G=ft.current)==null||G.abort(),ft.current=null,Z.current="",Bt.current="",S(!1),vt(),w([]),$r([]),bn(""),lt(""),ri("agent"),C(!1),_(""),A(!1),T(!1),R(null),M(null),I(!1),K(""),q(null),ee(!1),se(""),vn(),$e(null),ge(!1),Qe.current+=1;const z=y;x(null),z&&$&&(z.intelligentDevelopment?fp:dr).closeSession(z.id).catch(fe=>lt(String(fe)))}async function OP($){const z=y;if(z){R($),M(null),K(""),I(!0);try{const G=$==="terminal"?await Zh.launchTerminal(z.id):await Zh.launchBrowser(z.id);M(G)}catch(G){K(G instanceof Error?G.message:String(G))}finally{I(!1)}}}async function $Pe(){var z;const $=y;if(!(!$||W==="copying")){X("copying"),lt("");try{if(!((z=navigator.clipboard)!=null&&z.writeText))throw new Error(Tt("errors.clipboardUnsupported"));const G=await dr.getEndpoint($.id);if(await navigator.clipboard.writeText(G.endpoint),Z.current!==$.id)return;X("copied"),tt.current!==void 0&&window.clearTimeout(tt.current),tt.current=window.setTimeout(()=>{X("idle"),tt.current=void 0},1600)}catch(G){if(Z.current!==$.id)return;X("idle"),lt(G instanceof Error?G.message:String(G))}}}async function FPe($){const z=y;if(!(!z||E)){C(!0),_("");try{const G=await Zh.updatePermissions(z.id,$);x(ie=>(ie==null?void 0:ie.id)===z.id?{...ie,permissions:G}:ie),Oi(z.id,Tt("sandbox.permissionsUpdated"),[{label:Tt("sandbox.labels.mode"),value:Tt(UVt[G.sandboxMode])},{label:Tt("sandbox.labels.approvalPolicy"),value:Tt(QVt[G.approvalPolicy])},{label:Tt("sandbox.labels.reviewer"),value:Tt(zVt[G.approvalsReviewer])},{label:Tt("sandbox.labels.networkAccess"),value:Tt(G.networkAccess?"sandbox.network.allowed":"sandbox.network.disabled")}]),Z.current===z.id&&A(!1)}catch(G){_(G instanceof Error?G.message:String(G))}finally{C(!1)}}}const BPe=p.useCallback(async $=>{const z=y==null?void 0:y.id;if(!z)throw new Error(Tt("errors.noConnectedSandbox"));return Zh.listDirectories(z,$)},[y==null?void 0:y.id]);async function UPe($){const z=y;if(!(!z||z.workspaceLocked||E)){C(!0),_("");try{const G=await Zh.updateWorkspace(z.id,$);x(ie=>(ie==null?void 0:ie.id)===z.id?{...ie,cwd:G}:ie),gi.invalidateSkills(),Oi(z.id,Tt("sandbox.workspaceUpdated"),[{label:Tt("sandbox.labels.workingDirectory"),value:G,code:!0}]),Z.current===z.id&&T(!1)}catch(G){_(G instanceof Error?G.message:String(G))}finally{C(!1)}}}async function QPe($){const z=y,G=Q;if(!(!z||!G||B)){ee(!0),se("");try{await Zh.resolveApproval(z.id,G.id,$),Oi(z.id,VVt(G,$),HVt(G),Bt.current),q(ie=>(ie==null?void 0:ie.id)===G.id?null:ie)}catch(ie){se(ie instanceof Error?ie.message:String(ie))}finally{ee(!1)}}}async function zPe($){const z=y;if(!z||re)return;const G=++Qe.current;lt(""),ge(!0);const ie=Array.from($).map(fe=>{const Ne={id:Die(),mimeType:Mie(fe),name:fe.name,sizeBytes:fe.size,status:"uploading",previewUrl:pe(fe)};return{file:fe,attachment:Ne}});$r(fe=>[...fe,...ie.map(({attachment:Ne})=>Ne)]);try{const Ne=(await Promise.all(ie.map(async({file:Re,attachment:ct})=>{try{const rt=await Zh.uploadFile(z.id,Re);return Qe.current!==G?null:($r(nn=>nn.map(It=>It.id===ct.id?{...It,id:rt.id,uri:rt.path,name:rt.name,mimeType:rt.mimeType,sizeBytes:rt.sizeBytes,status:"ready"}:It)),rt)}catch(rt){if(Qe.current!==G)return null;const nn=rt instanceof Error?rt.message:String(rt);return $r(It=>It.map(Vn=>Vn.id===ct.id?{...Vn,status:"error",error:nn}:Vn)),lt(nn),null}}))).filter(Re=>Re!==null);Qe.current===G&&Ne.length>0&&Oi(z.id,Ne.length===1?Tt("sandbox.fileUploaded"):Tt("sandbox.filesUploaded",{count:Ne.length}),Ne.map((Re,ct)=>({label:Ne.length===1?Tt("sandbox.labels.file"):Tt("sandbox.labels.fileNumber",{number:ct+1}),value:Re.path,code:!0})))}finally{if(Qe.current===G)ge(!1);else for(const{attachment:fe}of ie)We(fe.previewUrl)}}function VPe($){const z=Hs.find(G=>G.id===$);z&&(We(z.previewUrl),$r(G=>G.filter(ie=>ie.id!==$)))}function HPe(){var G;const $=ft.current,z=y;if($){if(z!=null&&z.intelligentDevelopment){if(((G=zt.current)==null?void 0:G.controller)===$)return;const ie=fp.interruptSession(z.id).then(()=>{var fe;return((fe=zt.current)==null?void 0:fe.controller)===$&&$.abort(),!0}).catch(fe=>{var Ne;return((Ne=zt.current)==null?void 0:Ne.controller)===$&&(zt.current=null),Z.current===z.id&&ft.current===$&<(fe instanceof Error?fe.message:String(fe)),!1});zt.current={controller:$,promise:ie};return}$.abort(),z&&dr.interruptSession(z.id).catch(ie=>{Z.current===z.id&<(ie instanceof Error?ie.message:String(ie))})}}function Pl($){if(y!=null&&y.intelligentDevelopment&&k){ut.current=$,Rt(!0);return}$()}function qPe(){var ie;const $=y,z=ut.current;if(!($!=null&&$.intelligentDevelopment)||!z){Rt(!1),ut.current=null;return}lt("");const G=fp.interruptSession($.id);(ie=ft.current)==null||ie.abort(),ut.current=null,Rt(!1),z(),G.catch(()=>{Z.current||lt(Tt("errors.buildStopUnconfirmed"))})}async function SP($,z=[],G=[],ie){var Pi;const fe=ie??y,Ne=z.filter(rn=>rn.status==="ready"&&rn.uri);if(!fe||k||!$.trim()&&Ne.length===0)return;lt(""),q(null),se("");const Re=Yte({agentId:String(fe.id),agentKind:fe.toolName,messageSource:"composer",sessionState:"existing",sessionId:String(fe.id)}),ct=new AbortController;(Pi=ft.current)==null||Pi.abort(),ft.current=ct;const rt=[];G.length>0&&rt.push({kind:"invocation",value:{skills:G.map(({name:rn,description:jn})=>({name:rn,description:jn}))}}),Ne.length>0&&rt.push({kind:"attachment",files:Ne.map(rn=>({id:rn.id,mimeType:rn.mimeType,name:rn.name,sizeBytes:rn.sizeBytes,previewUrl:rn.previewUrl}))}),$.trim()&&rt.push({kind:"text",text:$});const nn=Ne.map(rn=>rn.uri).filter(rn=>!!rn),Vn=[G.map(rn=>`$${rn.name}`).join(" "),$.trim()].filter(Boolean).join(" "),$i=nn.length>0?[Vn,Tt("sandbox.uploadedFilesPrompt"),...nn.map(rn=>`- ${rn}`)].filter(Boolean).join(` diff --git a/veadk/webui/assets/chunks/CodeDiffEditor-Dx8z_oo1.js b/veadk/webui/assets/chunks/CodeDiffEditor-B1zZ3C2s.js similarity index 99% rename from veadk/webui/assets/chunks/CodeDiffEditor-Dx8z_oo1.js rename to veadk/webui/assets/chunks/CodeDiffEditor-B1zZ3C2s.js index 5174c9331..941a82ad7 100644 --- a/veadk/webui/assets/chunks/CodeDiffEditor-Dx8z_oo1.js +++ b/veadk/webui/assets/chunks/CodeDiffEditor-B1zZ3C2s.js @@ -1,3 +1,3 @@ -import{T as Fe,i as $,f as L,E as te,b as Ve,S as R,C as je,u as W,af as Ie,B as at,F as Ue,v as dt,D as k,m as G,G as oe,W as J,ao as ft,ai as ht,R as We,aj as ct,an as ne,n as ut,ap as He,ay as Q,av as mt,H as gt}from"../app/index-DZf0wXGZ.js";class v{constructor(e,n,l,r){this.fromA=e,this.toA=n,this.fromB=l,this.toB=r}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,r,i){if(t==l)return[];let s=de(t,e,n,l,r,i),o=fe(t,e+s,n,l,r+s,i);e+=s,n-=o,r+=s,i-=o;let d=n-e,h=i-r;if(!d||!h)return[new v(e,n,r,i)];if(d>h){let f=t.slice(e,n).indexOf(l.slice(r,i));if(f>-1)return[new v(e,e+f,r,r),new v(e+f+h,n,i,i)]}else if(h>d){let f=l.slice(r,i).indexOf(t.slice(e,n));if(f>-1)return[new v(e,e,r,r+f),new v(n,n,r+f+d,i)]}if(d==1||h==1)return[new v(e,n,r,i)];let a=qe(t,e,n,l,r,i);if(a){let[f,c,u]=a;return y(t,e,f,l,r,c).concat(y(t,f+u,n,l,c+u,i))}return pt(t,e,n,l,r,i)}let j=1e9,I=0,ae=!1;function pt(t,e,n,l,r,i){let s=n-e,o=i-r;if(j<1e9&&Math.min(s,o)>j*16||I>0&&Date.now()>I)return Math.min(s,o)>j*64?[new v(e,n,r,i)]:ge(t,e,n,l,r,i);let d=Math.ceil((s+o)/2);X.reset(d),ee.reset(d);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(r+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(i-m-1),f=(s-o)%2!=0?ee:null,c=f?null:X;for(let u=0;uj||I>0&&!(u&63)&&Date.now()>I)return ge(t,e,n,l,r,i);let m=X.advance(u,s,o,d,f,!1,h)||ee.advance(u,s,o,d,c,!0,a);if(m)return Ct(t,e,n,e+m[0],l,r,i,r+m[1])}return[new v(e,n,r,i)]}class Pe{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;nn)this.end+=2;else if(f>l)this.start+=2;else if(i){let c=r+(n-l)-d;if(c>=0&&c=n-a)return[u,r+u-c]}else{let u=n-i.vec[c];if(a>=u)return[a,f]}}}return null}}const X=new Pe,ee=new Pe;function Ct(t,e,n,l,r,i,s,o){let d=!1;return!N(t,l)&&++l==n&&(d=!0),!N(r,o)&&++o==s&&(d=!0),d?[new v(e,n,i,s)]:y(t,e,l,r,i,o).concat(y(t,l,n,r,o,s))}function ze(t,e){let n=1,l=Math.min(t,e);for(;nn||a>i||t.slice(o,h)!=l.slice(d,a)){if(s==1)return o-e-(N(t,o)?0:1);s=s>>1}else{if(h==n||a==i)return h-e;o=h,d=a}}}function fe(t,e,n,l,r,i){if(e==n||r==i||t.charCodeAt(n-1)!=l.charCodeAt(i-1))return 0;let s=ze(n-e,i-r);for(let o=n,d=i;;){let h=o-s,a=d-s;if(h>1}else{if(h==e||a==r)return n-h;o=h,d=a}}}function ie(t,e,n,l,r,i,s,o){let d=l.slice(r,i),h=null;for(;;){if(h||s=n)break;let c=t.slice(a,f),u=-1;for(;(u=d.indexOf(c,u+1))!=-1;){let m=de(t,f,n,l,r+u+c.length,i),p=fe(t,e,a,l,r,r+u),g=c.length+m+p;(!h||h[2]>1}}function qe(t,e,n,l,r,i){let s=n-e,o=i-r;if(sr.fromA-e&&l.toB>r.fromB-e&&(t[n-1]=new v(l.fromA,r.toA,l.fromB,r.toB),t.splice(n--,1))}}function vt(t,e,n){for(;;){_e(n,1);let l=!1;for(let r=0;r3||o>3){let d=r==t.length-1?e.length:t[r+1].fromA,h=i.fromA-l,a=d-i.toA,f=Ce(e,i.fromA,h),c=pe(e,i.toA,a),u=i.fromA-f,m=c-i.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,i.fromA,i.toA]:[n,i.fromB,i.toB];p>u&&e.slice(f,i.fromA)==g.slice(S-u,S)?(i=t[r]=new v(f,f+s,i.fromB-u,i.toB-u),f=i.fromA,c=pe(e,i.toA,d-i.toA)):p>m&&e.slice(i.toA,c)==g.slice(C,C+m)&&(i=t[r]=new v(c-s,c,i.fromB+m,i.toB+m),c=i.toA,f=Ce(e,i.fromA,i.fromA-l)),u=i.fromA-f,m=c-i.toA}if(u||m)i=t[r]=new v(i.fromA-u,i.toA+m,i.fromB-u,i.toB+m);else if(s){if(!o){let p=Ae(e,i.fromA,i.toA),g,C=p<0?-1:ve(e,i.toA,i.fromA);p>-1&&(g=p-i.fromA)<=a&&e.slice(i.fromA,p)==e.slice(i.toA,i.toA+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toA-C)<=h&&e.slice(i.fromA-g,i.fromA)==e.slice(C,i.toA)&&(i=t[r]=i.offset(-g))}}else{let p=Ae(n,i.fromB,i.toB),g,C=p<0?-1:ve(n,i.toB,i.fromB);p>-1&&(g=p-i.fromB)<=a&&n.slice(i.fromB,p)==n.slice(i.toB,i.toB+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toB-C)<=h&&n.slice(i.fromB-g,i.fromB)==n.slice(C,i.toB)&&(i=t[r]=i.offset(-g))}}l=i.toA}return _e(t,3),t}let O;try{O=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Qe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ye(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Qe(n)?1:0:O?!Ke(n)||e==t.length-1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e,e+2))?2:0:0}function $e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Qe(n)?1:0:O?!Ze(n)||e==1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e-2,e))?2:0:0}const Je=8;function pe(t,e,n){if(e==t.length||!$e(t,e))return e;for(let l=e,r=e+n,i=0;ir)return l;l+=s}return e}function Ce(t,e,n){if(!e||!Ye(t,e))return e;for(let l=e,r=e-n,i=0;it>=55296&&t<=56319,Ze=t=>t>=56320&&t<=57343;function N(t,e){return!e||e==t.length||!Ke(t.charCodeAt(e-1))||!Ze(t.charCodeAt(e))}function xt(t,e,n){var l;let r=n==null?void 0:n.override;return r?r(t,e):(j=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,I=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,vt(t,e,y(t,0,t.length,e,0,e.length)))}function Xe(){return!ae}function et(t,e,n){return At(xt(t,e,n),t,e)}const B=Ue.define({combine:t=>t[0]}),re=R.define(),tt=Ue.define(),b=W.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(re)&&(t=n.value);for(let n of e.state.facet(tt))t=n(t,e);return t}});class E{constructor(e,n,l,r,i,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=r,this.toB=i,this.precise=s}offset(e,n){return e||n?new E(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,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,n,l){let r=et(e.toString(),n.toString(),l);return nt(r,e,n,0,0,Xe())}static updateA(e,n,l,r,i){return ke(Be(e,r,!0,l.length),e,n,l,i)}static updateB(e,n,l,r,i){return ke(Be(e,r,!1,n.length),e,n,l,i)}}function xe(t,e,n,l){let r=n.lineAt(t),i=l.lineAt(e);return r.to==t&&i.to==e&&tf+1&&g>c+1)break;u.push(m.offset(-h+l,-a+r)),[f,c]=we(m.toA+l,m.toB+r,e,n),o++}s.push(new E(u,h,Math.max(h,f),a,Math.max(a,c),i))}return s}const H=1e3;function be(t,e,n,l){let r=0,i=t.length;for(;;){if(r==i){let a=0,f=0;r&&({toA:a,toB:f}=t[r-1]);let c=e-(n?a:f);return[a+c,f+c]}let s=r+i>>1,o=t[s],[d,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(d>e)i=s;else if(h<=e)r=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let r=[];return e.iterChangedRanges((i,s,o,d)=>{let h=0,a=n?e.length:l,f=0,c=n?l:e.length;i>H&&([h,f]=be(t,i-H,n,!0)),s=h?r[r.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:r.push({fromA:h,toA:a,fromB:f,toB:c,diffA:p,diffB:g})}),r}function ke(t,e,n,l,r){if(!t.length)return e;let i=[];for(let s=0,o=0,d=0,h=0;;s++){let a=s==t.length?null:t[s],f=a?a.fromA+o:n.length,c=a?a.fromB+d:l.length;for(;hf||g.toB+d>c))break;i.push(g.offset(o,d)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+d+a.diffB,p=et(n.sliceString(f,u),l.sliceString(c,m),r);for(let g of nt(p,n,l,f,c,Xe()))i.push(g);for(o+=a.diffA,d+=a.diffB;hu&&g.fromB+d>m)break;h++}}return i}const it={scanLimit:500},K=at.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||wt(t.startState,t.state)||bt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=$.low(Ie({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty}}));function wt(t,e){return t.field(b,!1)!=e.field(b,!1)}function bt(t,e){return t.facet(B)!=e.facet(B)}const Me=k.line({class:"cm-changedLine"}),rt=k.mark({class:"cm-changedText"}),Bt=k.mark({tagName:"ins",class:"cm-insertedLine"}),kt=k.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Mt(t,e,n,l,r,i){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,d=0;if(s!=o){r.add(s,s,Me),r.add(s,o,n?kt:Bt),i&&i.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,r.add(a,a,Me),i&&i.add(a,a,De);continue}let f=a+h.value.length;if(l)for(;d=a)break;(s?f.toA:f.toB)>h&&(!i||!i(t.state,f,o,d))&&Mt(f,t.state.doc,s,l,o,d)}return{deco:o.finish(),gutter:d&&d.finish()}}class z extends J{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 Y=R.define({map:(t,e)=>t.map(e)}),U=W.define({create:()=>k.none,update:(t,e)=>{for(let n of e.effects)if(n.is(Y))return n.value;return t.map(e.changes)},provide:t=>L.decorations.from(t)}),q=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function Dt(t,e,n){let l=new G,r=new G,i=t.state.field(U).iter(),s=e.state.field(U).iter(),o=0,d=0,h=0,a=0,f=t.viewport,c=e.viewport;for(let g=0;;g++){let C=gq&&(a+=w,r.add(d,d,k.widget({widget:new z(w),block:!0,side:-1})))}if(S>o+1e3&&of.from&&dc.from){let x=Math.min(f.from-o,c.from-d);o+=x,d+=x,g--}else if(C)o=C.toA,d=C.toB;else break;for(;i.value&&i.fromq&&r.add(e.state.doc.length,e.state.doc.length,k.widget({widget:new z(u),block:!0,side:1}));let m=l.finish(),p=r.finish();Se(m,t.state.field(U))||t.dispatch({effects:Y.of(m)}),Se(p,e.state.field(U))||e.dispatch({effects:Y.of(p)})}const le=R.define({map:(t,e)=>e.mapPos(t)});class Lt extends J{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let r=e.posAtDOM(l.target);e.dispatch({effects:le.of(r)});let{side:i,sibling:s}=e.state.facet(B);s&&s().dispatch({effects:le.of(St(r,e.state.field(b),i=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function St(t,e,n){let l=0,r=0;for(let i=0;;i++){let s=i=t)return r+(t-l);[l,r]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Et=W.define({create(t){return k.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(b)!=e.startState.field(b,!1)){let n=e.state.facet(B).side=="a",l=[];for(let r of e.state.field(b))t.between(n?r.fromA:r.fromB,n?r.toA:r.toB,i=>{l.push(i)});l.length&&(t=t.update({filter:r=>l.indexOf(r)<0}))}return t},provide:t=>L.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Et.init(n=>Ot(n,t,e))}function Ot(t,e,n){let l=new G,r=t.facet(B).side=="a",i=t.field(b),s=1;for(let o=0;;o++){let d=o=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,k.replace({widget:new Lt(f),block:!0})),!d)break;s=t.doc.lineAt(Math.min(t.doc.length,r?d.toA:d.toB)).number}return l.finish()}const yt=L.styleModule.of(new dt({".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"}})),lt=L.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"}}),Ee=new Ve,_=new Ve;class Tt{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||it;let n=[$.low(K),lt,yt,U,L.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(c=>c.effects.some(u=>u.is(Y)))&&this.measure()})],l=[B.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let r=te.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],L.editorAttributes.of({class:"cm-merge-a"}),_.of(l),n]}),i=[B.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(P);let s=te.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],L.editorAttributes.of({class:"cm-merge-b"}),_.of(i),n]});this.chunks=E.build(r.doc,s.doc,this.diffConf);let o=[b.init(()=>this.chunks),Ee.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];r=r.update({effects:R.appendConfig.of(o)}).state,s=s.update({effects:R.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let d=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(d=="a-b"?h:a),this.editorDOM.appendChild(d=="a-b"?a:h),this.a=new L({state:r,parent:h,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new L({state:s,parent:a,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],r=e.reduce((s,o)=>s.compose(o.changes),je.empty(e[0].startState.doc.length));this.chunks=n==this.a?E.updateA(this.chunks,l.newDoc,this.b.state.doc,r,this.diffConf):E.updateB(this.chunks,this.a.state.doc,l.newDoc,r,this.diffConf),n.update([...e,l.state.update({effects:re.of(this.chunks)})]);let i=n==this.a?this.b:this.a;i.update([i.state.update({effects:re.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let i=e.orientation!="b-a";if(i!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(i?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(i?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let i=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(i=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(i,s,o)}let n="highlightChanges"in e,l="gutter"in e,r="collapseUnchanged"in e;if(n||l||r){let i=[],s=[];if(n||l){let o=this.a.state.facet(B),d=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;i.push(_.reconfigure([B.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:d}),d?P:[]])),s.push(_.reconfigure([B.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:d}),d?P:[]]))}if(r){let o=Ee.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);i.push(o),s.push(o)}this.a.dispatch({effects:i}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!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",r=>this.revertClicked(r)),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(){Dt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,r=this.b.viewport;for(let i=0;il.to||s.fromB>r.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Oe(t){let e=t.nextSibling;return t.remove(),e}const Rt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Gt=$.low(Ie({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty},widgetMarker:(t,e)=>e instanceof st?Rt:null}));function Nt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||it;return[$.low(K),It,lt,L.editorAttributes.of({class:"cm-merge-b"}),tt.of((r,i)=>{let s=i.effects.find(o=>o.is(he));return s&&(r=E.updateA(r,s.value.doc,i.startState.doc,s.value.changes,l)),i.docChanged&&(r=E.updateB(r,i.state.field(F),i.newDoc,i.changes,l)),r}),B.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:Pt,side:"b"}),F.init(()=>n),t.gutter!==!1?Gt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],b.init(r=>E.build(n,r.doc,l))]}const he=R.define(),F=W.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class st extends J{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 Ft(t,e,n){let l=ye.get(e.changes);if(l)return l;let r=s=>{let{highlightChanges:o,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(B),f=document.createElement("div");if(f.className="cm-deletedChunk",a){let x=f.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let M=A=>{A.preventDefault(),Vt(s,s.posAtDOM(f))},w=A=>{A.preventDefault(),jt(s,s.posAtDOM(f))};if(typeof a=="function")x.appendChild(a("accept",M)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=M;let D=x.appendChild(document.createElement("button"));D.name="reject",D.textContent=t.phrase("Reject"),D.onmousedown=w}}if(n||e.fromA>=e.toA)return f;let c=s.state.field(F).sliceString(e.fromA,e.endA),u=d&&t.facet(ft),m=S(),p=e.changes,g=0,C=!1;function S(){let x=f.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function T(x,M,w){for(let A=x;Ah){let f=t.slice(e,n).indexOf(l.slice(r,i));if(f>-1)return[new v(e,e+f,r,r),new v(e+f+h,n,i,i)]}else if(h>d){let f=l.slice(r,i).indexOf(t.slice(e,n));if(f>-1)return[new v(e,e,r,r+f),new v(n,n,r+f+d,i)]}if(d==1||h==1)return[new v(e,n,r,i)];let a=qe(t,e,n,l,r,i);if(a){let[f,c,u]=a;return y(t,e,f,l,r,c).concat(y(t,f+u,n,l,c+u,i))}return pt(t,e,n,l,r,i)}let j=1e9,I=0,ae=!1;function pt(t,e,n,l,r,i){let s=n-e,o=i-r;if(j<1e9&&Math.min(s,o)>j*16||I>0&&Date.now()>I)return Math.min(s,o)>j*64?[new v(e,n,r,i)]:ge(t,e,n,l,r,i);let d=Math.ceil((s+o)/2);X.reset(d),ee.reset(d);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(r+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(i-m-1),f=(s-o)%2!=0?ee:null,c=f?null:X;for(let u=0;uj||I>0&&!(u&63)&&Date.now()>I)return ge(t,e,n,l,r,i);let m=X.advance(u,s,o,d,f,!1,h)||ee.advance(u,s,o,d,c,!0,a);if(m)return Ct(t,e,n,e+m[0],l,r,i,r+m[1])}return[new v(e,n,r,i)]}class Pe{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;nn)this.end+=2;else if(f>l)this.start+=2;else if(i){let c=r+(n-l)-d;if(c>=0&&c=n-a)return[u,r+u-c]}else{let u=n-i.vec[c];if(a>=u)return[a,f]}}}return null}}const X=new Pe,ee=new Pe;function Ct(t,e,n,l,r,i,s,o){let d=!1;return!N(t,l)&&++l==n&&(d=!0),!N(r,o)&&++o==s&&(d=!0),d?[new v(e,n,i,s)]:y(t,e,l,r,i,o).concat(y(t,l,n,r,o,s))}function ze(t,e){let n=1,l=Math.min(t,e);for(;nn||a>i||t.slice(o,h)!=l.slice(d,a)){if(s==1)return o-e-(N(t,o)?0:1);s=s>>1}else{if(h==n||a==i)return h-e;o=h,d=a}}}function fe(t,e,n,l,r,i){if(e==n||r==i||t.charCodeAt(n-1)!=l.charCodeAt(i-1))return 0;let s=ze(n-e,i-r);for(let o=n,d=i;;){let h=o-s,a=d-s;if(h>1}else{if(h==e||a==r)return n-h;o=h,d=a}}}function ie(t,e,n,l,r,i,s,o){let d=l.slice(r,i),h=null;for(;;){if(h||s=n)break;let c=t.slice(a,f),u=-1;for(;(u=d.indexOf(c,u+1))!=-1;){let m=de(t,f,n,l,r+u+c.length,i),p=fe(t,e,a,l,r,r+u),g=c.length+m+p;(!h||h[2]>1}}function qe(t,e,n,l,r,i){let s=n-e,o=i-r;if(sr.fromA-e&&l.toB>r.fromB-e&&(t[n-1]=new v(l.fromA,r.toA,l.fromB,r.toB),t.splice(n--,1))}}function vt(t,e,n){for(;;){_e(n,1);let l=!1;for(let r=0;r3||o>3){let d=r==t.length-1?e.length:t[r+1].fromA,h=i.fromA-l,a=d-i.toA,f=Ce(e,i.fromA,h),c=pe(e,i.toA,a),u=i.fromA-f,m=c-i.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,i.fromA,i.toA]:[n,i.fromB,i.toB];p>u&&e.slice(f,i.fromA)==g.slice(S-u,S)?(i=t[r]=new v(f,f+s,i.fromB-u,i.toB-u),f=i.fromA,c=pe(e,i.toA,d-i.toA)):p>m&&e.slice(i.toA,c)==g.slice(C,C+m)&&(i=t[r]=new v(c-s,c,i.fromB+m,i.toB+m),c=i.toA,f=Ce(e,i.fromA,i.fromA-l)),u=i.fromA-f,m=c-i.toA}if(u||m)i=t[r]=new v(i.fromA-u,i.toA+m,i.fromB-u,i.toB+m);else if(s){if(!o){let p=Ae(e,i.fromA,i.toA),g,C=p<0?-1:ve(e,i.toA,i.fromA);p>-1&&(g=p-i.fromA)<=a&&e.slice(i.fromA,p)==e.slice(i.toA,i.toA+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toA-C)<=h&&e.slice(i.fromA-g,i.fromA)==e.slice(C,i.toA)&&(i=t[r]=i.offset(-g))}}else{let p=Ae(n,i.fromB,i.toB),g,C=p<0?-1:ve(n,i.toB,i.fromB);p>-1&&(g=p-i.fromB)<=a&&n.slice(i.fromB,p)==n.slice(i.toB,i.toB+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toB-C)<=h&&n.slice(i.fromB-g,i.fromB)==n.slice(C,i.toB)&&(i=t[r]=i.offset(-g))}}l=i.toA}return _e(t,3),t}let O;try{O=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Qe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ye(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Qe(n)?1:0:O?!Ke(n)||e==t.length-1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e,e+2))?2:0:0}function $e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Qe(n)?1:0:O?!Ze(n)||e==1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e-2,e))?2:0:0}const Je=8;function pe(t,e,n){if(e==t.length||!$e(t,e))return e;for(let l=e,r=e+n,i=0;ir)return l;l+=s}return e}function Ce(t,e,n){if(!e||!Ye(t,e))return e;for(let l=e,r=e-n,i=0;it>=55296&&t<=56319,Ze=t=>t>=56320&&t<=57343;function N(t,e){return!e||e==t.length||!Ke(t.charCodeAt(e-1))||!Ze(t.charCodeAt(e))}function xt(t,e,n){var l;let r=n==null?void 0:n.override;return r?r(t,e):(j=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,I=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,vt(t,e,y(t,0,t.length,e,0,e.length)))}function Xe(){return!ae}function et(t,e,n){return At(xt(t,e,n),t,e)}const B=Ue.define({combine:t=>t[0]}),re=R.define(),tt=Ue.define(),b=W.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(re)&&(t=n.value);for(let n of e.state.facet(tt))t=n(t,e);return t}});class E{constructor(e,n,l,r,i,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=r,this.toB=i,this.precise=s}offset(e,n){return e||n?new E(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,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,n,l){let r=et(e.toString(),n.toString(),l);return nt(r,e,n,0,0,Xe())}static updateA(e,n,l,r,i){return ke(Be(e,r,!0,l.length),e,n,l,i)}static updateB(e,n,l,r,i){return ke(Be(e,r,!1,n.length),e,n,l,i)}}function xe(t,e,n,l){let r=n.lineAt(t),i=l.lineAt(e);return r.to==t&&i.to==e&&tf+1&&g>c+1)break;u.push(m.offset(-h+l,-a+r)),[f,c]=we(m.toA+l,m.toB+r,e,n),o++}s.push(new E(u,h,Math.max(h,f),a,Math.max(a,c),i))}return s}const H=1e3;function be(t,e,n,l){let r=0,i=t.length;for(;;){if(r==i){let a=0,f=0;r&&({toA:a,toB:f}=t[r-1]);let c=e-(n?a:f);return[a+c,f+c]}let s=r+i>>1,o=t[s],[d,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(d>e)i=s;else if(h<=e)r=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let r=[];return e.iterChangedRanges((i,s,o,d)=>{let h=0,a=n?e.length:l,f=0,c=n?l:e.length;i>H&&([h,f]=be(t,i-H,n,!0)),s=h?r[r.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:r.push({fromA:h,toA:a,fromB:f,toB:c,diffA:p,diffB:g})}),r}function ke(t,e,n,l,r){if(!t.length)return e;let i=[];for(let s=0,o=0,d=0,h=0;;s++){let a=s==t.length?null:t[s],f=a?a.fromA+o:n.length,c=a?a.fromB+d:l.length;for(;hf||g.toB+d>c))break;i.push(g.offset(o,d)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+d+a.diffB,p=et(n.sliceString(f,u),l.sliceString(c,m),r);for(let g of nt(p,n,l,f,c,Xe()))i.push(g);for(o+=a.diffA,d+=a.diffB;hu&&g.fromB+d>m)break;h++}}return i}const it={scanLimit:500},K=at.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||wt(t.startState,t.state)||bt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=$.low(Ie({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty}}));function wt(t,e){return t.field(b,!1)!=e.field(b,!1)}function bt(t,e){return t.facet(B)!=e.facet(B)}const Me=k.line({class:"cm-changedLine"}),rt=k.mark({class:"cm-changedText"}),Bt=k.mark({tagName:"ins",class:"cm-insertedLine"}),kt=k.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Mt(t,e,n,l,r,i){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,d=0;if(s!=o){r.add(s,s,Me),r.add(s,o,n?kt:Bt),i&&i.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,r.add(a,a,Me),i&&i.add(a,a,De);continue}let f=a+h.value.length;if(l)for(;d=a)break;(s?f.toA:f.toB)>h&&(!i||!i(t.state,f,o,d))&&Mt(f,t.state.doc,s,l,o,d)}return{deco:o.finish(),gutter:d&&d.finish()}}class z extends J{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 Y=R.define({map:(t,e)=>t.map(e)}),U=W.define({create:()=>k.none,update:(t,e)=>{for(let n of e.effects)if(n.is(Y))return n.value;return t.map(e.changes)},provide:t=>L.decorations.from(t)}),q=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function Dt(t,e,n){let l=new G,r=new G,i=t.state.field(U).iter(),s=e.state.field(U).iter(),o=0,d=0,h=0,a=0,f=t.viewport,c=e.viewport;for(let g=0;;g++){let C=gq&&(a+=w,r.add(d,d,k.widget({widget:new z(w),block:!0,side:-1})))}if(S>o+1e3&&of.from&&dc.from){let x=Math.min(f.from-o,c.from-d);o+=x,d+=x,g--}else if(C)o=C.toA,d=C.toB;else break;for(;i.value&&i.fromq&&r.add(e.state.doc.length,e.state.doc.length,k.widget({widget:new z(u),block:!0,side:1}));let m=l.finish(),p=r.finish();Se(m,t.state.field(U))||t.dispatch({effects:Y.of(m)}),Se(p,e.state.field(U))||e.dispatch({effects:Y.of(p)})}const le=R.define({map:(t,e)=>e.mapPos(t)});class Lt extends J{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let r=e.posAtDOM(l.target);e.dispatch({effects:le.of(r)});let{side:i,sibling:s}=e.state.facet(B);s&&s().dispatch({effects:le.of(St(r,e.state.field(b),i=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function St(t,e,n){let l=0,r=0;for(let i=0;;i++){let s=i=t)return r+(t-l);[l,r]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Et=W.define({create(t){return k.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(b)!=e.startState.field(b,!1)){let n=e.state.facet(B).side=="a",l=[];for(let r of e.state.field(b))t.between(n?r.fromA:r.fromB,n?r.toA:r.toB,i=>{l.push(i)});l.length&&(t=t.update({filter:r=>l.indexOf(r)<0}))}return t},provide:t=>L.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Et.init(n=>Ot(n,t,e))}function Ot(t,e,n){let l=new G,r=t.facet(B).side=="a",i=t.field(b),s=1;for(let o=0;;o++){let d=o=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,k.replace({widget:new Lt(f),block:!0})),!d)break;s=t.doc.lineAt(Math.min(t.doc.length,r?d.toA:d.toB)).number}return l.finish()}const yt=L.styleModule.of(new dt({".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"}})),lt=L.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"}}),Ee=new Ve,_=new Ve;class Tt{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||it;let n=[$.low(K),lt,yt,U,L.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(c=>c.effects.some(u=>u.is(Y)))&&this.measure()})],l=[B.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let r=te.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],L.editorAttributes.of({class:"cm-merge-a"}),_.of(l),n]}),i=[B.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(P);let s=te.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],L.editorAttributes.of({class:"cm-merge-b"}),_.of(i),n]});this.chunks=E.build(r.doc,s.doc,this.diffConf);let o=[b.init(()=>this.chunks),Ee.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];r=r.update({effects:R.appendConfig.of(o)}).state,s=s.update({effects:R.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let d=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(d=="a-b"?h:a),this.editorDOM.appendChild(d=="a-b"?a:h),this.a=new L({state:r,parent:h,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new L({state:s,parent:a,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],r=e.reduce((s,o)=>s.compose(o.changes),je.empty(e[0].startState.doc.length));this.chunks=n==this.a?E.updateA(this.chunks,l.newDoc,this.b.state.doc,r,this.diffConf):E.updateB(this.chunks,this.a.state.doc,l.newDoc,r,this.diffConf),n.update([...e,l.state.update({effects:re.of(this.chunks)})]);let i=n==this.a?this.b:this.a;i.update([i.state.update({effects:re.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let i=e.orientation!="b-a";if(i!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(i?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(i?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let i=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(i=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(i,s,o)}let n="highlightChanges"in e,l="gutter"in e,r="collapseUnchanged"in e;if(n||l||r){let i=[],s=[];if(n||l){let o=this.a.state.facet(B),d=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;i.push(_.reconfigure([B.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:d}),d?P:[]])),s.push(_.reconfigure([B.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:d}),d?P:[]]))}if(r){let o=Ee.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);i.push(o),s.push(o)}this.a.dispatch({effects:i}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!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",r=>this.revertClicked(r)),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(){Dt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,r=this.b.viewport;for(let i=0;il.to||s.fromB>r.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Oe(t){let e=t.nextSibling;return t.remove(),e}const Rt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Gt=$.low(Ie({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty},widgetMarker:(t,e)=>e instanceof st?Rt:null}));function Nt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||it;return[$.low(K),It,lt,L.editorAttributes.of({class:"cm-merge-b"}),tt.of((r,i)=>{let s=i.effects.find(o=>o.is(he));return s&&(r=E.updateA(r,s.value.doc,i.startState.doc,s.value.changes,l)),i.docChanged&&(r=E.updateB(r,i.state.field(F),i.newDoc,i.changes,l)),r}),B.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:Pt,side:"b"}),F.init(()=>n),t.gutter!==!1?Gt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],b.init(r=>E.build(n,r.doc,l))]}const he=R.define(),F=W.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class st extends J{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 Ft(t,e,n){let l=ye.get(e.changes);if(l)return l;let r=s=>{let{highlightChanges:o,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(B),f=document.createElement("div");if(f.className="cm-deletedChunk",a){let x=f.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let M=A=>{A.preventDefault(),Vt(s,s.posAtDOM(f))},w=A=>{A.preventDefault(),jt(s,s.posAtDOM(f))};if(typeof a=="function")x.appendChild(a("accept",M)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=M;let D=x.appendChild(document.createElement("button"));D.name="reject",D.textContent=t.phrase("Reject"),D.onmousedown=w}}if(n||e.fromA>=e.toA)return f;let c=s.state.field(F).sliceString(e.fromA,e.endA),u=d&&t.facet(ft),m=S(),p=e.changes,g=0,C=!1;function S(){let x=f.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function T(x,M,w){for(let A=x;A-1&&ZA){let V=document.createTextNode(c.slice(A,D));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(V)}else m.appendChild(V);A=D}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),M=0;ht(x,{style:w=>ct(t,w)},(w,A,D)=>{w>M&&T(M,w,""),T(w,A,D),M=A}),T(M,c.length,"")}else T(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),f},i=k.widget({block:!0,side:-1,widget:new st(r)});return ye.set(e.changes,i),i}function Vt(t,e){let{state:n}=t,l=e??n.selection.main.head,r=t.state.field(b).find(d=>d.fromB<=l&&d.endB>=l);if(!r)return!1;let i=t.state.sliceDoc(r.fromB,Math.max(r.fromB,r.toB-1)),s=t.state.field(F);r.fromB!=r.toB&&r.toA<=s.length&&(i+=t.state.lineBreak);let o=je.of({from:r.fromA,to:Math.min(s.length,r.toA),insert:i},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function jt(t,e){let{state:n}=t,l=e??n.selection.main.head,r=n.field(b).find(o=>o.fromB<=l&&o.endB>=l);if(!r)return!1;let s=n.field(F).sliceString(r.fromA,Math.max(r.fromA,r.toA-1));return r.fromA!=r.toA&&r.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:r.fromB,to:Math.min(n.doc.length,r.toB),insert:s},userEvent:"revert"}),!0}function Te(t){let e=new G;for(let n of t.field(b)){let l=t.facet(B).overrideChunk&&ot(t,n);e.add(n.fromB,n.fromB,Ft(t,n,!!l))}return e.finish()}const It=W.define({create:t=>Te(t),update(t,e){return e.state.field(b,!1)!=e.startState.field(b,!1)?Te(e.state):t},provide:t=>L.decorations.from(t)}),Re=new WeakMap;function ot(t,e){let n=Re.get(e);if(n!==void 0)return n;n=null;let l=t.field(F),r=t.doc,i=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=r.lineAt(e.endB).number-r.lineAt(e.fromB).number+1;e:if(i==s&&i<10){let o=[],d=0,h=e.fromA,a=e.fromB;for(let f of e.changes){if(f.fromA=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}const Ge="(max-width: 760px)";function zt(){const[t,e]=Q.useState(()=>typeof window<"u"&&window.matchMedia(Ge).matches);return Q.useEffect(()=>{const n=window.matchMedia(Ge),l=()=>e(n.matches);return l(),n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[]),t}function Ne(t,e){return[gt({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...He(t),te.readOnly.of(!0),...e==="dark"?[mt]:[]]}function qt({before:t,after:e,path:n,theme:l}){const r=Q.useRef(null);return Q.useEffect(()=>{if(!r.current)return;const i=new Tt({a:{doc:t,extensions:Ne(n,l)},b:{doc:e,extensions:Ne(n,l)},parent:r.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}});return()=>i.destroy()},[e,t,n,l]),ne.jsx("div",{ref:r,className:"code-browser-merge"})}function Qt(t){return zt()?ne.jsx(ut,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...He(t.path),...Nt({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}}):ne.jsx(qt,{...t})}export{Qt as default}; diff --git a/veadk/webui/assets/chunks/MarkdownPromptEditor-C4VlPACI.js b/veadk/webui/assets/chunks/MarkdownPromptEditor-B5lw1jCi.js similarity index 99% rename from veadk/webui/assets/chunks/MarkdownPromptEditor-C4VlPACI.js rename to veadk/webui/assets/chunks/MarkdownPromptEditor-B5lw1jCi.js index d427c71e1..48201d416 100644 --- a/veadk/webui/assets/chunks/MarkdownPromptEditor-C4VlPACI.js +++ b/veadk/webui/assets/chunks/MarkdownPromptEditor-B5lw1jCi.js @@ -1,4 +1,4 @@ -var T0=Object.defineProperty;var E0=(n,e,t)=>e in n?T0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>E0(n,typeof e!="symbol"?e+"":e,t);import{ay as I,aH as Rn,an as F,A as k0,k as Jt,M as at,aM as jo,P as N0,j as M0,aG as hc,aL as Fh,ax as Uo,U as Rh,O as $0,ah as L0,aK as O0,o as A0,g as I0,e as P0,Q as Hh,Y as D0,c as F0,z as R0,aJ as Vh,aI as Fu,s as H0,I as V0,x as B0,X as Bh,Z as zh,r as z0,w as K0,a5 as Ru,a6 as J0,a0 as W0,a2 as aa,aw as j0,aO as U0,ag as Z0,p as T,$ as Hu,J as Vu,V as Qe,au as nn,aE as Di,aC as $l,az as q0,K as Bu,aq as jt,as as hs,a4 as gc,ar as Wn,aF as En,aD as Pt,N as So,a7 as G0,ab as Y0,a9 as X0,aa as Q0,a8 as e5,ae as t5,ac as n5,ad as r5,l as o5,t as i5,y as s5,h as l5,d as a5,aN as c5}from"../app/index-DZf0wXGZ.js";var u5=Object.defineProperty,f5=(n,e)=>u5(n,"name",{value:e,configurable:!0});function Kh(n){const e=I.useRef({value:n,previous:n});return I.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}f5(Kh,"usePrevious");var d5=Object.defineProperty,h5=(n,e)=>d5(n,"name",{value:e,configurable:!0});function ca(n,[e,t]){return Math.min(t,Math.max(e,n))}h5(ca,"clamp");var g5=Object.defineProperty,be=(n,e)=>g5(n,"name",{value:e,configurable:!0}),p5=[" ","Enter","ArrowUp","ArrowDown"],m5=[" ","Enter"],oo="Select",[Us,pc,_5]=$0(oo),[vr,gv]=Hh(oo,[_5,Rh]),mc=Rh(),[x5,Hn]=vr(oo),[y5,C5]=vr(oo);function Jh(n){const{__scopeSelect:e,children:t,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:f,disabled:d,required:g,form:h,internal_do_not_use_render:_}=n,m=mc(e),[p,y]=I.useState(null),[C,x]=I.useState(null),[w,k]=I.useState(!1),b=Vh(c),[v,E]=Fu({prop:r,defaultProp:o??!1,onChange:i,caller:oo}),[M,L]=Fu({prop:s,defaultProp:l,onChange:a,caller:oo}),H=I.useRef(null),R=I.useRef(M);I.useEffect(()=>{const Te=h?p==null?void 0:p.ownerDocument.getElementById(h):p==null?void 0:p.form;if(Te instanceof HTMLFormElement){const Se=be(()=>L(R.current),"reset");return Te.addEventListener("reset",Se),()=>Te.removeEventListener("reset",Se)}},[h,p,L]);const V=p?!!h||!!p.closest("form"):!0,[Z,G]=I.useState(new Set),z=Fh(),re=Array.from(Z).map(Te=>Te.props.value).join(";"),ee=I.useCallback(Te=>{G(Se=>new Set(Se).add(Te))},[]),ne=I.useCallback(Te=>{G(Se=>{const Je=new Set(Se);return Je.delete(Te),Je})},[]),ae={required:g,trigger:p,onTriggerChange:y,valueNode:C,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:z,value:M,onValueChange:L,open:v,onOpenChange:E,dir:b,triggerPointerDownPosRef:H,disabled:d,name:u,autoComplete:f,form:h,nativeOptions:Z,nativeSelectKey:re,isFormControl:V};return F.jsx(H0,{...m,children:F.jsx(x5,{scope:e,...ae,children:F.jsx(Us.Provider,{scope:e,children:F.jsx(y5,{scope:e,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:jh(_)?_(ae):t})})})})}be(Jh,"SelectProvider");var v5=be(n=>{const{__scopeSelect:e,children:t,...r}=n;return F.jsx(Jh,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>F.jsxs(F.Fragment,{children:[t,o?F.jsx(j5,{__scopeSelect:e}):null]})})},"Select"),b5="SelectTrigger",S5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,disabled:o=!1,...i}=e,s=mc(r),l=Hn(b5,r),a=l.disabled||o,c=Rn(t,l.onTriggerChange),u=pc(r),f=I.useRef("touch"),[d,g,h]=_c(m=>{const p=u().filter(x=>!x.disabled),y=p.find(x=>x.value===l.value),C=xc(p,m,y);C!==void 0&&l.onValueChange(C.value)}),_=be(m=>{a||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return F.jsx(k0,{asChild:!0,...s,children:F.jsx(Jt.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":yi(l.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&_(m)}),onPointerDown:at(i.onPointerDown,m=>{f.current=m.pointerType;const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(_(m),m.preventDefault())}),onKeyDown:at(i.onKeyDown,m=>{const p=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(p&&m.key===" ")&&p5.includes(m.key)&&(_(),m.preventDefault())})})})},"SelectTrigger")),w5="SelectValue",T5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,children:s,placeholder:l="",...a}=e,c=Hn(w5,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Rn(t,c.onValueNodeChange);jo(()=>{u(f)},[u,f]);const g=yi(c.value);return F.jsx(Jt.span,{...a,asChild:g?!1:a.asChild,ref:d,style:{pointerEvents:"none"},children:F.jsx(I.Fragment,{children:g?l:s},g?"placeholder":"value")})},"SelectValue")),E5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,...i}=e;return F.jsx(Jt.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})},"SelectIcon")),k5="SelectPortal",[N5,M5]=vr(k5,{forceMount:void 0}),$5=be(n=>{const{__scopeSelect:e,forceMount:t,...r}=n;return F.jsx(N5,{scope:n.__scopeSelect,forceMount:t,children:F.jsx(N0,{asChild:!0,...r})})},"SelectPortal"),sr="SelectContent",L5=I.forwardRef(be(function(e,t){const r=M5(sr,e.__scopeSelect),{forceMount:o=r.forceMount,...i}=e,s=Hn(sr,e.__scopeSelect),[l,a]=I.useState();return jo(()=>{a(new DocumentFragment)},[]),F.jsx(M0,{present:o||s.open,children:({present:c})=>c?F.jsx(I5,{...i,ref:t}):F.jsx(O5,{...i,fragment:l})})},"SelectContent")),O5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,fragment:i}=e;return i?Uo.createPortal(F.jsx(Wh,{scope:r,children:F.jsx(Us.Slot,{scope:r,children:F.jsx("div",{ref:t,children:o})})}),i):null},"SelectContentFragment")),Ft=10,[Wh,Zs]=vr(sr),A5=D0("SelectContent.RemoveScroll"),I5=I.forwardRef(be(function(e,t){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p,...y}=e,C=Hn(sr,r),[x,w]=I.useState(null),[k,b]=I.useState(null),v=Rn(t,w),[E,M]=I.useState(null),[L,H]=I.useState(null),R=pc(r),[V,Z]=I.useState(!1),G=I.useRef(!1);I.useEffect(()=>{if(x)return L0(x)},[x]),O0();const z=I.useCallback(W=>{const[ce,...Ie]=R().map(xe=>xe.ref.current),[ue]=Ie.slice(-1),de=document.activeElement;for(const xe of W)if(xe===de||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===ce&&k&&(k.scrollTop=0),xe===ue&&k&&(k.scrollTop=k.scrollHeight),xe==null||xe.focus(),document.activeElement!==de))return},[R,k]),re=I.useCallback(()=>z([E,x]),[z,E,x]);I.useEffect(()=>{V&&re()},[V,re]);const{onOpenChange:ee,triggerPointerDownPosRef:ne}=C;I.useEffect(()=>{if(x){let W={x:0,y:0};const ce=be(ue=>{var de,xe;W={x:Math.abs(Math.round(ue.pageX)-(((de=ne.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((xe=ne.current)==null?void 0:xe.y)??0))}},"handlePointerMove"),Ie=be(ue=>{W.x<=10&&W.y<=10?ue.preventDefault():ue.composedPath().includes(x)||ee(!1),document.removeEventListener("pointermove",ce),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[x,ee,ne]),I.useEffect(()=>{const W=be(()=>ee(!1),"close");return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ee]);const[ae,Te]=_c(W=>{const ce=R().filter(de=>!de.disabled),Ie=ce.find(de=>de.ref.current===document.activeElement),ue=xc(ce,W,Ie);ue&&setTimeout(()=>{var de;return(de=ue.ref.current)==null?void 0:de.focus()})}),Se=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&(M(W),ue&&(G.current=!0))},[C.value]),Je=I.useCallback(()=>x==null?void 0:x.focus(),[x]),Ye=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&H(W)},[C.value]),ie=o==="popper"?zu:P5,_e=ie===zu?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p}:{};return F.jsx(Wh,{scope:r,content:x,viewport:k,onViewportChange:b,itemRefCallback:Se,selectedItem:E,onItemLeave:Je,itemTextRefCallback:Ye,focusSelectedItem:re,selectedItemText:L,position:o,isPositioned:V,searchRef:ae,children:F.jsx(A0,{as:A5,allowPinchZoom:!0,children:F.jsx(I0,{asChild:!0,trapped:C.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:at(i,W=>{var ce;(ce=C.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:F.jsx(P0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:F.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:W=>W.preventDefault(),...y,..._e,onPlaced:()=>Z(!0),ref:v,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:at(y.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Te(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ue=R().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const de=W.target,xe=ue.indexOf(de);ue=ue.slice(xe+1)}setTimeout(()=>z(ue)),W.preventDefault()}})})})})})})},"SelectContentImpl")),P5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,onPlaced:o,...i}=e,s=Hn(sr,r),l=Zs(sr,r),[a,c]=I.useState(null),[u,f]=I.useState(null),d=Rn(t,f),g=pc(r),h=I.useRef(!1),_=I.useRef(!0),{viewport:m,selectedItem:p,selectedItemText:y,focusSelectedItem:C}=l,x=I.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&p&&y){const v=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const de=L.left-E.left,xe=M.left-de,en=v.left-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.left=Pr+"px"}else{const de=E.right-L.right,xe=window.innerWidth-M.right-de,en=window.innerWidth-v.right-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.right=Pr+"px"}const H=g(),R=window.innerHeight-Ft*2,V=m.scrollHeight,Z=window.getComputedStyle(u),G=parseInt(Z.borderTopWidth,10),z=parseInt(Z.paddingTop,10),re=parseInt(Z.borderBottomWidth,10),ee=parseInt(Z.paddingBottom,10),ne=G+z+V+ee+re,ae=Math.min(p.offsetHeight*5,ne),Te=window.getComputedStyle(m),Se=parseInt(Te.paddingTop,10),Je=parseInt(Te.paddingBottom,10),Ye=v.top+v.height/2-Ft,ie=R-Ye,_e=p.offsetHeight/2,W=p.offsetTop+_e,ce=G+z+W,Ie=ne-ce;if(ce<=Ye){const de=H.length>0&&p===H[H.length-1].ref.current;a.style.bottom="0px";const xe=u.clientHeight-m.offsetTop-m.offsetHeight,en=Math.max(ie,_e+(de?Je:0)+xe+re),tn=ce+en;a.style.height=tn+"px"}else{const de=H.length>0&&p===H[0].ref.current;a.style.top="0px";const en=Math.max(Ye,G+m.offsetTop+(de?Se:0)+_e)+Ie;a.style.height=en+"px",m.scrollTop=ce-Ye+m.offsetTop}a.style.margin=`${Ft}px 0`,a.style.minHeight=ae+"px",a.style.maxHeight=R+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,u,m,p,y,s.dir,o]);jo(()=>x(),[x]);const[w,k]=I.useState();jo(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const b=I.useCallback(v=>{v&&_.current===!0&&(x(),C==null||C(),_.current=!1)},[x,C]);return F.jsx(D5,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:F.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:F.jsx(Jt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),zu=I.forwardRef(be(function(e,t){const{__scopeSelect:r,align:o="start",collisionPadding:i=Ft,...s}=e,l=mc(r);return F.jsx(F0,{...l,...s,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[D5,F5]=vr(sr,{}),Ku="SelectViewport",R5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,nonce:o,...i}=e,s=Zs(Ku,r),l=F5(Ku,r),a=Rn(t,s.onViewportChange),c=I.useRef(0);return F.jsxs(F.Fragment,{children:[F.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),F.jsx(Us.Slot,{scope:r,children:F.jsx(Jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:at(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const _=window.innerHeight-Ft*2,m=parseFloat(d.style.minHeight),p=parseFloat(d.style.height),y=Math.max(m,p);if(y<_){const C=y+h,x=Math.min(_,C),w=C-x;d.style.height=x+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})},"SelectViewport")),H5="SelectGroup",[pv,mv]=vr(H5),ua="SelectItem",[V5,B5]=vr(ua),z5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,value:o,disabled:i=!1,textValue:s,...l}=e,a=Hn(ua,r),c=Zs(ua,r),u=a.value===o,[f,d]=I.useState(s??""),[g,h]=I.useState(!1),_=hc(x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,o,i)}),m=Rn(t,_),p=Fh(),y=I.useRef("touch"),C=be(()=>{i||(a.onValueChange(o),a.onOpenChange(!1))},"handleSelect");return F.jsx(V5,{scope:r,value:o,disabled:i,textId:p,isSelected:u,onItemTextChange:I.useCallback(x=>{d(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:F.jsx(Us.ItemSlot,{scope:r,value:o,disabled:i,textValue:f,children:F.jsx(Jt.div,{role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:m,onFocus:at(l.onFocus,()=>h(!0)),onBlur:at(l.onBlur,()=>h(!1)),onClick:at(l.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:at(l.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:at(l.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:at(l.onPointerMove,x=>{var w;y.current=x.pointerType,i?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(l.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:at(l.onKeyDown,x=>{var k;i||x.target!==x.currentTarget||((k=c.searchRef)==null?void 0:k.current)!==""&&x.key===" "||(m5.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})},"SelectItem")),Fi="SelectItemText",K5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,...s}=e,l=Hn(Fi,r),a=Zs(Fi,r),c=B5(Fi,r),u=C5(Fi,r),[f,d]=I.useState(null),g=hc(C=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,C,c.value,c.disabled)}),h=Rn(t,d,c.onItemTextChange,g),_=f==null?void 0:f.textContent,m=I.useMemo(()=>F.jsx("option",{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=u;return jo(()=>(p(m),()=>y(m)),[p,y,m]),F.jsxs(F.Fragment,{children:[F.jsx(Jt.span,{id:c.textId,...s,ref:h}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!yi(l.value)?Uo.createPortal(s.children,l.valueNode):null]})},"SelectItemText")),J5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,...o}=e;return F.jsx(Jt.div,{"aria-hidden":!0,...o,ref:t})},"SelectSeparator")),W5="SelectBubbleInput",j5=I.forwardRef(be(function({__scopeSelect:e,...t},r){const o=Hn(W5,e),{value:i,onValueChange:s,required:l,disabled:a,name:c,autoComplete:u,form:f}=o,{nativeOptions:d,nativeSelectKey:g}=o,h=I.useRef(null),_=Rn(r,h),m=i??"",p=Kh(m),y=Array.from(d).some(C=>(C.props.value??"")==="");return I.useEffect(()=>{const C=h.current;if(!C)return;const x=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(x,"value").set;if(p!==m&&k){const b=new Event("change",{bubbles:!0});k.call(C,m),C.dispatchEvent(b)}},[p,m]),F.jsxs(Jt.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:c,autoComplete:u,disabled:a,form:f,onChange:C=>s(C.target.value),...t,style:{...R0,...t.style},ref:_,defaultValue:m,children:[yi(i)&&!y?F.jsx("option",{value:""}):null,Array.from(d)]},g)},"SelectBubbleInput"));function jh(n){return typeof n=="function"}be(jh,"isFunction");function yi(n){return n===""||n===void 0}be(yi,"shouldShowPlaceholder");function _c(n){const e=hc(n),t=I.useRef(""),r=I.useRef(0),o=I.useCallback(s=>{const l=t.current+s;e(l),be(function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))},"updateSearch")(l)},[e]),i=I.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,o,i]}be(_c,"useTypeaheadSearch");function xc(n,e,t){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Uh(n,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==t));const a=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==t?a:void 0}be(xc,"findNextItem");function Uh(n,e){return n.map((t,r)=>n[(e+r)%n.length])}be(Uh,"wrapArray");var U5=Object.defineProperty,qs=(n,e)=>U5(n,"name",{value:e,configurable:!0}),Zh="Toolbar",[Z5,_v]=Hh(Zh,[Bh,zh]),qh=Bh(),Gh=zh(),[q5,G5]=Z5(Zh),Y5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,orientation:o="horizontal",dir:i,loop:s=!0,...l}=e,a=qh(r),c=Vh(i);return F.jsx(q5,{scope:r,orientation:o,dir:c,children:F.jsx(z0,{asChild:!0,...a,orientation:o,dir:c,loop:s,children:F.jsx(Jt.div,{role:"toolbar","aria-orientation":o,dir:c,...l,ref:t})})})},"Toolbar")),Yh=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=qh(r);return F.jsx(V0,{asChild:!0,...i,focusable:!e.disabled,children:F.jsx(Jt.button,{type:"button",...o,ref:t})})},"ToolbarButton")),X5="ToolbarToggleGroup",Q5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=G5(X5,r),s=Gh(r);return F.jsx(K0,{"data-orientation":i.orientation,dir:i.dir,...s,...o,ref:t,rovingFocus:!1})},"ToolbarToggleGroup")),e2=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=Gh(r),s={__scopeToolbar:e.__scopeToolbar};return F.jsx(Yh,{asChild:!0,...s,children:F.jsx(B0,{...i,...o,ref:t})})},"ToolbarToggleItem")),t2=Y5,n2=Yh,yc=Q5,r2=e2;const o2={}.hasOwnProperty;function Xh(n,e){let t=-1,r;if(e.extensions)for(;++te in n?T0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>E0(n,typeof e!="symbol"?e+"":e,t);import{ay as I,aH as Rn,an as F,A as k0,k as Jt,M as at,aM as jo,P as N0,j as M0,aG as hc,aL as Fh,ax as Uo,U as Rh,O as $0,ah as L0,aK as O0,o as A0,g as I0,e as P0,Q as Hh,Y as D0,c as F0,z as R0,aJ as Vh,aI as Fu,s as H0,I as V0,x as B0,X as Bh,Z as zh,r as z0,w as K0,a5 as Ru,a6 as J0,a0 as W0,a2 as aa,aw as j0,aO as U0,ag as Z0,p as T,$ as Hu,J as Vu,V as Qe,au as nn,aE as Di,aC as $l,az as q0,K as Bu,aq as jt,as as hs,a4 as gc,ar as Wn,aF as En,aD as Pt,N as So,a7 as G0,ab as Y0,a9 as X0,aa as Q0,a8 as e5,ae as t5,ac as n5,ad as r5,l as o5,t as i5,y as s5,h as l5,d as a5,aN as c5}from"../app/index-y89rQfXU.js";var u5=Object.defineProperty,f5=(n,e)=>u5(n,"name",{value:e,configurable:!0});function Kh(n){const e=I.useRef({value:n,previous:n});return I.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}f5(Kh,"usePrevious");var d5=Object.defineProperty,h5=(n,e)=>d5(n,"name",{value:e,configurable:!0});function ca(n,[e,t]){return Math.min(t,Math.max(e,n))}h5(ca,"clamp");var g5=Object.defineProperty,be=(n,e)=>g5(n,"name",{value:e,configurable:!0}),p5=[" ","Enter","ArrowUp","ArrowDown"],m5=[" ","Enter"],oo="Select",[Us,pc,_5]=$0(oo),[vr,gv]=Hh(oo,[_5,Rh]),mc=Rh(),[x5,Hn]=vr(oo),[y5,C5]=vr(oo);function Jh(n){const{__scopeSelect:e,children:t,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:f,disabled:d,required:g,form:h,internal_do_not_use_render:_}=n,m=mc(e),[p,y]=I.useState(null),[C,x]=I.useState(null),[w,k]=I.useState(!1),b=Vh(c),[v,E]=Fu({prop:r,defaultProp:o??!1,onChange:i,caller:oo}),[M,L]=Fu({prop:s,defaultProp:l,onChange:a,caller:oo}),H=I.useRef(null),R=I.useRef(M);I.useEffect(()=>{const Te=h?p==null?void 0:p.ownerDocument.getElementById(h):p==null?void 0:p.form;if(Te instanceof HTMLFormElement){const Se=be(()=>L(R.current),"reset");return Te.addEventListener("reset",Se),()=>Te.removeEventListener("reset",Se)}},[h,p,L]);const V=p?!!h||!!p.closest("form"):!0,[Z,G]=I.useState(new Set),z=Fh(),re=Array.from(Z).map(Te=>Te.props.value).join(";"),ee=I.useCallback(Te=>{G(Se=>new Set(Se).add(Te))},[]),ne=I.useCallback(Te=>{G(Se=>{const Je=new Set(Se);return Je.delete(Te),Je})},[]),ae={required:g,trigger:p,onTriggerChange:y,valueNode:C,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:z,value:M,onValueChange:L,open:v,onOpenChange:E,dir:b,triggerPointerDownPosRef:H,disabled:d,name:u,autoComplete:f,form:h,nativeOptions:Z,nativeSelectKey:re,isFormControl:V};return F.jsx(H0,{...m,children:F.jsx(x5,{scope:e,...ae,children:F.jsx(Us.Provider,{scope:e,children:F.jsx(y5,{scope:e,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:jh(_)?_(ae):t})})})})}be(Jh,"SelectProvider");var v5=be(n=>{const{__scopeSelect:e,children:t,...r}=n;return F.jsx(Jh,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>F.jsxs(F.Fragment,{children:[t,o?F.jsx(j5,{__scopeSelect:e}):null]})})},"Select"),b5="SelectTrigger",S5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,disabled:o=!1,...i}=e,s=mc(r),l=Hn(b5,r),a=l.disabled||o,c=Rn(t,l.onTriggerChange),u=pc(r),f=I.useRef("touch"),[d,g,h]=_c(m=>{const p=u().filter(x=>!x.disabled),y=p.find(x=>x.value===l.value),C=xc(p,m,y);C!==void 0&&l.onValueChange(C.value)}),_=be(m=>{a||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return F.jsx(k0,{asChild:!0,...s,children:F.jsx(Jt.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":yi(l.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&_(m)}),onPointerDown:at(i.onPointerDown,m=>{f.current=m.pointerType;const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(_(m),m.preventDefault())}),onKeyDown:at(i.onKeyDown,m=>{const p=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(p&&m.key===" ")&&p5.includes(m.key)&&(_(),m.preventDefault())})})})},"SelectTrigger")),w5="SelectValue",T5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,children:s,placeholder:l="",...a}=e,c=Hn(w5,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Rn(t,c.onValueNodeChange);jo(()=>{u(f)},[u,f]);const g=yi(c.value);return F.jsx(Jt.span,{...a,asChild:g?!1:a.asChild,ref:d,style:{pointerEvents:"none"},children:F.jsx(I.Fragment,{children:g?l:s},g?"placeholder":"value")})},"SelectValue")),E5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,...i}=e;return F.jsx(Jt.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})},"SelectIcon")),k5="SelectPortal",[N5,M5]=vr(k5,{forceMount:void 0}),$5=be(n=>{const{__scopeSelect:e,forceMount:t,...r}=n;return F.jsx(N5,{scope:n.__scopeSelect,forceMount:t,children:F.jsx(N0,{asChild:!0,...r})})},"SelectPortal"),sr="SelectContent",L5=I.forwardRef(be(function(e,t){const r=M5(sr,e.__scopeSelect),{forceMount:o=r.forceMount,...i}=e,s=Hn(sr,e.__scopeSelect),[l,a]=I.useState();return jo(()=>{a(new DocumentFragment)},[]),F.jsx(M0,{present:o||s.open,children:({present:c})=>c?F.jsx(I5,{...i,ref:t}):F.jsx(O5,{...i,fragment:l})})},"SelectContent")),O5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,fragment:i}=e;return i?Uo.createPortal(F.jsx(Wh,{scope:r,children:F.jsx(Us.Slot,{scope:r,children:F.jsx("div",{ref:t,children:o})})}),i):null},"SelectContentFragment")),Ft=10,[Wh,Zs]=vr(sr),A5=D0("SelectContent.RemoveScroll"),I5=I.forwardRef(be(function(e,t){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p,...y}=e,C=Hn(sr,r),[x,w]=I.useState(null),[k,b]=I.useState(null),v=Rn(t,w),[E,M]=I.useState(null),[L,H]=I.useState(null),R=pc(r),[V,Z]=I.useState(!1),G=I.useRef(!1);I.useEffect(()=>{if(x)return L0(x)},[x]),O0();const z=I.useCallback(W=>{const[ce,...Ie]=R().map(xe=>xe.ref.current),[ue]=Ie.slice(-1),de=document.activeElement;for(const xe of W)if(xe===de||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===ce&&k&&(k.scrollTop=0),xe===ue&&k&&(k.scrollTop=k.scrollHeight),xe==null||xe.focus(),document.activeElement!==de))return},[R,k]),re=I.useCallback(()=>z([E,x]),[z,E,x]);I.useEffect(()=>{V&&re()},[V,re]);const{onOpenChange:ee,triggerPointerDownPosRef:ne}=C;I.useEffect(()=>{if(x){let W={x:0,y:0};const ce=be(ue=>{var de,xe;W={x:Math.abs(Math.round(ue.pageX)-(((de=ne.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((xe=ne.current)==null?void 0:xe.y)??0))}},"handlePointerMove"),Ie=be(ue=>{W.x<=10&&W.y<=10?ue.preventDefault():ue.composedPath().includes(x)||ee(!1),document.removeEventListener("pointermove",ce),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[x,ee,ne]),I.useEffect(()=>{const W=be(()=>ee(!1),"close");return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ee]);const[ae,Te]=_c(W=>{const ce=R().filter(de=>!de.disabled),Ie=ce.find(de=>de.ref.current===document.activeElement),ue=xc(ce,W,Ie);ue&&setTimeout(()=>{var de;return(de=ue.ref.current)==null?void 0:de.focus()})}),Se=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&(M(W),ue&&(G.current=!0))},[C.value]),Je=I.useCallback(()=>x==null?void 0:x.focus(),[x]),Ye=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&H(W)},[C.value]),ie=o==="popper"?zu:P5,_e=ie===zu?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p}:{};return F.jsx(Wh,{scope:r,content:x,viewport:k,onViewportChange:b,itemRefCallback:Se,selectedItem:E,onItemLeave:Je,itemTextRefCallback:Ye,focusSelectedItem:re,selectedItemText:L,position:o,isPositioned:V,searchRef:ae,children:F.jsx(A0,{as:A5,allowPinchZoom:!0,children:F.jsx(I0,{asChild:!0,trapped:C.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:at(i,W=>{var ce;(ce=C.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:F.jsx(P0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:F.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:W=>W.preventDefault(),...y,..._e,onPlaced:()=>Z(!0),ref:v,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:at(y.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Te(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ue=R().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const de=W.target,xe=ue.indexOf(de);ue=ue.slice(xe+1)}setTimeout(()=>z(ue)),W.preventDefault()}})})})})})})},"SelectContentImpl")),P5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,onPlaced:o,...i}=e,s=Hn(sr,r),l=Zs(sr,r),[a,c]=I.useState(null),[u,f]=I.useState(null),d=Rn(t,f),g=pc(r),h=I.useRef(!1),_=I.useRef(!0),{viewport:m,selectedItem:p,selectedItemText:y,focusSelectedItem:C}=l,x=I.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&p&&y){const v=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const de=L.left-E.left,xe=M.left-de,en=v.left-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.left=Pr+"px"}else{const de=E.right-L.right,xe=window.innerWidth-M.right-de,en=window.innerWidth-v.right-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.right=Pr+"px"}const H=g(),R=window.innerHeight-Ft*2,V=m.scrollHeight,Z=window.getComputedStyle(u),G=parseInt(Z.borderTopWidth,10),z=parseInt(Z.paddingTop,10),re=parseInt(Z.borderBottomWidth,10),ee=parseInt(Z.paddingBottom,10),ne=G+z+V+ee+re,ae=Math.min(p.offsetHeight*5,ne),Te=window.getComputedStyle(m),Se=parseInt(Te.paddingTop,10),Je=parseInt(Te.paddingBottom,10),Ye=v.top+v.height/2-Ft,ie=R-Ye,_e=p.offsetHeight/2,W=p.offsetTop+_e,ce=G+z+W,Ie=ne-ce;if(ce<=Ye){const de=H.length>0&&p===H[H.length-1].ref.current;a.style.bottom="0px";const xe=u.clientHeight-m.offsetTop-m.offsetHeight,en=Math.max(ie,_e+(de?Je:0)+xe+re),tn=ce+en;a.style.height=tn+"px"}else{const de=H.length>0&&p===H[0].ref.current;a.style.top="0px";const en=Math.max(Ye,G+m.offsetTop+(de?Se:0)+_e)+Ie;a.style.height=en+"px",m.scrollTop=ce-Ye+m.offsetTop}a.style.margin=`${Ft}px 0`,a.style.minHeight=ae+"px",a.style.maxHeight=R+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,u,m,p,y,s.dir,o]);jo(()=>x(),[x]);const[w,k]=I.useState();jo(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const b=I.useCallback(v=>{v&&_.current===!0&&(x(),C==null||C(),_.current=!1)},[x,C]);return F.jsx(D5,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:F.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:F.jsx(Jt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),zu=I.forwardRef(be(function(e,t){const{__scopeSelect:r,align:o="start",collisionPadding:i=Ft,...s}=e,l=mc(r);return F.jsx(F0,{...l,...s,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[D5,F5]=vr(sr,{}),Ku="SelectViewport",R5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,nonce:o,...i}=e,s=Zs(Ku,r),l=F5(Ku,r),a=Rn(t,s.onViewportChange),c=I.useRef(0);return F.jsxs(F.Fragment,{children:[F.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),F.jsx(Us.Slot,{scope:r,children:F.jsx(Jt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:at(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const _=window.innerHeight-Ft*2,m=parseFloat(d.style.minHeight),p=parseFloat(d.style.height),y=Math.max(m,p);if(y<_){const C=y+h,x=Math.min(_,C),w=C-x;d.style.height=x+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})},"SelectViewport")),H5="SelectGroup",[pv,mv]=vr(H5),ua="SelectItem",[V5,B5]=vr(ua),z5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,value:o,disabled:i=!1,textValue:s,...l}=e,a=Hn(ua,r),c=Zs(ua,r),u=a.value===o,[f,d]=I.useState(s??""),[g,h]=I.useState(!1),_=hc(x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,o,i)}),m=Rn(t,_),p=Fh(),y=I.useRef("touch"),C=be(()=>{i||(a.onValueChange(o),a.onOpenChange(!1))},"handleSelect");return F.jsx(V5,{scope:r,value:o,disabled:i,textId:p,isSelected:u,onItemTextChange:I.useCallback(x=>{d(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:F.jsx(Us.ItemSlot,{scope:r,value:o,disabled:i,textValue:f,children:F.jsx(Jt.div,{role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:m,onFocus:at(l.onFocus,()=>h(!0)),onBlur:at(l.onBlur,()=>h(!1)),onClick:at(l.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:at(l.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:at(l.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:at(l.onPointerMove,x=>{var w;y.current=x.pointerType,i?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(l.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:at(l.onKeyDown,x=>{var k;i||x.target!==x.currentTarget||((k=c.searchRef)==null?void 0:k.current)!==""&&x.key===" "||(m5.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})},"SelectItem")),Fi="SelectItemText",K5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,...s}=e,l=Hn(Fi,r),a=Zs(Fi,r),c=B5(Fi,r),u=C5(Fi,r),[f,d]=I.useState(null),g=hc(C=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,C,c.value,c.disabled)}),h=Rn(t,d,c.onItemTextChange,g),_=f==null?void 0:f.textContent,m=I.useMemo(()=>F.jsx("option",{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=u;return jo(()=>(p(m),()=>y(m)),[p,y,m]),F.jsxs(F.Fragment,{children:[F.jsx(Jt.span,{id:c.textId,...s,ref:h}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!yi(l.value)?Uo.createPortal(s.children,l.valueNode):null]})},"SelectItemText")),J5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,...o}=e;return F.jsx(Jt.div,{"aria-hidden":!0,...o,ref:t})},"SelectSeparator")),W5="SelectBubbleInput",j5=I.forwardRef(be(function({__scopeSelect:e,...t},r){const o=Hn(W5,e),{value:i,onValueChange:s,required:l,disabled:a,name:c,autoComplete:u,form:f}=o,{nativeOptions:d,nativeSelectKey:g}=o,h=I.useRef(null),_=Rn(r,h),m=i??"",p=Kh(m),y=Array.from(d).some(C=>(C.props.value??"")==="");return I.useEffect(()=>{const C=h.current;if(!C)return;const x=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(x,"value").set;if(p!==m&&k){const b=new Event("change",{bubbles:!0});k.call(C,m),C.dispatchEvent(b)}},[p,m]),F.jsxs(Jt.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:c,autoComplete:u,disabled:a,form:f,onChange:C=>s(C.target.value),...t,style:{...R0,...t.style},ref:_,defaultValue:m,children:[yi(i)&&!y?F.jsx("option",{value:""}):null,Array.from(d)]},g)},"SelectBubbleInput"));function jh(n){return typeof n=="function"}be(jh,"isFunction");function yi(n){return n===""||n===void 0}be(yi,"shouldShowPlaceholder");function _c(n){const e=hc(n),t=I.useRef(""),r=I.useRef(0),o=I.useCallback(s=>{const l=t.current+s;e(l),be(function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))},"updateSearch")(l)},[e]),i=I.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,o,i]}be(_c,"useTypeaheadSearch");function xc(n,e,t){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Uh(n,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==t));const a=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==t?a:void 0}be(xc,"findNextItem");function Uh(n,e){return n.map((t,r)=>n[(e+r)%n.length])}be(Uh,"wrapArray");var U5=Object.defineProperty,qs=(n,e)=>U5(n,"name",{value:e,configurable:!0}),Zh="Toolbar",[Z5,_v]=Hh(Zh,[Bh,zh]),qh=Bh(),Gh=zh(),[q5,G5]=Z5(Zh),Y5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,orientation:o="horizontal",dir:i,loop:s=!0,...l}=e,a=qh(r),c=Vh(i);return F.jsx(q5,{scope:r,orientation:o,dir:c,children:F.jsx(z0,{asChild:!0,...a,orientation:o,dir:c,loop:s,children:F.jsx(Jt.div,{role:"toolbar","aria-orientation":o,dir:c,...l,ref:t})})})},"Toolbar")),Yh=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=qh(r);return F.jsx(V0,{asChild:!0,...i,focusable:!e.disabled,children:F.jsx(Jt.button,{type:"button",...o,ref:t})})},"ToolbarButton")),X5="ToolbarToggleGroup",Q5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=G5(X5,r),s=Gh(r);return F.jsx(K0,{"data-orientation":i.orientation,dir:i.dir,...s,...o,ref:t,rovingFocus:!1})},"ToolbarToggleGroup")),e2=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=Gh(r),s={__scopeToolbar:e.__scopeToolbar};return F.jsx(Yh,{asChild:!0,...s,children:F.jsx(B0,{...i,...o,ref:t})})},"ToolbarToggleItem")),t2=Y5,n2=Yh,yc=Q5,r2=e2;const o2={}.hasOwnProperty;function Xh(n,e){let t=-1,r;if(e.extensions)for(;++tr*r+j*j&&(O=E,Q=p),{cx:O,cy:Q,x01:-n,y01:-d,x11:O*(v/T-1),y11:Q*(v/T-1)}}function hn(){var l=cn,h=yn,q=S(0),w=null,v=gn,A=dn,Y=mn,a=null,z=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Z=rn(c-f),t=c>f;if(a||(a=n=z()),sy))a.moveTo(0,0);else if(Z>tn-y)a.moveTo(s*B(f),s*b(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*b(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Z,I=Z,O=Y.apply(this,arguments)/2,Q=O>y&&(w?+w.apply(this,arguments):G(u*u+s*s)),E=_(rn(s-u)/2,+q.apply(this,arguments)),p=E,x=E,e,r;if(Q>y){var j=sn(Q/u*b(O)),H=sn(Q/s*b(O));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(I-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(I=0,m=g=(f+c)/2)}var C=s*B(m),F=s*b(m),J=u*B(T),K=u*b(T);if(E>y){var L=s*B(g),M=s*b(g),U=u*B(R),V=u*b(R),D;if(Zy?x>y?(e=N(U,V,C,F,s,x,t),r=N(L,M,J,K,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+j*j&&(O=E,Q=p),{cx:O,cy:Q,x01:-n,y01:-d,x11:O*(v/T-1),y11:Q*(v/T-1)}}function hn(){var l=cn,h=yn,q=S(0),w=null,v=gn,A=dn,Y=mn,a=null,z=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Z=rn(c-f),t=c>f;if(a||(a=n=z()),sy))a.moveTo(0,0);else if(Z>tn-y)a.moveTo(s*B(f),s*b(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*b(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Z,I=Z,O=Y.apply(this,arguments)/2,Q=O>y&&(w?+w.apply(this,arguments):G(u*u+s*s)),E=_(rn(s-u)/2,+q.apply(this,arguments)),p=E,x=E,e,r;if(Q>y){var j=sn(Q/u*b(O)),H=sn(Q/s*b(O));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(I-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(I=0,m=g=(f+c)/2)}var C=s*B(m),F=s*b(m),J=u*B(T),K=u*b(T);if(E>y){var L=s*B(g),M=s*b(g),U=u*B(R),V=u*b(R),D;if(Zy?x>y?(e=N(U,V,C,F,s,x,t),r=N(L,M,J,K,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pa.lang.round(n.parse(r)[o]);export{t as c}; +import{U as a,C as n}from"../visualizations/mermaid/mermaid.core-Byx96n1y.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/veadk/webui/assets/chunks/index.es-BRzMxOGE.js b/veadk/webui/assets/chunks/index.es-BwpKNMlY.js similarity index 99% rename from veadk/webui/assets/chunks/index.es-BRzMxOGE.js rename to veadk/webui/assets/chunks/index.es-BwpKNMlY.js index 5ce90b10c..a08d2ddf3 100644 --- a/veadk/webui/assets/chunks/index.es-BRzMxOGE.js +++ b/veadk/webui/assets/chunks/index.es-BwpKNMlY.js @@ -1,4 +1,4 @@ -import{L as Ke,a8 as Do}from"../app/index-DZf0wXGZ.js";import{_ as Xa}from"./jspdf.es.min-nhrMhkEQ.js";var vt=function(a){return a&&a.Math===Math&&a},_=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),$t={},D=function(a){try{return!!a()}catch{return!0}},Pl=D,he=!Pl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Rl=D,br=!Rl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Nl=br,Ft=Function.prototype.call,Y=Nl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Lo={},ko={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,Il=Bo&&!ko.call({1:2},1);Lo.f=Il?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:ko;var Si=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},jo=br,Fo=Function.prototype,Wa=Fo.call,Ml=jo&&Fo.bind.bind(Wa,Wa),L=jo?Ml:function(a){return function(){return Wa.apply(a,arguments)}},Uo=L,_l=Uo({}.toString),Vl=Uo("".slice),Ce=function(a){return Vl(_l(a),8,-1)},Dl=L,Ll=D,kl=Ce,ea=Object,Bl=Dl("".split),Go=Ll(function(){return!ea("z").propertyIsEnumerable(0)})?function(a){return kl(a)==="String"?Bl(a,""):ea(a)}:ea,xr=function(a){return a==null},jl=xr,Fl=TypeError,ve=function(a){if(jl(a))throw new Fl("Can't call method on "+a);return a},Ul=Go,Gl=ve,wt=function(a){return Ul(Gl(a))},ta=typeof document=="object"&&document.all,k=typeof ta>"u"&&ta!==void 0?function(a){return typeof a=="function"||a===ta}:function(a){return typeof a=="function"},zl=k,ae=function(a){return typeof a=="object"?a!==null:zl(a)},ra=_,Hl=k,Yl=function(a){return Hl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Yl(ra[a]):ra[a]&&ra[a][e]},Xl=L,Tr=Xl({}.isPrototypeOf),Wl=_,pn=Wl.navigator,yn=pn&&pn.userAgent,Ct=yn?String(yn):"",zo=_,aa=Ct,mn=zo.process,bn=zo.Deno,xn=mn&&mn.versions||bn&&bn.version,Tn=xn&&xn.v8,le,cr;Tn&&(le=Tn.split("."),cr=le[0]>0&&le[0]<4?1:+(le[0]+le[1]));!cr&&aa&&(le=aa.match(/Edge\/(\d+)/),(!le||le[1]>=74)&&(le=aa.match(/Chrome\/(\d+)/),le&&(cr=+le[1])));var Ei=cr,On=Ei,ql=D,Ql=_,Kl=Ql.String,Ho=!!Object.getOwnPropertySymbols&&!ql(function(){var a=Symbol("symbol detection");return!Kl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&On&&On<41}),Zl=Ho,Yo=Zl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Jl=Fe,eh=k,th=Tr,rh=Yo,ah=Object,Xo=rh?function(a){return typeof a=="symbol"}:function(a){var e=Jl("Symbol");return eh(e)&&th(e.prototype,ah(a))},ih=String,Or=function(a){try{return ih(a)}catch{return"Object"}},nh=k,sh=Or,oh=TypeError,Ae=function(a){if(nh(a))return a;throw new oh(sh(a)+" is not a function")},uh=Ae,lh=xr,ot=function(a,e){var t=a[e];return lh(t)?void 0:uh(t)},ia=Y,na=k,sa=ae,hh=TypeError,vh=function(a,e){var t,r;if(e==="string"&&na(t=a.toString)&&!sa(r=ia(t,a))||na(t=a.valueOf)&&!sa(r=ia(t,a))||e!=="string"&&na(t=a.toString)&&!sa(r=ia(t,a)))return r;throw new hh("Can't convert object to primitive value")},Wo={exports:{}},Sn=_,fh=Object.defineProperty,$i=function(a,e){try{fh(Sn,a,{value:e,configurable:!0,writable:!0})}catch{Sn[a]=e}return e},ch=_,gh=$i,En="__core-js_shared__",$n=Wo.exports=ch[En]||gh(En,{});($n.versions||($n.versions=[])).push({version:"3.50.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wi=Wo.exports,wn=wi,dh=Object.create||Object,Ci=function(a,e){return wn[a]||(wn[a]=e||dh(null))},ph=ve,yh=Object,Sr=function(a){return yh(ph(a))},mh=L,bh=Sr,xh=mh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return xh(bh(e),t)},Th=L,Oh=0,Sh=Math.random(),Eh=Th(1.1.toString),qo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Eh(++Oh+Sh,36)},$h=_,wh=Ci,Cn=fe,Ch=qo,Ah=Ho,Ph=Yo,Ze=$h.Symbol,oa=wh("wks"),Rh=Ph?Ze.for||Ze:Ze&&Ze.withoutSetter||Ch,z=function(a){return Cn(oa,a)||(oa[a]=Ah&&Cn(Ze,a)?Ze[a]:Rh("Symbol."+a)),oa[a]},Nh=Y,An=ae,Pn=Xo,Ih=ot,Mh=vh,_h=z,Vh=TypeError,Dh=_h("toPrimitive"),Lh=function(a,e){if(!An(a)||Pn(a))return a;var t=Ih(a,Dh),r;if(t){if(e===void 0&&(e="default"),r=Nh(t,a,e),!An(r)||Pn(r))return r;throw new Vh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Mh(a,e)},kh=Lh,Bh=Xo,Qo=function(a){var e=kh(a,"string");return Bh(e)?e:e+""},jh=_,Rn=ae,qa=jh.document,Fh=Rn(qa)&&Rn(qa.createElement),Er=function(a){return Fh?qa.createElement(a):{}},Uh=he,Gh=D,zh=Er,Ko=!Uh&&!Gh(function(){return Object.defineProperty(zh("div"),"a",{get:function(){return 7}}).a!==7}),Hh=he,Yh=Y,Xh=Lo,Wh=Si,qh=wt,Qh=Qo,Kh=fe,Zh=Ko,Nn=Object.getOwnPropertyDescriptor;$t.f=Hh?Nn:function(e,t){if(e=qh(e),t=Qh(t),Zh)try{return Nn(e,t)}catch{}if(Kh(e,t))return Wh(!Yh(Xh.f,e,t),e[t])};var Te={},Jh=he,ev=D,Zo=Jh&&ev(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),tv=ae,rv=String,av=TypeError,J=function(a){if(tv(a))return a;throw new av(rv(a)+" is not an object")},iv=he,nv=Ko,sv=Zo,Ut=J,In=Qo,ov=TypeError,ua=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,la="enumerable",ha="configurable",va="writable";Te.f=iv?sv?function(e,t,r){if(Ut(e),t=In(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&va in r&&!r[va]){var i=uv(e,t);i&&i[va]&&(e[t]=r.value,r={configurable:ha in r?r[ha]:i[ha],enumerable:la in r?r[la]:i[la],writable:!1})}return ua(e,t,r)}:ua:function(e,t,r){if(Ut(e),t=In(t),Ut(r),nv)try{return ua(e,t,r)}catch{}if("get"in r||"set"in r)throw new ov("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var lv=he,hv=Te,vv=Si,At=lv?function(a,e,t){return hv.f(a,e,vv(1,t))}:function(a,e,t){return a[e]=t,a},Jo={exports:{}},Qa=he,fv=fe,eu=Function.prototype,cv=Qa&&Object.getOwnPropertyDescriptor,tu=fv(eu,"name"),gv=tu&&(function(){}).name==="something",dv=tu&&(!Qa||Qa&&cv(eu,"name").configurable),$r={PROPER:gv,CONFIGURABLE:dv},pv=L,yv=k,Ka=wi,mv=pv(Function.toString);yv(Ka.inspectSource)||(Ka.inspectSource=function(a){return mv(a)});var Ai=Ka.inspectSource,bv=_,xv=k,Mn=bv.WeakMap,Tv=xv(Mn)&&/native code/.test(String(Mn)),Ov=Ci,Sv=qo,_n=Ov("keys"),Pi=function(a){return _n[a]||(_n[a]=Sv(a))},Ri={},Ev=Tv,ru=_,$v=ae,wv=At,fa=fe,ca=wi,Cv=Pi,Av=Ri,Vn="Object already initialized",Za=ru.TypeError,Pv=ru.WeakMap,gr,Ot,dr,Rv=function(a){return dr(a)?Ot(a):gr(a,{})},Nv=function(a){return function(e){var t;if(!$v(e)||(t=Ot(e)).type!==a)throw new Za("Incompatible receiver, "+a+" required");return t}};if(Ev||ca.state){var de=ca.state||(ca.state=new Pv);de.get=de.get,de.has=de.has,de.set=de.set,gr=function(a,e){if(de.has(a))throw new Za(Vn);return e.facade=a,de.set(a,e),e},Ot=function(a){return de.get(a)||{}},dr=function(a){return de.has(a)}}else{var Ye=Cv("state");Av[Ye]=!0,gr=function(a,e){if(fa(a,Ye))throw new Za(Vn);return e.facade=a,wv(a,Ye,e),e},Ot=function(a){return fa(a,Ye)?a[Ye]:{}},dr=function(a){return fa(a,Ye)}}var wr={set:gr,get:Ot,has:dr,enforce:Rv,getterFor:Nv},Ni=L,Iv=D,Mv=k,Gt=fe,Ja=he,_v=$r.CONFIGURABLE,Vv=Ai,au=wr,Dv=au.enforce,Lv=au.get,Dn=String,or=Object.defineProperty,kv=Ni("".slice),Bv=Ni("".replace),jv=Ni([].join),Fv=Ja&&!Iv(function(){return or(function(){},"length",{value:8}).length!==8}),Uv=String(String).split("String"),Gv=Jo.exports=function(a,e,t){kv(Dn(e),0,7)==="Symbol("&&(e="["+Bv(Dn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||_v&&a.name!==e)&&(Ja?or(a,"name",{value:e,configurable:!0}):a.name=e),Fv&&t&&Gt(t,"arity")&&a.length!==t.arity&&or(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Ja&&or(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Dv(a);return Gt(r,"source")||(r.source=jv(Uv,typeof e=="string"?e:"")),a};Function.prototype.toString=Gv(function(){return Mv(this)&&Lv(this).source||Vv(this)},"toString");var iu=Jo.exports,zv=k,Hv=Te,Yv=iu,Xv=$i,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(zv(t)&&Yv(t,n,r),r.global)i?a[e]=t:Xv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Hv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Wv=Math.ceil,qv=Math.floor,Qv=Math.trunc||function(e){var t=+e;return(t>0?qv:Wv)(t)},Kv=Qv,Cr=function(a){var e=+a;return e!==e||e===0?0:Kv(e)},Zv=Cr,Jv=Math.max,ef=Math.min,tf=function(a,e){var t=Zv(a);return t<0?Jv(t+e,0):ef(t,e)},rf=Cr,af=Math.min,ut=function(a){var e=rf(a);return e>0?af(e,9007199254740991):0},nf=ut,Ii=function(a){return nf(a.length)},sf=wt,of=tf,uf=Ii,lf=function(a){return function(e,t,r){var i=sf(e),n=uf(i);if(n===0)return!a&&-1;var o=of(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},su={indexOf:lf(!1)},hf=L,ga=fe,vf=wt,ff=su.indexOf,cf=Ri,Ln=hf([].push),ou=function(a,e){var t=vf(a),r=0,i=[],n;for(n in t)!ga(cf,n)&&ga(t,n)&&Ln(i,n);for(;e.length>r;)ga(t,n=e[r++])&&(~ff(i,n)||Ln(i,n));return i},Mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gf=ou,df=Mi,pf=df.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return gf(e,pf)};var uu={};uu.f=Object.getOwnPropertySymbols;var yf=Fe,mf=L,bf=nu,xf=uu,Tf=J,Of=mf([].concat),Sf=yf("Reflect","ownKeys")||function(e){var t=bf.f(Tf(e)),r=xf.f;return r?Of(t,r(e)):t},kn=fe,Ef=Sf,$f=$t,wf=Te,Cf=function(a,e,t){for(var r=Ef(e),i=wf.f,n=$f.f,o=0;of;f++)if(v=y(a[f]),v&&ms(xs,v))return v;return new hr(!1)}l=wd(a,h)}for(g=n?a.next:l.next;!(d=Td(g,l)).done;){var T=d.value;try{v=y(T)}catch(b){if(l)bs(l,"throw",b);else throw b}if(typeof v=="object"&&v&&ms(xs,v))return v}return new hr(!1)},Pd=z,Gu=Pd("iterator"),zu=!1;try{var Rd=0,Ts={next:function(){return{done:!!Rd++}},return:function(){zu=!0}};Ts[Gu]=function(){return this},Array.from(Ts,function(){throw 2})}catch{}var Nd=function(a,e){try{if(!e&&!zu)return!1}catch{return!1}var t=!1;try{var r={};r[Gu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Id=Nr,Md=Nd,_d=Rt.CONSTRUCTOR,Hu=_d||!Md(function(a){Id.all(a).then(void 0,function(){})}),Vd=ee,Dd=Y,Ld=Ae,kd=lt,Bd=Li,jd=Uu,Fd=Hu;Vd({target:"Promise",stat:!0,forced:Fd},{all:function(e){var t=this,r=kd.f(t),i=r.resolve,n=r.reject,o=Bd(function(){var s=Ld(t.resolve),u=[],l=0,h=1;jd(e,function(f){var c=l++,v=!1;h++,Dd(s,t,f).then(function(g){v||(v=!0,u[c]=g,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Ud=ee,Gd=Rt.CONSTRUCTOR,si=Nr,zd=Fe,Hd=k,Yd=Ue,Os=si&&si.prototype;Ud({target:"Promise",proto:!0,forced:Gd,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Hd(si)){var Ss=zd("Promise").prototype.catch;Os.catch!==Ss&&Yd(Os,"catch",Ss,{unsafe:!0})}var Xd=ee,Wd=Y,qd=Ae,Qd=lt,Kd=Li,Zd=Uu,Jd=Hu;Xd({target:"Promise",stat:!0,forced:Jd},{race:function(e){var t=this,r=Qd.f(t),i=r.reject,n=Kd(function(){var o=qd(t.resolve);Zd(e,function(s){Wd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var ep=ee,tp=lt,rp=Rt.CONSTRUCTOR;ep({target:"Promise",stat:!0,forced:rp},{reject:function(e){var t=tp.f(this),r=t.reject;return r(e),t.promise}});var ap=J,ip=ae,np=lt,sp=function(a,e){if(ap(a),ip(e)&&e.constructor===a)return e;var t=np.f(a),r=t.resolve;return r(e),t.promise},op=ee,up=Fe,lp=Rt.CONSTRUCTOR,hp=sp;up("Promise");op({target:"Promise",stat:!0,forced:lp},{resolve:function(e){return hp(this,e)}});function Es(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){Es(n,r,i,o,s,"next",u)}function s(u){Es(n,r,i,o,s,"throw",u)}o(void 0)})}}var vp=cu,fp=String,pe=function(a){if(vp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fp(a)},cp=J,Yu=function(){var a=cp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Ui=D,gp=_,Gi=gp.RegExp,zi=Ui(function(){var a=Gi("a","y");return a.lastIndex=2,a.exec("abcd")!==null});zi||Ui(function(){return!Gi("a","y").sticky});var dp=zi||Ui(function(){var a=Gi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Xu={BROKEN_CARET:dp,UNSUPPORTED_Y:zi},Wu={},pp=ou,yp=Mi,mp=Object.keys||function(e){return pp(e,yp)},bp=he,xp=Zo,Tp=Te,Op=J,Sp=wt,Ep=mp;Wu.f=bp&&!xp?Object.defineProperties:function(e,t){Op(e);for(var r=Sp(t),i=Ep(t),n=i.length,o=0,s;n>o;)Tp.f(e,s=i[o++],r[s]);return e};var $p=J,wp=Wu,$s=Mi,Cp=Ri,Ap=Tu,Pp=Er,Rp=Pi,ws=">",Cs="<",oi="prototype",ui="script",qu=Rp("IE_PROTO"),wa=function(){},Qu=function(a){return Cs+ui+ws+a+Cs+"/"+ui+ws},As=function(a){a.write(Qu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Np=function(){var a=Pp("iframe"),e="java"+ui+":",t;return a.style.display="none",Ap.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Qu("document.F=Object")),t.close(),t.F},Zt,vr=function(){try{Zt=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&Zt?As(Zt):Np():As(Zt);for(var a=$s.length;a--;)delete vr[oi][$s[a]];return vr()};Cp[qu]=!0;var Hi=Object.create||function(e,t){var r;return e!==null?(wa[oi]=$p(e),r=new wa,wa[oi]=null,r[qu]=e):r=vr(),t===void 0?r:wp.f(r,t)},Ip=D,Mp=_,_p=Mp.RegExp,Vp=Ip(function(){var a=_p(".","s");return!(a.dotAll&&a.test(` +import{L as Ke,a8 as Do}from"../app/index-y89rQfXU.js";import{_ as Xa}from"./jspdf.es.min-DYdURk6H.js";var vt=function(a){return a&&a.Math===Math&&a},_=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),$t={},D=function(a){try{return!!a()}catch{return!0}},Pl=D,he=!Pl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Rl=D,br=!Rl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Nl=br,Ft=Function.prototype.call,Y=Nl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Lo={},ko={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,Il=Bo&&!ko.call({1:2},1);Lo.f=Il?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:ko;var Si=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},jo=br,Fo=Function.prototype,Wa=Fo.call,Ml=jo&&Fo.bind.bind(Wa,Wa),L=jo?Ml:function(a){return function(){return Wa.apply(a,arguments)}},Uo=L,_l=Uo({}.toString),Vl=Uo("".slice),Ce=function(a){return Vl(_l(a),8,-1)},Dl=L,Ll=D,kl=Ce,ea=Object,Bl=Dl("".split),Go=Ll(function(){return!ea("z").propertyIsEnumerable(0)})?function(a){return kl(a)==="String"?Bl(a,""):ea(a)}:ea,xr=function(a){return a==null},jl=xr,Fl=TypeError,ve=function(a){if(jl(a))throw new Fl("Can't call method on "+a);return a},Ul=Go,Gl=ve,wt=function(a){return Ul(Gl(a))},ta=typeof document=="object"&&document.all,k=typeof ta>"u"&&ta!==void 0?function(a){return typeof a=="function"||a===ta}:function(a){return typeof a=="function"},zl=k,ae=function(a){return typeof a=="object"?a!==null:zl(a)},ra=_,Hl=k,Yl=function(a){return Hl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Yl(ra[a]):ra[a]&&ra[a][e]},Xl=L,Tr=Xl({}.isPrototypeOf),Wl=_,pn=Wl.navigator,yn=pn&&pn.userAgent,Ct=yn?String(yn):"",zo=_,aa=Ct,mn=zo.process,bn=zo.Deno,xn=mn&&mn.versions||bn&&bn.version,Tn=xn&&xn.v8,le,cr;Tn&&(le=Tn.split("."),cr=le[0]>0&&le[0]<4?1:+(le[0]+le[1]));!cr&&aa&&(le=aa.match(/Edge\/(\d+)/),(!le||le[1]>=74)&&(le=aa.match(/Chrome\/(\d+)/),le&&(cr=+le[1])));var Ei=cr,On=Ei,ql=D,Ql=_,Kl=Ql.String,Ho=!!Object.getOwnPropertySymbols&&!ql(function(){var a=Symbol("symbol detection");return!Kl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&On&&On<41}),Zl=Ho,Yo=Zl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Jl=Fe,eh=k,th=Tr,rh=Yo,ah=Object,Xo=rh?function(a){return typeof a=="symbol"}:function(a){var e=Jl("Symbol");return eh(e)&&th(e.prototype,ah(a))},ih=String,Or=function(a){try{return ih(a)}catch{return"Object"}},nh=k,sh=Or,oh=TypeError,Ae=function(a){if(nh(a))return a;throw new oh(sh(a)+" is not a function")},uh=Ae,lh=xr,ot=function(a,e){var t=a[e];return lh(t)?void 0:uh(t)},ia=Y,na=k,sa=ae,hh=TypeError,vh=function(a,e){var t,r;if(e==="string"&&na(t=a.toString)&&!sa(r=ia(t,a))||na(t=a.valueOf)&&!sa(r=ia(t,a))||e!=="string"&&na(t=a.toString)&&!sa(r=ia(t,a)))return r;throw new hh("Can't convert object to primitive value")},Wo={exports:{}},Sn=_,fh=Object.defineProperty,$i=function(a,e){try{fh(Sn,a,{value:e,configurable:!0,writable:!0})}catch{Sn[a]=e}return e},ch=_,gh=$i,En="__core-js_shared__",$n=Wo.exports=ch[En]||gh(En,{});($n.versions||($n.versions=[])).push({version:"3.50.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wi=Wo.exports,wn=wi,dh=Object.create||Object,Ci=function(a,e){return wn[a]||(wn[a]=e||dh(null))},ph=ve,yh=Object,Sr=function(a){return yh(ph(a))},mh=L,bh=Sr,xh=mh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return xh(bh(e),t)},Th=L,Oh=0,Sh=Math.random(),Eh=Th(1.1.toString),qo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Eh(++Oh+Sh,36)},$h=_,wh=Ci,Cn=fe,Ch=qo,Ah=Ho,Ph=Yo,Ze=$h.Symbol,oa=wh("wks"),Rh=Ph?Ze.for||Ze:Ze&&Ze.withoutSetter||Ch,z=function(a){return Cn(oa,a)||(oa[a]=Ah&&Cn(Ze,a)?Ze[a]:Rh("Symbol."+a)),oa[a]},Nh=Y,An=ae,Pn=Xo,Ih=ot,Mh=vh,_h=z,Vh=TypeError,Dh=_h("toPrimitive"),Lh=function(a,e){if(!An(a)||Pn(a))return a;var t=Ih(a,Dh),r;if(t){if(e===void 0&&(e="default"),r=Nh(t,a,e),!An(r)||Pn(r))return r;throw new Vh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Mh(a,e)},kh=Lh,Bh=Xo,Qo=function(a){var e=kh(a,"string");return Bh(e)?e:e+""},jh=_,Rn=ae,qa=jh.document,Fh=Rn(qa)&&Rn(qa.createElement),Er=function(a){return Fh?qa.createElement(a):{}},Uh=he,Gh=D,zh=Er,Ko=!Uh&&!Gh(function(){return Object.defineProperty(zh("div"),"a",{get:function(){return 7}}).a!==7}),Hh=he,Yh=Y,Xh=Lo,Wh=Si,qh=wt,Qh=Qo,Kh=fe,Zh=Ko,Nn=Object.getOwnPropertyDescriptor;$t.f=Hh?Nn:function(e,t){if(e=qh(e),t=Qh(t),Zh)try{return Nn(e,t)}catch{}if(Kh(e,t))return Wh(!Yh(Xh.f,e,t),e[t])};var Te={},Jh=he,ev=D,Zo=Jh&&ev(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),tv=ae,rv=String,av=TypeError,J=function(a){if(tv(a))return a;throw new av(rv(a)+" is not an object")},iv=he,nv=Ko,sv=Zo,Ut=J,In=Qo,ov=TypeError,ua=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,la="enumerable",ha="configurable",va="writable";Te.f=iv?sv?function(e,t,r){if(Ut(e),t=In(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&va in r&&!r[va]){var i=uv(e,t);i&&i[va]&&(e[t]=r.value,r={configurable:ha in r?r[ha]:i[ha],enumerable:la in r?r[la]:i[la],writable:!1})}return ua(e,t,r)}:ua:function(e,t,r){if(Ut(e),t=In(t),Ut(r),nv)try{return ua(e,t,r)}catch{}if("get"in r||"set"in r)throw new ov("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var lv=he,hv=Te,vv=Si,At=lv?function(a,e,t){return hv.f(a,e,vv(1,t))}:function(a,e,t){return a[e]=t,a},Jo={exports:{}},Qa=he,fv=fe,eu=Function.prototype,cv=Qa&&Object.getOwnPropertyDescriptor,tu=fv(eu,"name"),gv=tu&&(function(){}).name==="something",dv=tu&&(!Qa||Qa&&cv(eu,"name").configurable),$r={PROPER:gv,CONFIGURABLE:dv},pv=L,yv=k,Ka=wi,mv=pv(Function.toString);yv(Ka.inspectSource)||(Ka.inspectSource=function(a){return mv(a)});var Ai=Ka.inspectSource,bv=_,xv=k,Mn=bv.WeakMap,Tv=xv(Mn)&&/native code/.test(String(Mn)),Ov=Ci,Sv=qo,_n=Ov("keys"),Pi=function(a){return _n[a]||(_n[a]=Sv(a))},Ri={},Ev=Tv,ru=_,$v=ae,wv=At,fa=fe,ca=wi,Cv=Pi,Av=Ri,Vn="Object already initialized",Za=ru.TypeError,Pv=ru.WeakMap,gr,Ot,dr,Rv=function(a){return dr(a)?Ot(a):gr(a,{})},Nv=function(a){return function(e){var t;if(!$v(e)||(t=Ot(e)).type!==a)throw new Za("Incompatible receiver, "+a+" required");return t}};if(Ev||ca.state){var de=ca.state||(ca.state=new Pv);de.get=de.get,de.has=de.has,de.set=de.set,gr=function(a,e){if(de.has(a))throw new Za(Vn);return e.facade=a,de.set(a,e),e},Ot=function(a){return de.get(a)||{}},dr=function(a){return de.has(a)}}else{var Ye=Cv("state");Av[Ye]=!0,gr=function(a,e){if(fa(a,Ye))throw new Za(Vn);return e.facade=a,wv(a,Ye,e),e},Ot=function(a){return fa(a,Ye)?a[Ye]:{}},dr=function(a){return fa(a,Ye)}}var wr={set:gr,get:Ot,has:dr,enforce:Rv,getterFor:Nv},Ni=L,Iv=D,Mv=k,Gt=fe,Ja=he,_v=$r.CONFIGURABLE,Vv=Ai,au=wr,Dv=au.enforce,Lv=au.get,Dn=String,or=Object.defineProperty,kv=Ni("".slice),Bv=Ni("".replace),jv=Ni([].join),Fv=Ja&&!Iv(function(){return or(function(){},"length",{value:8}).length!==8}),Uv=String(String).split("String"),Gv=Jo.exports=function(a,e,t){kv(Dn(e),0,7)==="Symbol("&&(e="["+Bv(Dn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||_v&&a.name!==e)&&(Ja?or(a,"name",{value:e,configurable:!0}):a.name=e),Fv&&t&&Gt(t,"arity")&&a.length!==t.arity&&or(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Ja&&or(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Dv(a);return Gt(r,"source")||(r.source=jv(Uv,typeof e=="string"?e:"")),a};Function.prototype.toString=Gv(function(){return Mv(this)&&Lv(this).source||Vv(this)},"toString");var iu=Jo.exports,zv=k,Hv=Te,Yv=iu,Xv=$i,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(zv(t)&&Yv(t,n,r),r.global)i?a[e]=t:Xv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Hv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Wv=Math.ceil,qv=Math.floor,Qv=Math.trunc||function(e){var t=+e;return(t>0?qv:Wv)(t)},Kv=Qv,Cr=function(a){var e=+a;return e!==e||e===0?0:Kv(e)},Zv=Cr,Jv=Math.max,ef=Math.min,tf=function(a,e){var t=Zv(a);return t<0?Jv(t+e,0):ef(t,e)},rf=Cr,af=Math.min,ut=function(a){var e=rf(a);return e>0?af(e,9007199254740991):0},nf=ut,Ii=function(a){return nf(a.length)},sf=wt,of=tf,uf=Ii,lf=function(a){return function(e,t,r){var i=sf(e),n=uf(i);if(n===0)return!a&&-1;var o=of(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},su={indexOf:lf(!1)},hf=L,ga=fe,vf=wt,ff=su.indexOf,cf=Ri,Ln=hf([].push),ou=function(a,e){var t=vf(a),r=0,i=[],n;for(n in t)!ga(cf,n)&&ga(t,n)&&Ln(i,n);for(;e.length>r;)ga(t,n=e[r++])&&(~ff(i,n)||Ln(i,n));return i},Mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gf=ou,df=Mi,pf=df.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return gf(e,pf)};var uu={};uu.f=Object.getOwnPropertySymbols;var yf=Fe,mf=L,bf=nu,xf=uu,Tf=J,Of=mf([].concat),Sf=yf("Reflect","ownKeys")||function(e){var t=bf.f(Tf(e)),r=xf.f;return r?Of(t,r(e)):t},kn=fe,Ef=Sf,$f=$t,wf=Te,Cf=function(a,e,t){for(var r=Ef(e),i=wf.f,n=$f.f,o=0;of;f++)if(v=y(a[f]),v&&ms(xs,v))return v;return new hr(!1)}l=wd(a,h)}for(g=n?a.next:l.next;!(d=Td(g,l)).done;){var T=d.value;try{v=y(T)}catch(b){if(l)bs(l,"throw",b);else throw b}if(typeof v=="object"&&v&&ms(xs,v))return v}return new hr(!1)},Pd=z,Gu=Pd("iterator"),zu=!1;try{var Rd=0,Ts={next:function(){return{done:!!Rd++}},return:function(){zu=!0}};Ts[Gu]=function(){return this},Array.from(Ts,function(){throw 2})}catch{}var Nd=function(a,e){try{if(!e&&!zu)return!1}catch{return!1}var t=!1;try{var r={};r[Gu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Id=Nr,Md=Nd,_d=Rt.CONSTRUCTOR,Hu=_d||!Md(function(a){Id.all(a).then(void 0,function(){})}),Vd=ee,Dd=Y,Ld=Ae,kd=lt,Bd=Li,jd=Uu,Fd=Hu;Vd({target:"Promise",stat:!0,forced:Fd},{all:function(e){var t=this,r=kd.f(t),i=r.resolve,n=r.reject,o=Bd(function(){var s=Ld(t.resolve),u=[],l=0,h=1;jd(e,function(f){var c=l++,v=!1;h++,Dd(s,t,f).then(function(g){v||(v=!0,u[c]=g,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Ud=ee,Gd=Rt.CONSTRUCTOR,si=Nr,zd=Fe,Hd=k,Yd=Ue,Os=si&&si.prototype;Ud({target:"Promise",proto:!0,forced:Gd,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Hd(si)){var Ss=zd("Promise").prototype.catch;Os.catch!==Ss&&Yd(Os,"catch",Ss,{unsafe:!0})}var Xd=ee,Wd=Y,qd=Ae,Qd=lt,Kd=Li,Zd=Uu,Jd=Hu;Xd({target:"Promise",stat:!0,forced:Jd},{race:function(e){var t=this,r=Qd.f(t),i=r.reject,n=Kd(function(){var o=qd(t.resolve);Zd(e,function(s){Wd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var ep=ee,tp=lt,rp=Rt.CONSTRUCTOR;ep({target:"Promise",stat:!0,forced:rp},{reject:function(e){var t=tp.f(this),r=t.reject;return r(e),t.promise}});var ap=J,ip=ae,np=lt,sp=function(a,e){if(ap(a),ip(e)&&e.constructor===a)return e;var t=np.f(a),r=t.resolve;return r(e),t.promise},op=ee,up=Fe,lp=Rt.CONSTRUCTOR,hp=sp;up("Promise");op({target:"Promise",stat:!0,forced:lp},{resolve:function(e){return hp(this,e)}});function Es(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){Es(n,r,i,o,s,"next",u)}function s(u){Es(n,r,i,o,s,"throw",u)}o(void 0)})}}var vp=cu,fp=String,pe=function(a){if(vp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fp(a)},cp=J,Yu=function(){var a=cp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Ui=D,gp=_,Gi=gp.RegExp,zi=Ui(function(){var a=Gi("a","y");return a.lastIndex=2,a.exec("abcd")!==null});zi||Ui(function(){return!Gi("a","y").sticky});var dp=zi||Ui(function(){var a=Gi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Xu={BROKEN_CARET:dp,UNSUPPORTED_Y:zi},Wu={},pp=ou,yp=Mi,mp=Object.keys||function(e){return pp(e,yp)},bp=he,xp=Zo,Tp=Te,Op=J,Sp=wt,Ep=mp;Wu.f=bp&&!xp?Object.defineProperties:function(e,t){Op(e);for(var r=Sp(t),i=Ep(t),n=i.length,o=0,s;n>o;)Tp.f(e,s=i[o++],r[s]);return e};var $p=J,wp=Wu,$s=Mi,Cp=Ri,Ap=Tu,Pp=Er,Rp=Pi,ws=">",Cs="<",oi="prototype",ui="script",qu=Rp("IE_PROTO"),wa=function(){},Qu=function(a){return Cs+ui+ws+a+Cs+"/"+ui+ws},As=function(a){a.write(Qu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Np=function(){var a=Pp("iframe"),e="java"+ui+":",t;return a.style.display="none",Ap.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Qu("document.F=Object")),t.close(),t.F},Zt,vr=function(){try{Zt=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&Zt?As(Zt):Np():As(Zt);for(var a=$s.length;a--;)delete vr[oi][$s[a]];return vr()};Cp[qu]=!0;var Hi=Object.create||function(e,t){var r;return e!==null?(wa[oi]=$p(e),r=new wa,wa[oi]=null,r[qu]=e):r=vr(),t===void 0?r:wp.f(r,t)},Ip=D,Mp=_,_p=Mp.RegExp,Vp=Ip(function(){var a=_p(".","s");return!(a.dotAll&&a.test(` `)&&a.flags==="s")}),Dp=D,Lp=_,kp=Lp.RegExp,Bp=Dp(function(){var a=kp("(?b)","g");return a.exec("b").groups.a!=="b"||"b".replace(a,"$c")!=="bc"}),et=Y,_r=L,jp=pe,Fp=Yu,Up=Xu,Gp=Ci,zp=Hi,Hp=wr.get,Yp=Vp,Xp=Bp,Wp=Gp("native-string-replace",String.prototype.replace),mr=RegExp.prototype.exec,li=mr,qp=_r("".charAt),Qp=_r("".indexOf),Kp=_r("".replace),Ps=_r("".slice),hi=function(){var a=/a/,e=/b*/g;return et(mr,a,"a"),et(mr,e,"a"),a.lastIndex!==0||e.lastIndex!==0}(),Ku=Up.BROKEN_CARET,vi=/()??/.exec("")[1]!==void 0,Zp=hi||vi||Ku||Yp||Xp,Rs=function(a,e){for(var t=a.groups=zp(null),r=0;r0&&qp(i,t.lastIndex-1);t.lastIndex>0&&(!t.multiline||t.multiline&&d!==` `&&d!=="\r"&&d!=="\u2028"&&d!=="\u2029")&&(c="(?: (?:"+c+"))",g=" "+g,v++),s=new RegExp("^(?:"+c+")",f)}vi&&(s=new RegExp("^"+c+"$(?!\\s)",f)),hi&&(u=t.lastIndex);var p=et(mr,h?s:t,g);return h?p?(p.input=i,p[0]=Ps(p[0],v),p.index=t.lastIndex,t.lastIndex+=p[0].length):t.lastIndex=0:hi&&p&&(t.lastIndex=t.global?p.index+p[0].length:u),vi&&p&&p.length>1&&et(Wp,p[0],s,function(){for(var y=1;y=n?a?"":void 0:(o=Vs(r,i),o<55296||o>56319||i+1===n||(s=Vs(r,i+1))<56320||s>57343?a?sy(r,i):o:a?oy(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},ly={charAt:uy(!0)},hy=ly.charAt,qi=function(a,e,t){return e+(t&&hy(a,e).length||1)},vy=_,fy=D,Ds=vy.RegExp,cy=!fy(function(){var a=!0;try{Ds(".","d")}catch{a=!1}var e={},t="",r=a?"dgimsy":"gimsy",i=function(u,l){Object.defineProperty(e,u,{get:function(){return t+=l,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};a&&(n.hasIndices="d");for(var o in n)i(o,n[o]);var s=Object.getOwnPropertyDescriptor(Ds.prototype,"flags").get.call(e);return s!==r||t!==r}),gy={correct:cy},dy=Y,py=fe,yy=Tr,Ls=gy,my=Yu,by=RegExp.prototype,Vr=Ls.correct?function(a){return a.flags}:function(a){return!Ls.correct&&yy(by,a)&&!py(a,"flags")?dy(my,a):a.flags},ks=Y,xy=J,Ty=k,Oy=Ce,Sy=Yi,Ey=TypeError,Qi=function(a,e){var t=a.exec;if(Ty(t)){var r=ks(t,a,e);return r!==null&&xy(r),r}if(Oy(a)==="RegExp")return ks(Sy,a,e);throw new Ey("RegExp#exec called on incompatible receiver")},$y=Y,wy=L,Cy=Xi,Ay=J,Py=ae,Ry=ut,Jt=pe,Ny=ve,Iy=ot,My=qi,_y=Vr,Bs=Qi,Aa=wy("".indexOf);Cy("match",function(a,e,t){return[function(i){var n=Ny(this),o=Py(i)?Iy(i,a):void 0;if(o)return $y(o,i,n);var s=Jt(n);return new RegExp(i)[a](s)},function(r){var i=Ay(this),n=Jt(r),o=t(e,i,n);if(o.done)return o.value;var s=Jt(_y(i));if(!~Aa(s,"g"))return Bs(i,n);var u=!!~Aa(s,"u")||!!~Aa(s,"v");i.lastIndex=0;for(var l=[],h=0,f;(f=Bs(i,n))!==null;){var c=Jt(f[0]);l[h]=c,c===""&&(i.lastIndex=My(n,Ry(i.lastIndex),u)),h++}return h===0?null:l}]});var Ki=L,Vy=Sr,Dy=Math.floor,Pa=Ki("".charAt),Ly=Ki("".replace),Ra=Ki("".slice),ky=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,By=/\$([$&'`]|\d{1,2})/g,jy=function(a,e,t,r,i,n){var o=t+a.length,s=r.length,u=By;return i!==void 0&&(i=Vy(i),u=ky),Ly(n,u,function(l,h){var f;switch(Pa(h,0)){case"$":return"$";case"&":return a;case"`":return Ra(e,0,t);case"'":return Ra(e,o);case"<":f=i[Ra(h,1,-1)];break;default:var c=+h;if(c===0)return l;if(c>s){var v=Dy(c/10);return v===0?l:v<=s?r[v-1]===void 0?Pa(h,1):r[v-1]+Pa(h,1):l}f=r[c-1]}return f===void 0?"":f})},Fy=xu,js=Y,Dr=L,Uy=Xi,Gy=D,zy=J,Hy=k,Yy=ae,Xy=Cr,Wy=ut,_e=pe,qy=ve,Qy=qi,Ky=ot,Zy=jy,Jy=Vr,em=Qi,tm=z,fi=tm("replace"),rm=Math.max,am=Math.min,im=Dr([].concat),Na=Dr([].push),We=Dr("".indexOf),Fs=Dr("".slice),nm=function(a){return a===void 0?a:String(a)},sm=function(){return"a".replace(/./,"$0")==="$0"}(),Us=function(){return/./[fi]?/./[fi]("a","$0")==="":!1}(),om=!Gy(function(){var a=/./;return a.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(a,"$")!=="7"});Uy("replace",function(a,e,t){var r=Us?"$":"$0";return[function(n,o){var s=qy(this),u=Yy(n)?Ky(n,fi):void 0;return u?js(u,n,s,o):js(e,_e(s),n,o)},function(i,n){var o=zy(this),s=_e(i),u=Hy(n);u||(n=_e(n));var l=_e(Jy(o));if(typeof n=="string"&&!~We(n,r)&&!~We(n,"$<")&&!~We(l,"y")){var h=t(e,o,s,n);if(h.done)return h.value}var f=!!~We(l,"g"),c;f&&(c=!!~We(l,"u")||!!~We(l,"v"),o.lastIndex=0);for(var v=[],g;g=em(o,s),!(g===null||(Na(v,g),!f));){var d=_e(g[0]);d===""&&(o.lastIndex=Qy(s,Wy(o.lastIndex),c))}for(var p="",y=0,T=0;T=y&&(p+=Fs(s,y,x)+E,y=x+b.length)}return p+Fs(s,y)}]},!om||!sm||Us);var um=ae,lm=Ce,hm=z,vm=hm("match"),fm=function(a){var e;return um(a)&&((e=a[vm])!==void 0?!!e:lm(a)==="RegExp")},cm=fm,gm=TypeError,Zi=function(a){if(cm(a))throw new gm("The method doesn't accept regular expressions");return a},dm=z,pm=dm("match"),Ji=function(a){var e=/./;try{"/./"[a](e)}catch{try{return e[pm]=!1,"/./"[a](e)}catch{}}return!1},ym=ee,mm=Rr,bm=$t.f,xm=ut,Gs=pe,Tm=Zi,Om=ve,Sm=Ji,Em=mm("".slice),$m=Math.min,Ju=Sm("startsWith"),wm=!Ju&&!!function(){var a=bm(String.prototype,"startsWith");return a&&!a.writable}();ym({target:"String",proto:!0,forced:!wm&&!Ju},{startsWith:function(e){var t=Gs(Om(this));Tm(e);var r=Gs(e),i=xm($m(arguments.length>1?arguments[1]:void 0,t.length));return Em(t,i,i+r.length)===r}});var Cm=z,Am=Hi,Pm=Te.f,ci=Cm("unscopables"),gi=Array.prototype;gi[ci]===void 0&&Pm(gi,ci,{configurable:!0,value:Am(null)});var Rm=function(a){gi[ci][a]=!0},Nm=D,Im=!Nm(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}),Mm=fe,_m=k,Vm=Sr,Dm=Pi,Lm=Im,zs=Dm("IE_PROTO"),di=Object,km=di.prototype,el=Lm?di.getPrototypeOf:function(a){var e=Vm(a);if(Mm(e,zs))return e[zs];var t=e.constructor;return _m(t)&&e instanceof t?t.prototype:e instanceof di?km:null},Bm=D,jm=k,Fm=ae,Hs=el,Um=Ue,Gm=z,pi=Gm("iterator"),tl=!1,Be,Ia,Ma;[].keys&&(Ma=[].keys(),"next"in Ma?(Ia=Hs(Hs(Ma)),Ia!==Object.prototype&&(Be=Ia)):tl=!0);var zm=!Fm(Be)||Bm(function(){var a={};return Be[pi].call(a)!==a});zm&&(Be={});jm(Be[pi])||Um(Be,pi,function(){return this});var rl={IteratorPrototype:Be,BUGGY_SAFARI_ITERATORS:tl},Hm=rl.IteratorPrototype,Ym=Hi,Xm=Si,Wm=Pr,qm=Mr,Qm=function(){return this},Km=function(a,e,t,r){var i=e+" Iterator";return a.prototype=Ym(Hm,{next:Xm(+!r,t)}),Wm(a,i,!1),qm[i]=Qm,a},Zm=ee,Jm=Y,al=$r,e0=k,t0=Km,Ys=el,Xs=vu,r0=Pr,a0=At,_a=Ue,i0=z,n0=Mr,il=rl,s0=al.PROPER,o0=al.CONFIGURABLE,Ws=il.IteratorPrototype,er=il.BUGGY_SAFARI_ITERATORS,gt=i0("iterator"),qs="keys",dt="values",Qs="entries",u0=function(){return this},l0=function(a,e,t,r,i,n,o){t0(t,e,r);var s=function(y){if(y===i&&c)return c;if(!er&&y&&y in h)return h[y];switch(y){case qs:return function(){return new t(this,y)};case dt:return function(){return new t(this,y)};case Qs:return function(){return new t(this,y)}}return function(){return new t(this)}},u=e+" Iterator",l=!1,h=a.prototype,f=h[gt]||h["@@iterator"]||i&&h[i],c=!er&&f||s(i),v=e==="Array"&&h.entries||f,g,d,p;if(v&&(g=Ys(v.call(new a)),g!==Object.prototype&&g.next&&(Ys(g)!==Ws&&(Xs?Xs(g,Ws):e0(g[gt])||_a(g,gt,u0)),r0(g,u,!0))),s0&&i===dt&&f&&f.name!==dt&&(o0?a0(h,"name",dt):(l=!0,c=function(){return Jm(f,this)})),i)if(d={values:s(dt),keys:n?c:s(qs),entries:s(Qs)},o)for(p in d)(er||l||!(p in h))&&_a(h,p,d[p]);else Zm({target:e,proto:!0,forced:er||l},d);return h[gt]!==c&&_a(h,gt,c,{name:i}),n0[e]=c,d},h0=function(a,e){return{value:a,done:e}},v0=wt,en=Rm,Ks=Mr,nl=wr,f0=Te.f,c0=l0,tr=h0,g0=he,sl="Array Iterator",d0=nl.set,p0=nl.getterFor(sl),y0=c0(Array,"Array",function(a,e){d0(this,{type:sl,target:v0(a),index:0,kind:e})},function(){var a=p0(this),e=a.target,t=a.index++;if(!e||t>=e.length)return a.target=null,tr(void 0,!0);switch(a.kind){case"keys":return tr(t,!1);case"values":return tr(e[t],!1)}return tr([t,e[t]],!1)},"values"),Zs=Ks.Arguments=Ks.Array;en("keys");en("values");en("entries");if(g0&&Zs.name!=="values")try{f0(Zs,"name",{value:"values"})}catch{}var m0={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},b0=Er,Va=b0("span").classList,Js=Va&&Va.constructor&&Va.constructor.prototype,x0=Js===Object.prototype?void 0:Js,eo=_,ol=m0,T0=x0,yt=y0,to=At,O0=Pr,S0=z,Da=S0("iterator"),La=yt.values,ul=function(a,e){if(a){if(a[Da]!==La)try{to(a,Da,La)}catch{a[Da]=La}if(O0(a,e,!0),ol[e]){for(var t in yt)if(a[t]!==yt[t])try{to(a,t,yt[t])}catch{a[t]=yt[t]}}}};for(var ka in ol)ul(eo[ka]&&eo[ka].prototype,ka);ul(T0,"DOMTokenList");function E0(a,e){if(Xa(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function $0(a){var e=E0(a,"string");return Xa(e)=="symbol"?e:e+""}function tn(a,e,t){return(e=$0(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var w0=Ae,C0=Sr,A0=Go,P0=Ii,ro=TypeError,ao="Reduce of empty array with no initial value",R0=function(a){return function(e,t,r,i){var n=C0(e),o=A0(n),s=P0(n);if(w0(t),s===0&&r<2)throw new ro(ao);var u=a?s-1:0,l=a?-1:1;if(r<2)for(;;){if(u in o){i=o[u],u+=l;break}if(u+=l,a?u<0:s<=u)throw new ro(ao)}for(;a?u>=0:s>u;u+=l)u in o&&(i=t(i,o[u],u,n));return i}},N0={left:R0(!1)},I0=D,ll=function(a,e){var t=[][a];return!!t&&I0(function(){t.call(null,e||function(){return 1},1)})},M0=ee,_0=N0.left,V0=ll,io=Ei,D0=Ar,L0=!D0&&io>79&&io<83,k0=L0||!V0("reduce");M0({target:"Array",proto:!0,forced:k0},{reduce:function(e){var t=arguments.length;return _0(this,e,t,t>1?arguments[1]:void 0)}});var B0=ee,j0=Rr,F0=$t.f,U0=ut,no=pe,G0=Zi,z0=ve,H0=Ji,Y0=j0("".slice),X0=Math.min,hl=H0("endsWith"),W0=!hl&&!!function(){var a=F0(String.prototype,"endsWith");return a&&!a.writable}();B0({target:"String",proto:!0,forced:!W0&&!hl},{endsWith:function(e){var t=no(z0(this));G0(e);var r=no(e),i=arguments.length>1?arguments[1]:void 0,n=t.length,o=i===void 0?n:X0(U0(i),n);return Y0(t,o-r.length,o)===r}});var Ba=Y,rn=L,q0=Xi,Q0=J,K0=ae,Z0=ve,J0=mu,eb=qi,tb=ut,ja=pe,rb=ot,ab=Vr,so=Qi,ib=Xu,nb=D,qe=ib.UNSUPPORTED_Y,sb=4294967295,ob=Math.min,Fa=rn([].push),Ua=rn("".slice),rr=rn("".indexOf),ub=!nb(function(){var a=/(?:)/,e=a.exec;a.exec=function(){return e.apply(this,arguments)};var t="ab".split(a);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),oo="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;q0("split",function(a,e,t){var r="0".split(void 0,0).length?function(i,n){return i===void 0&&n===0?[]:Ba(e,this,i,n)}:e;return[function(n,o){var s=Z0(this),u=K0(n)?rb(n,a):void 0;return u?Ba(u,n,s,o):Ba(r,ja(s),n,o)},function(i,n){var o=Q0(this),s=ja(i);if(!oo){var u=t(r,o,s,n,r!==e);if(u.done)return u.value}var l=J0(o,RegExp),h=ja(ab(o)),f=!!~rr(h,"u")||!!~rr(h,"v");qe?~rr(h,"g")||(h+="g"):~rr(h,"y")||(h+="y");var c=new l(qe?"^(?:"+o.source+")":o,h),v=n===void 0?sb:n>>>0;if(v===0)return[];if(s.length===0)return so(c,s)===null?[s]:[];for(var g=0,d=0,p=[];d"u"?Ke:window,ar=["moz","webkit"],rt="AnimationFrame",st=be["request"+rt],Et=be["cancel"+rt]||be["cancelRequest"+rt];for(var pt=0;!st&&pt3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),l=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),"#"+u+l+h},this.getHelpXML=function(){for(var u=new Array,l=0;l "+d.toRGB()+" -> "+d.toHex());g.appendChild(p),g.appendChild(y),v.appendChild(g)}catch{}return v}};const mi=Do(wb);var Cb=ee,Ab=Rr,Pb=su.indexOf,Rb=ll,bi=Ab([].indexOf),fl=!!bi&&1/bi([1],1,-0)<0,Nb=fl||!Rb("indexOf");Cb({target:"Array",proto:!0,forced:Nb},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return fl?bi(this,e,t)||0:Pb(this,e,t)}});var Ib=ee,Mb=L,_b=Zi,Vb=ve,fo=pe,Db=Ji,Lb=Mb("".indexOf);Ib({target:"String",proto:!0,forced:!Db("includes")},{includes:function(e){return!!~Lb(fo(Vb(this)),fo(_b(e)),arguments.length>1?arguments[1]:void 0)}});var kb=Ce,Bb=Array.isArray||function(e){return kb(e)==="Array"},jb=ee,Fb=L,Ub=Bb,Gb=Fb([].reverse),co=[1,2];jb({target:"Array",proto:!0,forced:String(co)===String(co.reverse())},{reverse:function(){return Ub(this)&&(this.length=this.length),Gb(this)}});/*! ***************************************************************************** diff --git a/veadk/webui/assets/chunks/jspdf.es.min-nhrMhkEQ.js b/veadk/webui/assets/chunks/jspdf.es.min-DYdURk6H.js similarity index 99% rename from veadk/webui/assets/chunks/jspdf.es.min-nhrMhkEQ.js rename to veadk/webui/assets/chunks/jspdf.es.min-DYdURk6H.js index 4a16c7d76..5d50bf900 100644 --- a/veadk/webui/assets/chunks/jspdf.es.min-nhrMhkEQ.js +++ b/veadk/webui/assets/chunks/jspdf.es.min-DYdURk6H.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/index.es-BRzMxOGE.js","assets/app/index-DZf0wXGZ.js","assets/styles/index-BilOAbdo.css"])))=>i.map(i=>d[i]); -var kh=Object.defineProperty;var Ph=(r,e,t)=>e in r?kh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _e=(r,e,t)=>Ph(r,typeof e!="symbol"?e+"":e,t);import{_ as go}from"../app/index-DZf0wXGZ.js";function Ae(r){"@babel/helpers - typeof";return Ae=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},Ae(r)}var Qr=Uint8Array,Or=Uint16Array,Jo=Int32Array,Ko=new Qr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xo=new Qr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ml=new Qr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(r,e){for(var t=new Or(31),i=0;i<31;++i)t[i]=e+=1<>1|(Fe&21845)<<1;Qn=(Qn&52428)>>2|(Qn&13107)<<2,Qn=(Qn&61680)>>4|(Qn&3855)<<4,To[Fe]=((Qn&65280)>>8|(Qn&255)<<8)>>1}var Ia=function(r,e,t){for(var i=r.length,s=0,a=new Or(e);s>h]=d}else for(l=new Or(i),s=0;s>15-r[s]);return l},Ii=new Qr(288);for(var Fe=0;Fe<144;++Fe)Ii[Fe]=8;for(var Fe=144;Fe<256;++Fe)Ii[Fe]=9;for(var Fe=256;Fe<280;++Fe)Ii[Fe]=7;for(var Fe=280;Fe<288;++Fe)Ii[Fe]=8;var Fs=new Qr(32);for(var Fe=0;Fe<32;++Fe)Fs[Fe]=5;var Fh=Ia(Ii,9,0),Eh=Ia(Fs,5,0),tf=function(r){return(r+7)/8|0},Oh=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new Qr(r.subarray(e,t))},Bn=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8},ka=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8,r[i+2]|=t>>16},mo=function(r,e){for(var t=[],i=0;ik&&(k=a[i].s);var p=new Or(k+1),j=Do(t[m-1],p,0);if(j>e){var i=0,O=0,M=j-e,S=1<e)O+=S-(1<>=M;O>0;){var G=a[i].s;p[G]=0&&O;--i){var D=a[i].s;p[D]==e&&(--p[D],++O)}j=e}return{t:new Qr(p),l:j}},Do=function(r,e,t){return r.s==-1?Math.max(Do(r.l,e,t+1),Do(r.r,e,t+1)):e[r.s]=t},Tl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Or(++e),i=0,s=r[0],a=1,c=function(h){t[i++]=h},l=1;l<=e;++l)if(r[l]==s&&l!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=r[l]}return{c:t.subarray(0,i),n:e}},Pa=function(r,e){for(var t=0,i=0;i>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var a=0;a4&&!tt[Ml[F-1]];--F);var z=d+5<<3,U=Pa(s,Ii)+Pa(a,Fs)+c,nt=Pa(s,k)+Pa(a,O)+c+14+3*F+Pa(ct,tt)+2*ct[16]+3*ct[17]+7*ct[18];if(h>=0&&z<=U&&z<=nt)return ef(e,m,r.subarray(h,h+d));var ot,ut,rt,ht;if(Bn(e,m,1+(nt15&&(Bn(e,m,B[K]>>5&127),m+=B[K]>>12)}}else ot=Fh,ut=Ii,rt=Eh,ht=Fs;for(var K=0;K255){var T=H>>18&31;ka(e,m,ot[T+257]),m+=ut[T+257],T>7&&(Bn(e,m,H>>23&31),m+=Ko[T]);var J=H&31;ka(e,m,rt[J]),m+=ht[J],J>3&&(ka(e,m,H>>5&8191),m+=Xo[J])}else ka(e,m,ot[H]),m+=ut[H]}return ka(e,m,ot[256]),m+ut[256]},jh=new Jo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=new Qr(0),Bh=function(r,e,t,i,s,a){var c=a.z||r.length,l=new Qr(i+c+5*(1+Math.ceil(c/7e3))+s),h=l.subarray(i,l.length-s),d=a.l,m=(a.r||0)&7;if(e){m&&(h[0]=a.r>>3);for(var _=jh[e-1],k=_>>13,p=_&8191,j=(1<7e3||tt>24576)&&(ot>423||!d)){m=Dl(r,h,0,D,it,mt,K,tt,F,R-F,m),tt=ct=K=0,F=R;for(var ut=0;ut<286;++ut)it[ut]=0;for(var ut=0;ut<30;++ut)mt[ut]=0}var rt=2,ht=0,At=p,wt=U-nt&32767;if(ot>2&&z==G(R-wt))for(var x=Math.min(k,ot)-1,B=Math.min(32767,R),T=Math.min(258,ot);wt<=B&&--At&&U!=nt;){if(r[R+rt]==r[R+rt-wt]){for(var H=0;Hrt){if(rt=H,ht=wt,H>x)break;for(var J=Math.min(wt,H-2),Z=0,ut=0;utZ&&(Z=gt,nt=at)}}}U=nt,nt=O[U],wt+=U-nt&32767}if(ht){D[tt++]=268435456|Ro[rt]<<18|Rl[ht];var _t=Ro[rt]&31,kt=Rl[ht]&31;K+=Ko[_t]+Xo[kt],++it[257+_t],++mt[kt],N=R+rt,++ct}else D[tt++]=r[R],++it[r[R]]}}for(R=Math.max(R,N);R=c&&(h[m/8|0]=d,St=c),m=ef(h,m+1,r.subarray(R,St))}a.i=c}return Oh(l,0,i+tf(m)+s)},nf=function(){var r=1,e=0;return{p:function(t){for(var i=r,s=e,a=t.length|0,c=0;c!=a;){for(var l=Math.min(c+2655,a);c>16),s=(s&65535)+15*(s>>16)}r=i,e=s},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},Mh=function(r,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new Qr(a.length+r.length);c.set(a),c.set(r,a.length),r=c,s.w=a.length}return Bh(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,i,s)},af=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Rh=function(r,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=i<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var s=nf();s.p(e.dictionary),af(r,2,s.d())}};function qo(r,e){e||(e={});var t=nf();t.p(r);var i=Mh(r,e,e.dictionary?6:2,4);return Rh(i,e),af(i,i.length-4,t.d()),i}var Th=typeof TextDecoder<"u"&&new TextDecoder,Dh=0;try{Th.decode(rf,{stream:!0}),Dh=1}catch{}function qh(r){if(Array.isArray(r))return r}function Uh(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,s,a,c,l=[],h=!0,d=!1;try{if(a=(t=t.call(r)).next,e!==0)for(;!(h=(i=a.call(t)).done)&&(l.push(i.value),l.length!==e);h=!0);}catch(m){d=!0,s=m}finally{try{if(!h&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(d)throw s}}return l}}function ql(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);ti.map(i=>d[i]); +var kh=Object.defineProperty;var Ph=(r,e,t)=>e in r?kh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _e=(r,e,t)=>Ph(r,typeof e!="symbol"?e+"":e,t);import{_ as go}from"../app/index-y89rQfXU.js";function Ae(r){"@babel/helpers - typeof";return Ae=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},Ae(r)}var Qr=Uint8Array,Or=Uint16Array,Jo=Int32Array,Ko=new Qr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xo=new Qr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ml=new Qr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(r,e){for(var t=new Or(31),i=0;i<31;++i)t[i]=e+=1<>1|(Fe&21845)<<1;Qn=(Qn&52428)>>2|(Qn&13107)<<2,Qn=(Qn&61680)>>4|(Qn&3855)<<4,To[Fe]=((Qn&65280)>>8|(Qn&255)<<8)>>1}var Ia=function(r,e,t){for(var i=r.length,s=0,a=new Or(e);s>h]=d}else for(l=new Or(i),s=0;s>15-r[s]);return l},Ii=new Qr(288);for(var Fe=0;Fe<144;++Fe)Ii[Fe]=8;for(var Fe=144;Fe<256;++Fe)Ii[Fe]=9;for(var Fe=256;Fe<280;++Fe)Ii[Fe]=7;for(var Fe=280;Fe<288;++Fe)Ii[Fe]=8;var Fs=new Qr(32);for(var Fe=0;Fe<32;++Fe)Fs[Fe]=5;var Fh=Ia(Ii,9,0),Eh=Ia(Fs,5,0),tf=function(r){return(r+7)/8|0},Oh=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new Qr(r.subarray(e,t))},Bn=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8},ka=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8,r[i+2]|=t>>16},mo=function(r,e){for(var t=[],i=0;ik&&(k=a[i].s);var p=new Or(k+1),j=Do(t[m-1],p,0);if(j>e){var i=0,O=0,M=j-e,S=1<e)O+=S-(1<>=M;O>0;){var G=a[i].s;p[G]=0&&O;--i){var D=a[i].s;p[D]==e&&(--p[D],++O)}j=e}return{t:new Qr(p),l:j}},Do=function(r,e,t){return r.s==-1?Math.max(Do(r.l,e,t+1),Do(r.r,e,t+1)):e[r.s]=t},Tl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Or(++e),i=0,s=r[0],a=1,c=function(h){t[i++]=h},l=1;l<=e;++l)if(r[l]==s&&l!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=r[l]}return{c:t.subarray(0,i),n:e}},Pa=function(r,e){for(var t=0,i=0;i>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var a=0;a4&&!tt[Ml[F-1]];--F);var z=d+5<<3,U=Pa(s,Ii)+Pa(a,Fs)+c,nt=Pa(s,k)+Pa(a,O)+c+14+3*F+Pa(ct,tt)+2*ct[16]+3*ct[17]+7*ct[18];if(h>=0&&z<=U&&z<=nt)return ef(e,m,r.subarray(h,h+d));var ot,ut,rt,ht;if(Bn(e,m,1+(nt15&&(Bn(e,m,B[K]>>5&127),m+=B[K]>>12)}}else ot=Fh,ut=Ii,rt=Eh,ht=Fs;for(var K=0;K255){var T=H>>18&31;ka(e,m,ot[T+257]),m+=ut[T+257],T>7&&(Bn(e,m,H>>23&31),m+=Ko[T]);var J=H&31;ka(e,m,rt[J]),m+=ht[J],J>3&&(ka(e,m,H>>5&8191),m+=Xo[J])}else ka(e,m,ot[H]),m+=ut[H]}return ka(e,m,ot[256]),m+ut[256]},jh=new Jo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=new Qr(0),Bh=function(r,e,t,i,s,a){var c=a.z||r.length,l=new Qr(i+c+5*(1+Math.ceil(c/7e3))+s),h=l.subarray(i,l.length-s),d=a.l,m=(a.r||0)&7;if(e){m&&(h[0]=a.r>>3);for(var _=jh[e-1],k=_>>13,p=_&8191,j=(1<7e3||tt>24576)&&(ot>423||!d)){m=Dl(r,h,0,D,it,mt,K,tt,F,R-F,m),tt=ct=K=0,F=R;for(var ut=0;ut<286;++ut)it[ut]=0;for(var ut=0;ut<30;++ut)mt[ut]=0}var rt=2,ht=0,At=p,wt=U-nt&32767;if(ot>2&&z==G(R-wt))for(var x=Math.min(k,ot)-1,B=Math.min(32767,R),T=Math.min(258,ot);wt<=B&&--At&&U!=nt;){if(r[R+rt]==r[R+rt-wt]){for(var H=0;Hrt){if(rt=H,ht=wt,H>x)break;for(var J=Math.min(wt,H-2),Z=0,ut=0;utZ&&(Z=gt,nt=at)}}}U=nt,nt=O[U],wt+=U-nt&32767}if(ht){D[tt++]=268435456|Ro[rt]<<18|Rl[ht];var _t=Ro[rt]&31,kt=Rl[ht]&31;K+=Ko[_t]+Xo[kt],++it[257+_t],++mt[kt],N=R+rt,++ct}else D[tt++]=r[R],++it[r[R]]}}for(R=Math.max(R,N);R=c&&(h[m/8|0]=d,St=c),m=ef(h,m+1,r.subarray(R,St))}a.i=c}return Oh(l,0,i+tf(m)+s)},nf=function(){var r=1,e=0;return{p:function(t){for(var i=r,s=e,a=t.length|0,c=0;c!=a;){for(var l=Math.min(c+2655,a);c>16),s=(s&65535)+15*(s>>16)}r=i,e=s},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},Mh=function(r,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new Qr(a.length+r.length);c.set(a),c.set(r,a.length),r=c,s.w=a.length}return Bh(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,i,s)},af=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Rh=function(r,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=i<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var s=nf();s.p(e.dictionary),af(r,2,s.d())}};function qo(r,e){e||(e={});var t=nf();t.p(r);var i=Mh(r,e,e.dictionary?6:2,4);return Rh(i,e),af(i,i.length-4,t.d()),i}var Th=typeof TextDecoder<"u"&&new TextDecoder,Dh=0;try{Th.decode(rf,{stream:!0}),Dh=1}catch{}function qh(r){if(Array.isArray(r))return r}function Uh(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,s,a,c,l=[],h=!0,d=!1;try{if(a=(t=t.call(r)).next,e!==0)for(;!(h=(i=a.call(t)).done)&&(l.push(i.value),l.length!==e);h=!0);}catch(m){d=!0,s=m}finally{try{if(!h&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(d)throw s}}return l}}function ql(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);t{const r=new Uint8Array(4),e=new Uint32Array(r.buffer);return!((e[0]=1)&r[0])})(),vo={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class $o{constructor(e=Gh,t={}){_e(this,"buffer");_e(this,"byteLength");_e(this,"byteOffset");_e(this,"length");_e(this,"offset");_e(this,"lastWrittenByte");_e(this,"littleEndian");_e(this,"_data");_e(this,"_mark");_e(this,"_marks");let i=!1;typeof e=="number"?e=new ArrayBuffer(e):(i=!0,this.lastWrittenByte=e.byteLength);const s=t.offset?t.offset>>>0:0,a=e.byteLength-s;let c=s;(ArrayBuffer.isView(e)||e instanceof $o)&&(e.byteLength!==e.buffer.byteLength&&(c=e.byteOffset+s),e=e.buffer),i?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=c,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,c,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const i=(this.offset+e)*2,s=new Uint8Array(i);s.set(new Uint8Array(this.buffer)),this.buffer=s.buffer,this.length=i,this.byteLength=i,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const i=vo[t].BYTES_PER_ELEMENT*e,s=this.byteOffset+this.offset,a=this.buffer.slice(s,s+i);if(this.littleEndian===Yh&&t!=="uint8"&&t!=="int8"){const l=new Uint8Array(this.buffer.slice(s,s+i));l.reverse();const h=new vo[t](l.buffer);return this.offset+=i,h.reverse(),h}const c=new vo[t](a);return this.offset+=i,c}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let i=0;ithis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Zi(r){let e=r.length;for(;--e>=0;)r[e]=0}const Jh=3,Kh=258,sf=29,Xh=256,$h=Xh+1+sf,of=30,Zh=512,Qh=new Array(($h+2)*2);Zi(Qh);const tc=new Array(of*2);Zi(tc);const ec=new Array(Zh);Zi(ec);const rc=new Array(Kh-Jh+1);Zi(rc);const nc=new Array(sf);Zi(nc);const ic=new Array(of);Zi(ic);const ac=(r,e,t,i)=>{let s=r&65535|0,a=r>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do s=s+e[i++]|0,a=a+s|0;while(--c);s%=65521,a%=65521}return s|a<<16|0};var Uo=ac;const sc=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var i=0;i<8;i++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},oc=new Uint32Array(sc()),lc=(r,e,t,i)=>{const s=oc,a=i+t;r^=-1;for(let c=i;c>>8^s[(r^e[c])&255];return r^-1};var cn=lc,zo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},lf={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const uc=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var fc=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)uc(t,i)&&(r[i]=t[i])}}return r},hc=r=>{let e=0;for(let i=0,s=r.length;i=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Ba[254]=Ba[255]=1;var cc=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,i,s,a,c=r.length,l=0;for(s=0;s>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e};const dc=(r,e)=>{if(e<65534&&r.subarray&&ff)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let i=0;i{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let i,s;const a=new Array(t*2);for(s=0,i=0;i4){a[s++]=65533,i+=l-1;continue}for(c&=l===2?31:l===3?15:7;l>1&&i1){a[s++]=65533;continue}c<65536?a[s++]=c:(c-=65536,a[s++]=55296|c>>10&1023,a[s++]=56320|c&1023)}return dc(a,s)},gc=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Ba[r[t]]>e?t:e},Ho={string2buf:cc,buf2string:pc,utf8border:gc};function mc(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var vc=mc;const ys=16209,bc=16191;var wc=function(e,t){let i,s,a,c,l,h,d,m,_,k,p,j,O,M,S,V,G,D,it,mt,ct,K,R,tt;const N=e.state;i=e.next_in,R=e.input,s=i+(e.avail_in-5),a=e.next_out,tt=e.output,c=a-(t-e.avail_out),l=a+(e.avail_out-257),h=N.dmax,d=N.wsize,m=N.whave,_=N.wnext,k=N.window,p=N.hold,j=N.bits,O=N.lencode,M=N.distcode,S=(1<>>24,p>>>=D,j-=D,D=G>>>16&255,D===0)tt[a++]=G&65535;else if(D&16){it=G&65535,D&=15,D&&(j>>=D,j-=D),j<15&&(p+=R[i++]<>>24,p>>>=D,j-=D,D=G>>>16&255,D&16){if(mt=G&65535,D&=15,jh){e.msg="invalid distance too far back",N.mode=ys;break t}if(p>>>=D,j-=D,D=a-c,mt>D){if(D=mt-D,D>m&&N.sane){e.msg="invalid distance too far back",N.mode=ys;break t}if(ct=0,K=k,_===0){if(ct+=d-D,D2;)tt[a++]=K[ct++],tt[a++]=K[ct++],tt[a++]=K[ct++],it-=3;it&&(tt[a++]=K[ct++],it>1&&(tt[a++]=K[ct++]))}else{ct=a-mt;do tt[a++]=tt[ct++],tt[a++]=tt[ct++],tt[a++]=tt[ct++],it-=3;while(it>2);it&&(tt[a++]=tt[ct++],it>1&&(tt[a++]=tt[ct++]))}}else if(D&64){e.msg="invalid distance code",N.mode=ys;break t}else{G=M[(G&65535)+(p&(1<>3,i-=it,j-=it<<3,p&=(1<{const h=l.bits;let d=0,m=0,_=0,k=0,p=0,j=0,O=0,M=0,S=0,V=0,G,D,it,mt,ct,K=null,R;const tt=new Uint16Array(Gi+1),N=new Uint16Array(Gi+1);let F=null,z,U,nt;for(d=0;d<=Gi;d++)tt[d]=0;for(m=0;m=1&&tt[k]===0;k--);if(p>k&&(p=k),k===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(_=1;_0&&(r===Vl||k!==1))return-1;for(N[1]=0,d=1;dHl||r===Gl&&S>Wl)return 1;for(;;){z=d-O,c[m]+1=R?(U=F[c[m]-R],nt=K[c[m]-R]):(U=96,nt=0),G=1<>O)+D]=z<<24|U<<16|nt|0;while(D!==0);for(G=1<>=1;if(G!==0?(V&=G-1,V+=G):V=0,m++,--tt[d]===0){if(d===k)break;d=e[t+c[m]]}if(d>p&&(V&mt)!==it){for(O===0&&(O=p),ct+=_,j=d-O,M=1<Hl||r===Gl&&S>Wl)return 1;it=V&mt,s[it]=p<<24|j<<16|ct-a|0}}return V!==0&&(s[ct+V]=d-O<<24|64<<16|0),l.bits=p,0};var Ca=Nc;const Lc=0,hf=1,cf=2,{Z_FINISH:Yl,Z_BLOCK:Sc,Z_TREES:xs,Z_OK:Ci,Z_STREAM_END:kc,Z_NEED_DICT:Pc,Z_STREAM_ERROR:Hr,Z_DATA_ERROR:df,Z_MEM_ERROR:pf,Z_BUF_ERROR:Ic,Z_DEFLATED:Jl}=lf,js=16180,Kl=16181,Xl=16182,$l=16183,Zl=16184,Ql=16185,tu=16186,eu=16187,ru=16188,nu=16189,Es=16190,Mn=16191,wo=16192,iu=16193,yo=16194,au=16195,su=16196,ou=16197,lu=16198,_s=16199,As=16200,uu=16201,fu=16202,hu=16203,cu=16204,du=16205,xo=16206,pu=16207,gu=16208,je=16209,gf=16210,mf=16211,Cc=852,Fc=592,Ec=15,Oc=Ec,mu=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function jc(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fi=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.modemf?1:0},vf=r=>{if(Fi(r))return Hr;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=js,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Cc),e.distcode=e.distdyn=new Int32Array(Fc),e.sane=1,e.back=-1,Ci},bf=r=>{if(Fi(r))return Hr;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,vf(r)},wf=(r,e)=>{let t;if(Fi(r))return Hr;const i=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Hr:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,bf(r))},yf=(r,e)=>{if(!r)return Hr;const t=new jc;r.state=t,t.strm=r,t.window=null,t.mode=js;const i=wf(r,e);return i!==Ci&&(r.state=null),i},Bc=r=>yf(r,Oc);let vu=!0,_o,Ao;const Mc=r=>{if(vu){_o=new Int32Array(512),Ao=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Ca(hf,r.lens,0,288,_o,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Ca(cf,r.lens,0,32,Ao,0,r.work,{bits:5}),vu=!1}r.lencode=_o,r.lenbits=9,r.distcode=Ao,r.distbits=5},xf=(r,e,t,i)=>{let s;const a=r.state;return a.window===null&&(a.window=new Uint8Array(1<=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(e.subarray(t-i,t-i+s),a.wnext),i-=s,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,s,a,c,l,h,d,m,_,k,p,j,O,M=0,S,V,G,D,it,mt,ct,K;const R=new Uint8Array(4);let tt,N;const F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fi(r)||!r.output||!r.input&&r.avail_in!==0)return Hr;t=r.state,t.mode===Mn&&(t.mode=wo),c=r.next_out,s=r.output,h=r.avail_out,a=r.next_in,i=r.input,l=r.avail_in,d=t.hold,m=t.bits,_=l,k=h,K=Ci;t:for(;;)switch(t.mode){case js:if(t.wrap===0){t.mode=wo;break}for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=cn(t.check,R,2,0),d=0,m=0,t.mode=Kl;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){r.msg="incorrect header check",t.mode=je;break}if((d&15)!==Jl){r.msg="unknown compression method",t.mode=je;break}if(d>>>=4,m-=4,ct=(d&15)+8,t.wbits===0&&(t.wbits=ct),ct>15||ct>t.wbits){r.msg="invalid window size",t.mode=je;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0,t.mode=Xl;case Xl:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>8&255,R[2]=d>>>16&255,R[3]=d>>>24&255,t.check=cn(t.check,R,4,0)),d=0,m=0,t.mode=$l;case $l:for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>8),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0,t.mode=Zl;case Zl:if(t.flags&1024){for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0}else t.head&&(t.head.extra=null);t.mode=Ql;case Ql:if(t.flags&1024&&(p=t.length,p>l&&(p=l),p&&(t.head&&(ct=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+p),ct)),t.flags&512&&t.wrap&4&&(t.check=cn(t.check,i,p,a)),l-=p,a+=p,t.length-=p),t.length))break t;t.length=0,t.mode=tu;case tu:if(t.flags&2048){if(l===0)break t;p=0;do ct=i[a+p++],t.head&&ct&&t.length<65536&&(t.head.name+=String.fromCharCode(ct));while(ct&&p>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=Mn;break;case nu:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>=m&7,m-=m&7,t.mode=xo;break}for(;m<3;){if(l===0)break t;l--,d+=i[a++]<>>=1,m-=1,d&3){case 0:t.mode=iu;break;case 1:if(Mc(t),t.mode=_s,e===xs){d>>>=2,m-=2;break t}break;case 2:t.mode=su;break;case 3:r.msg="invalid block type",t.mode=je}d>>>=2,m-=2;break;case iu:for(d>>>=m&7,m-=m&7;m<32;){if(l===0)break t;l--,d+=i[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=je;break}if(t.length=d&65535,d=0,m=0,t.mode=yo,e===xs)break t;case yo:t.mode=au;case au:if(p=t.length,p){if(p>l&&(p=l),p>h&&(p=h),p===0)break t;s.set(i.subarray(a,a+p),c),l-=p,a+=p,h-=p,c+=p,t.length-=p;break}t.mode=Mn;break;case su:for(;m<14;){if(l===0)break t;l--,d+=i[a++]<>>=5,m-=5,t.ndist=(d&31)+1,d>>>=5,m-=5,t.ncode=(d&15)+4,d>>>=4,m-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=je;break}t.have=0,t.mode=ou;case ou:for(;t.have>>=3,m-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,tt={bits:t.lenbits},K=Ca(Lc,t.lens,0,19,t.lencode,0,t.work,tt),t.lenbits=tt.bits,K){r.msg="invalid code lengths set",t.mode=je;break}t.have=0,t.mode=lu;case lu:for(;t.have>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=S,m-=S,t.lens[t.have++]=G;else{if(G===16){for(N=S+2;m>>=S,m-=S,t.have===0){r.msg="invalid bit length repeat",t.mode=je;break}ct=t.lens[t.have-1],p=3+(d&3),d>>>=2,m-=2}else if(G===17){for(N=S+3;m>>=S,m-=S,ct=0,p=3+(d&7),d>>>=3,m-=3}else{for(N=S+7;m>>=S,m-=S,ct=0,p=11+(d&127),d>>>=7,m-=7}if(t.have+p>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=je;break}for(;p--;)t.lens[t.have++]=ct}}if(t.mode===je)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=je;break}if(t.lenbits=9,tt={bits:t.lenbits},K=Ca(hf,t.lens,0,t.nlen,t.lencode,0,t.work,tt),t.lenbits=tt.bits,K){r.msg="invalid literal/lengths set",t.mode=je;break}if(t.distbits=6,t.distcode=t.distdyn,tt={bits:t.distbits},K=Ca(cf,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,tt),t.distbits=tt.bits,K){r.msg="invalid distances set",t.mode=je;break}if(t.mode=_s,e===xs)break t;case _s:t.mode=As;case As:if(l>=6&&h>=258){r.next_out=c,r.avail_out=h,r.next_in=a,r.avail_in=l,t.hold=d,t.bits=m,wc(r,k),c=r.next_out,s=r.output,h=r.avail_out,a=r.next_in,i=r.input,l=r.avail_in,d=t.hold,m=t.bits,t.mode===Mn&&(t.back=-1);break}for(t.back=0;M=t.lencode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>D)],S=M>>>24,V=M>>>16&255,G=M&65535,!(D+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=D,m-=D,t.back+=D}if(d>>>=S,m-=S,t.back+=S,t.length=G,V===0){t.mode=du;break}if(V&32){t.back=-1,t.mode=Mn;break}if(V&64){r.msg="invalid literal/length code",t.mode=je;break}t.extra=V&15,t.mode=uu;case uu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=fu;case fu:for(;M=t.distcode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>D)],S=M>>>24,V=M>>>16&255,G=M&65535,!(D+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=D,m-=D,t.back+=D}if(d>>>=S,m-=S,t.back+=S,V&64){r.msg="invalid distance code",t.mode=je;break}t.offset=G,t.extra=V&15,t.mode=hu;case hu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=je;break}t.mode=cu;case cu:if(h===0)break t;if(p=k-h,t.offset>p){if(p=t.offset-p,p>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=je;break}p>t.wnext?(p-=t.wnext,j=t.wsize-p):j=t.wnext-p,p>t.length&&(p=t.length),O=t.window}else O=s,j=c-t.offset,p=t.length;p>h&&(p=h),h-=p,t.length-=p;do s[c++]=O[j++];while(--p);t.length===0&&(t.mode=As);break;case du:if(h===0)break t;s[c++]=t.length,h--,t.mode=As;break;case xo:if(t.wrap){for(;m<32;){if(l===0)break t;l--,d|=i[a++]<{if(Fi(r))return Hr;let e=r.state;return e.window&&(e.window=null),r.state=null,Ci},Dc=(r,e)=>{if(Fi(r))return Hr;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,Ci):Hr},qc=(r,e)=>{const t=e.length;let i,s,a;return Fi(r)||(i=r.state,i.wrap!==0&&i.mode!==Es)?Hr:i.mode===Es&&(s=1,s=Uo(s,e,t,0),s!==i.check)?df:(a=xf(r,e,t,t),a?(i.mode=gf,pf):(i.havedict=1,Ci))};var Uc=bf,zc=wf,Hc=vf,Wc=Bc,Vc=yf,Gc=Rc,Yc=Tc,Jc=Dc,Kc=qc,Xc="pako inflate (from Nodeca project)",pn={inflateReset:Uc,inflateReset2:zc,inflateResetKeep:Hc,inflateInit:Wc,inflateInit2:Vc,inflate:Gc,inflateEnd:Yc,inflateGetHeader:Jc,inflateSetDictionary:Kc,inflateInfo:Xc};function $c(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Zc=$c;const _f=Object.prototype.toString,{Z_NO_FLUSH:Qc,Z_FINISH:bu,Z_OK:$i,Z_STREAM_END:No,Z_NEED_DICT:Lo,Z_STREAM_ERROR:t1,Z_DATA_ERROR:wu,Z_MEM_ERROR:e1,Z_BUF_ERROR:yu}=lf,r1={chunkSize:1024*64,windowBits:15,to:""};function Ra(r){this.options=uf.assign({},r1,r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vc,this.strm.avail_out=0;let t=pn.inflateInit2(this.strm,e.windowBits);if(t!==$i)throw new Error(zo[t]);if(this.header=new Zc,pn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ho.string2buf(e.dictionary):_f.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=pn.inflateSetDictionary(this.strm,e.dictionary),t!==$i)))throw new Error(zo[t])}Ra.prototype.push=function(r,e){const t=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,c,l;if(this.ended)return!1;for(e===~~e?c=e:c=e===!0?bu:Qc,_f.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=pn.inflate(t,c),a===Lo&&s&&(a=pn.inflateSetDictionary(t,s),a===$i?a=pn.inflate(t,c):a===wu&&(a=Lo));t.avail_in>0&&a===No&&t.state.wrap&2&&t.state.flags!==0&&t.input[t.next_in]!==0;)pn.inflateReset(t),a=pn.inflate(t,c);switch(a){case t1:case wu:case Lo:case e1:return this.onEnd(a),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||a===No||c>0))if(this.options.to==="string"){let h=Ho.utf8border(t.output,t.next_out),d=t.next_out-h,m=Ho.buf2string(t.output,h);t.next_out=d,t.avail_out=i-d,d&&t.output.set(t.output.subarray(h,h+d),0),this.onData(m)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out)),t.avail_out=0,t.next_out=0;if(!((a===$i||a===yu)&&l===0)){if(a===No)return a=pn.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0){if(c===bu)return a=pn.inflateEnd(this.strm),this.onEnd(a===$i?yu:a),this.ended=!0,!1;break}}}return!0};Ra.prototype.onData=function(r){this.chunks.push(r)};Ra.prototype.onEnd=function(r){r===$i&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=uf.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function n1(r,e){const t=new Ra(e);if(t.push(r,!0),t.err)throw t.msg||zo[t.err];return t.result}var i1=Ra,a1=n1,s1={Inflate:i1,inflate:a1};const{Inflate:o1,inflate:l1}=s1;var xu=o1,u1=l1;const Af=[];for(let r=0;r<256;r++){let e=r;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;Af[r]=e}const _u=4294967295;function f1(r,e,t){let i=r;for(let s=0;s>>8;return i}function h1(r,e){return(f1(_u,r,e)^_u)>>>0}function Au(r,e,t){const i=r.readUint32(),s=h1(new Uint8Array(r.buffer,r.byteOffset+r.offset-e-4,e),e);if(s!==i)throw new Error(`CRC mismatch for chunk ${t}. Expected ${i}, found ${s}`)}function Nf(r,e,t){for(let i=0;i>1)&255}else{for(;a>1)&255;for(;a>1)&255}}function Pf(r,e,t,i,s){let a=0;if(t.length===0){for(;a=t||mt>=i))for(let ct=0;ct>8&255}const w1=new Uint16Array([255]),y1=new Uint8Array(w1.buffer),x1=y1[0]===255,_1=new Uint8Array(0);function Nu(r){const{data:e,width:t,height:i,channels:s,depth:a}=r,c=Math.ceil(a/8)*s,l=Math.ceil(a/8*s*t),h=new Uint8Array(i*l);let d=_1,m=0,_,k;for(let p=0;p>8&255}const Is=Uint8Array.of(137,80,78,71,13,10,26,10);function Lu(r){if(!N1(r.readBytes(Is.length)))throw new Error("wrong PNG signature")}function N1(r){if(r.length79)throw new Error("keyword length must be between 1 and 79")}const P1=/^[\u0000-\u00FF]*$/;function I1(r){if(!P1.test(r))throw new Error("invalid latin1 text")}function C1(r,e,t){const i=Cf(e);r[i]=F1(e,t-i.length-1)}function Cf(r){for(r.mark();r.readByte()!==S1;);const e=r.offset;r.reset();const t=If.decode(r.readBytes(e-r.offset-1));return r.skip(1),k1(t),t}function F1(r,e){return If.decode(r.readBytes(e))}const Er={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},So={UNKNOWN:-1,DEFLATE:0},Su={UNKNOWN:-1,ADAPTIVE:0},ko={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Ns={NONE:0,BACKGROUND:1,PREVIOUS:2},Po={SOURCE:0,OVER:1};class E1 extends $o{constructor(t,i={}){super(t);_e(this,"_checkCrc");_e(this,"_inflator");_e(this,"_png");_e(this,"_apng");_e(this,"_end");_e(this,"_hasPalette");_e(this,"_palette");_e(this,"_hasTransparency");_e(this,"_transparency");_e(this,"_compressionMethod");_e(this,"_filterMethod");_e(this,"_interlaceMethod");_e(this,"_colorType");_e(this,"_isAnimated");_e(this,"_numberOfFrames");_e(this,"_numberOfPlays");_e(this,"_frames");_e(this,"_writingDataChunks");const{checkCrc:s=!1}=i;this._checkCrc=s,this._inflator=new xu,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=So.UNKNOWN,this._filterMethod=Su.UNKNOWN,this._interlaceMethod=ko.UNKNOWN,this._colorType=Er.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Lu(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeChunk(t,i)}return this.decodeImage(),this._png}decodeApng(){for(Lu(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeApngChunk(t,i)}return this.decodeApngImage(),this._apng}decodeChunk(t,i){const s=this.offset;switch(i){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case L1:C1(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?Au(this,t+4,i):this.skip(4)}decodeApngChunk(t,i){const s=this.offset;switch(i!=="fdAT"&&i!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),i){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,i),this.offset=s+t;break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?Au(this,t+4,i):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=O1(this.readUint8());const i=this.readUint8();this._colorType=i;let s;switch(i){case Er.GREYSCALE:s=1;break;case Er.TRUECOLOUR:s=3;break;case Er.INDEXED_COLOUR:s=1;break;case Er.GREYSCALE_ALPHA:s=2;break;case Er.TRUECOLOUR_ALPHA:s=4;break;case Er.UNKNOWN:default:throw new Error(`Unknown color type: ${i}`)}if(this._png.channels=s,this._compressionMethod=this.readUint8(),this._compressionMethod!==So.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const i=t/3;this._hasPalette=!0;const s=[];this._palette=s;for(let a=0;athis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let i=0;ithis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let i=0;for(;i{const h=((c+i.yOffset)*this._png.width+i.xOffset+l)*this._png.channels,d=(c*i.width+l)*this._png.channels;return{index:h,frameIndex:d}};switch(i.blendOp){case Po.SOURCE:for(let c=0;c=200&&e.status<=299}function Ls(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(e)}}var Ai=Jt.saveAs||((typeof window>"u"?"undefined":Ae(window))!=="object"||window!==Jt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(r,e,t){var i=Jt.URL||Jt.webkitURL,s=document.createElement("a");e=e||r.name||"download",s.download=e,s.rel="noopener",typeof r=="string"?(s.href=r,s.origin!==location.origin?Pu(s.href)?Co(r,e,t):Ls(s,s.target="_blank"):Ls(s)):(s.href=i.createObjectURL(r),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Ls(s)},0))}:"msSaveOrOpenBlob"in navigator?function(r,e,t){if(e=e||r.name||"download",typeof r=="string")if(Pu(r))Co(r,e,t);else{var i=document.createElement("a");i.href=r,i.target="_blank",setTimeout(function(){Ls(i)})}else navigator.msSaveOrOpenBlob(function(s,a){return a===void 0?a={autoBom:!1}:Ae(a)!=="object"&&(Se.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}(r,t),e)}:function(r,e,t,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),typeof r=="string")return Co(r,e,t);var s=r.type==="application/octet-stream",a=/constructor/i.test(Jt.HTMLElement)||Jt.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&a)&&(typeof FileReader>"u"?"undefined":Ae(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var m=l.result;m=c?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=m:location=m,i=null},l.readAsDataURL(r)}else{var h=Jt.URL||Jt.webkitURL,d=h.createObjectURL(r);i?i.location=d:location.href=d,i=null,setTimeout(function(){h.revokeObjectURL(d)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov @@ -114,7 +114,7 @@ T* `):u.join(` Tj endobj\r `},t.outline.count_r=function(i,s){for(var a=0;a1){U=!0,ot=void 0;var J=R*tt;ut=new Uint8Array(J);for(var Z=new DataView(N.buffer),at=0;at=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s>7-l&1];this.data[c+4*l]=h.blue,this.data[c+4*l+1]=h.green,this.data[c+4*l+2]=h.red,this.data[c+4*l+3]=255}t!==0&&(this.pos+=4-t)}},Zr.prototype.bit4=function(){for(var r=Math.ceil(this.width/2),e=r%4,t=this.height-1;t>=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>4,h=15&a,d=this.palette[l];if(this.data[c]=d.blue,this.data[c+1]=d.green,this.data[c+2]=d.red,this.data[c+3]=255,2*s+1>=this.width)break;d=this.palette[h],this.data[c+4]=d.blue,this.data[c+4+1]=d.green,this.data[c+4+2]=d.red,this.data[c+4+3]=255}e!==0&&(this.pos+=4-e)}},Zr.prototype.bit8=function(){for(var r=this.width%4,e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,i=0;i=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>5&e)/e*255|0,h=(a>>10&e)/e*255|0,d=a>>15?255:0,m=i*this.width*4+4*s;this.data[m]=h,this.data[m+1]=l,this.data[m+2]=c,this.data[m+3]=d}this.pos+=r}},Zr.prototype.bit16=function(){for(var r=this.width%3,e=parseInt("11111",2),t=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var s=this.bottom_up?i:this.height-1-i,a=0;a>5&t)/t*255|0,d=(c>>11)/e*255|0,m=s*this.width*4+4*a;this.data[m]=d,this.data[m+1]=h,this.data[m+2]=l,this.data[m+3]=255}this.pos+=r}},Zr.prototype.bit24=function(){for(var r=this.height-1;r>=0;r--){for(var e=this.bottom_up?r:this.height-1-r,t=0;t=0;r--)for(var e=this.bottom_up?r:this.height-1-r,t=0;ti&&(s.push(r.slice(h,a)),l=0,h=a),l+=e[a],a++;return h!==a&&s.push(r.slice(h,a)),s},zu=function(r,e,t){t||(t={});var i,s,a,c,l,h,d,m=[],_=[m],k=t.textIndent||0,p=0,j=0,O=r.split(" "),M=Ps.apply(this,[" ",t])[0];if(h=t.lineIndent===-1?O[0].length+2:t.lineIndent||0){var S=Array(h).join(" "),V=[];O.map(function(D){(D=D.split(/\s*\n/)).length>1?V=V.concat(D.map(function(it,mt){return(mt&&it.length?` `:"")+it})):V.push(D[0])}),O=V,h=qu.apply(this,[S,t])}for(a=0,c=O.length;ae||G){if(j>e){for(l=Uu.apply(this,[i,s,e-(k+p),e]),m.push(l.shift()),m=[l.pop()];l.length;)_.push([l.shift()]);j=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(D,it){return D+it},0)}else m=[i];_.push(m),k=j+h,p=M}else m.push(i),k+=p+j,p=M}return d=h?function(D,it){return(it?S:"")+D.join(" ")}:function(D){return D.join(" ")},_.map(d)},Ji.splitTextToSize=function(r,e,t){var i,s=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var _=this.internal.getFont(m.fontName,m.fontStyle),k="Unicode";return _.metadata[k]?{widths:_.metadata[k].widths||{0:1},kerning:_.metadata[k].kerning||{}}:{font:_.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);i=Array.isArray(r)?r:String(r).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/s;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=t.lineIndent;var l,h,d=[];for(l=0,h=i.length;limport("./index.es-BRzMxOGE.js"),__vite__mapDeps([0,1,2]))).catch(function(k){return Promise.reject(new Error("Could not load canvg: "+k))}).then(function(k){return k.default?k.default:k}).then(function(k){return k.fromString(d,r,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(k){return k.render(m)}).then(function(){_.addImage(h.toDataURL("image/jpeg",1),e,t,i,s,c,l)})},Mt.API.putTotalPages=function(r){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s1){for(m=0;me||G){if(j>e){for(l=Uu.apply(this,[i,s,e-(k+p),e]),m.push(l.shift()),m=[l.pop()];l.length;)_.push([l.shift()]);j=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(D,it){return D+it},0)}else m=[i];_.push(m),k=j+h,p=M}else m.push(i),k+=p+j,p=M}return d=h?function(D,it){return(it?S:"")+D.join(" ")}:function(D){return D.join(" ")},_.map(d)},Ji.splitTextToSize=function(r,e,t){var i,s=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var _=this.internal.getFont(m.fontName,m.fontStyle),k="Unicode";return _.metadata[k]?{widths:_.metadata[k].widths||{0:1},kerning:_.metadata[k].kerning||{}}:{font:_.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);i=Array.isArray(r)?r:String(r).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/s;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=t.lineIndent;var l,h,d=[];for(l=0,h=i.length;limport("./index.es-BwpKNMlY.js"),__vite__mapDeps([0,1,2]))).catch(function(k){return Promise.reject(new Error("Could not load canvg: "+k))}).then(function(k){return k.default?k.default:k}).then(function(k){return k.fromString(d,r,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(k){return k.render(m)}).then(function(){_.addImage(h.toDataURL("image/jpeg",1),e,t,i,s,c,l)})},Mt.API.putTotalPages=function(r){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s1){for(m=0;mr?1:n>=r?0:NaN}function z(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function w(n){let r,i,t;n.length!==2?(r=g,i=(u,o)=>g(n(u),o),t=(u,o)=>n(u)-o):(r=n===g||n===z?n:I,i=n,t=n);function f(u,o,e=0,m=u.length){if(e>>1;i(u[l],o)<0?e=l+1:m=l}while(e>>1;i(u[l],o)<=0?e=l+1:m=l}while(ee&&t(u[l-1],o)>-t(u[l],o)?l-1:l}return{left:f,center:a,right:c}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=w(g),j=$.right;w(P).center;const x=Math.sqrt(50),B=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,i){const t=(r-n)/Math.max(0,i),f=Math.floor(Math.log10(t)),c=t/Math.pow(10,f),a=c>=x?10:c>=B?5:c>=C?2:1;let u,o,e;return f<0?(e=Math.pow(10,-f)/a,u=Math.round(n*e),o=Math.round(r*e),u/er&&--o,e=-e):(e=Math.pow(10,f)*a,u=Math.round(n/e),o=Math.round(r/e),u*er&&--o),o0))return[];if(n===r)return[n];const t=r=f))return[];const u=c-f+1,o=new Array(u);if(t)if(a<0)for(let e=0;er&&(i=n,n=r,r=i),function(t){return Math.max(n,Math.min(r,t))}}function Q(n,r,i){var t=n[0],f=n[1],c=r[0],a=r[1];return f2?T:Q,o=e=null,l}function l(h){return h==null||isNaN(h=+h)?c:(o||(o=u(n.map(t),r,i)))(t(a(h)))}return l.invert=function(h){return a(f((e||(e=u(r,n.map(t),y)))(h)))},l.domain=function(h){return arguments.length?(n=Array.from(h,L),m()):n.slice()},l.range=function(h){return arguments.length?(r=Array.from(h),m()):r.slice()},l.rangeRound=function(h){return r=Array.from(h),i=S,m()},l.clamp=function(h){return arguments.length?(a=h?!0:s,m()):a!==s},l.interpolate=function(h){return arguments.length?(i=h,m()):i},l.unknown=function(h){return arguments.length?(c=h,l):c},function(h,k){return t=h,f=k,m()}}function W(){return V()(s,s)}function X(n,r,i,t){var f=E(n,r,i),c;switch(t=R(t??",f"),t.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return t.precision==null&&!isNaN(c=H(f,a))&&(t.precision=c),q(t,a)}case"":case"e":case"g":case"p":case"r":{t.precision==null&&!isNaN(c=J(f,Math.max(Math.abs(n),Math.abs(r))))&&(t.precision=c-(t.type==="e"));break}case"f":case"%":{t.precision==null&&!isNaN(c=G(f))&&(t.precision=c-(t.type==="%")*2);break}}return F(t)}function Y(n){var r=n.domain;return n.ticks=function(i){var t=r();return D(t[0],t[t.length-1],i??10)},n.tickFormat=function(i,t){var f=r();return X(f[0],f[f.length-1],i??10,t)},n.nice=function(i){i==null&&(i=10);var t=r(),f=0,c=t.length-1,a=t[f],u=t[c],o,e,m=10;for(u0;){if(e=d(a,u,i),e===o)return t[f]=a,t[c]=u,r(t);if(e>0)a=Math.floor(a/e)*e,u=Math.ceil(u/e)*e;else if(e<0)a=Math.ceil(a*e)/e,u=Math.floor(u*e)/e;else break;o=e}return n},n}function Z(){var n=W();return n.copy=function(){return U(n,Z())},A.apply(n,arguments),Y(n)}export{U as a,w as b,W as c,Z as l,E as t}; +import{am as y,al as b}from"../app/index-y89rQfXU.js";import{i as A}from"./init-Gi6I4Gst.js";import{e as M,b as R,a as q,f as F}from"./defaultLocale-CrowFXzY.js";function S(n,r){return n=+n,r=+r,function(i){return Math.round(n*(1-i)+r*i)}}function g(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function z(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function w(n){let r,i,t;n.length!==2?(r=g,i=(u,o)=>g(n(u),o),t=(u,o)=>n(u)-o):(r=n===g||n===z?n:I,i=n,t=n);function f(u,o,e=0,m=u.length){if(e>>1;i(u[l],o)<0?e=l+1:m=l}while(e>>1;i(u[l],o)<=0?e=l+1:m=l}while(ee&&t(u[l-1],o)>-t(u[l],o)?l-1:l}return{left:f,center:a,right:c}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=w(g),j=$.right;w(P).center;const x=Math.sqrt(50),B=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,i){const t=(r-n)/Math.max(0,i),f=Math.floor(Math.log10(t)),c=t/Math.pow(10,f),a=c>=x?10:c>=B?5:c>=C?2:1;let u,o,e;return f<0?(e=Math.pow(10,-f)/a,u=Math.round(n*e),o=Math.round(r*e),u/er&&--o,e=-e):(e=Math.pow(10,f)*a,u=Math.round(n/e),o=Math.round(r/e),u*er&&--o),o0))return[];if(n===r)return[n];const t=r=f))return[];const u=c-f+1,o=new Array(u);if(t)if(a<0)for(let e=0;er&&(i=n,n=r,r=i),function(t){return Math.max(n,Math.min(r,t))}}function Q(n,r,i){var t=n[0],f=n[1],c=r[0],a=r[1];return f2?T:Q,o=e=null,l}function l(h){return h==null||isNaN(h=+h)?c:(o||(o=u(n.map(t),r,i)))(t(a(h)))}return l.invert=function(h){return a(f((e||(e=u(r,n.map(t),y)))(h)))},l.domain=function(h){return arguments.length?(n=Array.from(h,L),m()):n.slice()},l.range=function(h){return arguments.length?(r=Array.from(h),m()):r.slice()},l.rangeRound=function(h){return r=Array.from(h),i=S,m()},l.clamp=function(h){return arguments.length?(a=h?!0:s,m()):a!==s},l.interpolate=function(h){return arguments.length?(i=h,m()):i},l.unknown=function(h){return arguments.length?(c=h,l):c},function(h,k){return t=h,f=k,m()}}function W(){return V()(s,s)}function X(n,r,i,t){var f=E(n,r,i),c;switch(t=R(t??",f"),t.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return t.precision==null&&!isNaN(c=H(f,a))&&(t.precision=c),q(t,a)}case"":case"e":case"g":case"p":case"r":{t.precision==null&&!isNaN(c=J(f,Math.max(Math.abs(n),Math.abs(r))))&&(t.precision=c-(t.type==="e"));break}case"f":case"%":{t.precision==null&&!isNaN(c=G(f))&&(t.precision=c-(t.type==="%")*2);break}}return F(t)}function Y(n){var r=n.domain;return n.ticks=function(i){var t=r();return D(t[0],t[t.length-1],i??10)},n.tickFormat=function(i,t){var f=r();return X(f[0],f[f.length-1],i??10,t)},n.nice=function(i){i==null&&(i=10);var t=r(),f=0,c=t.length-1,a=t[f],u=t[c],o,e,m=10;for(u0;){if(e=d(a,u,i),e===o)return t[f]=a,t[c]=u,r(t);if(e>0)a=Math.floor(a/e)*e,u=Math.ceil(u/e)*e;else if(e<0)a=Math.ceil(a*e)/e,u=Math.floor(u*e)/e;else break;o=e}return n},n}function Z(){var n=W();return n.copy=function(){return U(n,Z())},A.apply(n,arguments),Y(n)}export{U as a,w as b,W as c,Z as l,E as t}; diff --git a/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-BCBAEFx3.js b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-DmJtql8p.js similarity index 86% rename from veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-BCBAEFx3.js rename to veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-DmJtql8p.js index af1a083bb..f49dd44e4 100644 --- a/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-BCBAEFx3.js +++ b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-DmJtql8p.js @@ -1 +1 @@ -import{g as p,r as u,d as n}from"./chunk-6Q2QTUOP-D_idPgQl.js";import{p as f}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a,at as o}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../chunks/purify.es-BnINGy_Y.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},F={parser:R,db:n,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as n}from"./chunk-6Q2QTUOP-BuYPTb-v.js";import{p as f}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a,at as o}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../chunks/purify.es-BnINGy_Y.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},F={parser:R,db:n,renderer:u,styles:p};export{F as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-Bqx-XTbw.js b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BC0iLzBL.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-Bqx-XTbw.js rename to veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BC0iLzBL.js index c5b20f7c5..2500ed948 100644 --- a/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-Bqx-XTbw.js +++ b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BC0iLzBL.js @@ -1,4 +1,4 @@ -import{p as qe}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a as ct,aP as Qe,aW as Je,at as Se,aR as Ke,W as je,aT as _e,$ as tr,V as er,aQ as rr,s as ir,r as ar,X as nr,O as or,Y as me,F as Ee,a2 as ve,aN as sr,a0 as hr,aJ as lr,b7 as fr}from"./mermaid.core-DnksLuoJ.js";import{p as cr}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as Te,a8 as gr,aB as ur}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var be={exports:{}},ue={exports:{}},de={exports:{}},De;function dr(){return De||(De=1,function(I,M){(function(x,N){I.exports=N()})(Te,function(){return function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)}([function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r},function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;hs?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e},function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(G,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;wT&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V,Y=this.nodes,B=Y.length,A=0;AL&&(h=L),Tw&&(u=w),dL&&(h=L),Tw&&(u=w),d=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s},function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(eg)return i[0]=s,i[1]=e,i[2]=G,i[3]=t,!1;if(fg?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,G=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,G=o-h,Y=h*c-o*T,B=L*G-b*w,B===0?null:(u=(w*Y-G*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,x,N){var v=function(){function e(g,t){for(var s=0;s"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l},function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c0&&c;){for(L.push(w[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),u=0;u-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u0){for(var T=this.edgeToDummyNodes.get(h),u=0;u=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&G.push(a),T.set(a,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s},function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l},function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=u.length||L>=u[0].length)){for(var b=0;be}}]),i}();C.exports=r},function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(Math.min(this.m+1,this.n)),this.U=function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)wt.push(0);return wt}(this.n),i=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if(function(Tt,wt){return Tt&&wt}(z0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v},function(C,x,N){var v=function(){function r(i,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i{var x={45:(n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f},806:(n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e},767:(n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},880:(n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},578:(n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},765:(n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&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%h.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 a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,a.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=a.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var F;for(F=0;Fm&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D1;){var Z=H[0];H.splice(0,1);var tt=z.indexOf(Z);tt>=0&&z.splice(tt,1),$--,X--}E!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%$){var It=z[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),z=new t(a.graphManager);z.id=R,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=z;var X=a.getGraphManager().add(a.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return SF&&(F=$.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function($,O){var H=W;return D.idealRowWidth?(H=S,H($.id,O.id)):H($,O)});for(var R=0,Q=0,z=0;z0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.widthS&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;FD&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,O,H,Z=0;Z{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var he=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+he)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[d[u.get(P.nodeId)],L[u.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[P]=[Mt,L[u.get(pt)]],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},K=0;K0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[P]=[d[u.get(pt)],Mt],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:d[u.get(P.nodeId)],y:L[u.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(P,U){d[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){d[u.get(P.nodeId)]=P.position.x,L[u.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})}(ue)),ue.exports}(function(I,M){(function(x,N){I.exports=N(vr())})(Te,function(C){return(()=>{var x={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e{var f=function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o0&&S.merge(R)});for(var D=0;D1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=w.next()).done);d=!0){var V=G.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;Eh&&(h=p),mu&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zh&&(h=X),rtu&&(u=$)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;BL&&(h=L),Tw&&(u=w),d{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,G=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),Z),W(J,H,z,X)}}},y=function(R,Q,z){for(var X=0,rt=0,$=0;$0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(G),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}},212:(n,r,i)=>{var f=function(){function d(L,b){for(var w=0;w0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(G,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=G.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,z={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var $=X.length-1;$>=0;$--)A.splice(X[$],1),Y.splice(X[$],1),j.splice(X[$],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d}();n.exports=u},657:(n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],G=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q=1)break;_=et}for(var pt=0;pt=1)break;_=et}for(var lt=0;lt0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e},140:n=>{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(be);var pr=be.exports;const yr=gr(pr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},mr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),Er=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Tr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(I,M){const C=`${I}${M}`;return Tr(C)?C:void 0},"getArchitectureDirectionPair"),Nr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Lr=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cr=ct(function(I){return I.type==="service"},"isArchitectureService"),Mr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Pe=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Ge=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ar=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Cr)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(Mr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Re(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=wr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Pe(t,s),o)}if(g.lhsId===i){const o=pe(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=pe(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Nr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ar,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Dr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await cr("architecture",I);Se.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(M,C)},"parse")},Or=ct(I=>` +import{p as qe}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as ct,aP as Qe,aW as Je,at as Se,aR as Ke,W as je,aT as _e,$ as tr,V as er,aQ as rr,s as ir,r as ar,X as nr,O as or,Y as me,F as Ee,a2 as ve,aN as sr,a0 as hr,aJ as lr,b7 as fr}from"./mermaid.core-Byx96n1y.js";import{p as cr}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as Te,a8 as gr,aB as ur}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var be={exports:{}},ue={exports:{}},de={exports:{}},De;function dr(){return De||(De=1,function(I,M){(function(x,N){I.exports=N()})(Te,function(){return function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)}([function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r},function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;hs?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e},function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(G,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;wT&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V,Y=this.nodes,B=Y.length,A=0;AL&&(h=L),Tw&&(u=w),dL&&(h=L),Tw&&(u=w),d=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s},function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(eg)return i[0]=s,i[1]=e,i[2]=G,i[3]=t,!1;if(fg?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,G=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,G=o-h,Y=h*c-o*T,B=L*G-b*w,B===0?null:(u=(w*Y-G*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,x,N){var v=function(){function e(g,t){for(var s=0;s"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l},function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c0&&c;){for(L.push(w[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),u=0;u-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u0){for(var T=this.edgeToDummyNodes.get(h),u=0;u=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&G.push(a),T.set(a,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s},function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l},function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=u.length||L>=u[0].length)){for(var b=0;be}}]),i}();C.exports=r},function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(Math.min(this.m+1,this.n)),this.U=function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)wt.push(0);return wt}(this.n),i=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if(function(Tt,wt){return Tt&&wt}(z0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v},function(C,x,N){var v=function(){function r(i,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i{var x={45:(n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f},806:(n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e},767:(n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},880:(n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},578:(n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},765:(n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&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%h.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 a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,a.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=a.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var F;for(F=0;Fm&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D1;){var Z=H[0];H.splice(0,1);var tt=z.indexOf(Z);tt>=0&&z.splice(tt,1),$--,X--}E!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%$){var It=z[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),z=new t(a.graphManager);z.id=R,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=z;var X=a.getGraphManager().add(a.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return SF&&(F=$.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function($,O){var H=W;return D.idealRowWidth?(H=S,H($.id,O.id)):H($,O)});for(var R=0,Q=0,z=0;z0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.widthS&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;FD&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,O,H,Z=0;Z{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var he=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+he)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[d[u.get(P.nodeId)],L[u.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[P]=[Mt,L[u.get(pt)]],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},K=0;K0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[P]=[d[u.get(pt)],Mt],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:d[u.get(P.nodeId)],y:L[u.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(P,U){d[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){d[u.get(P.nodeId)]=P.position.x,L[u.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})}(ue)),ue.exports}(function(I,M){(function(x,N){I.exports=N(vr())})(Te,function(C){return(()=>{var x={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e{var f=function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o0&&S.merge(R)});for(var D=0;D1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=w.next()).done);d=!0){var V=G.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;Eh&&(h=p),mu&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zh&&(h=X),rtu&&(u=$)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;BL&&(h=L),Tw&&(u=w),d{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,G=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),Z),W(J,H,z,X)}}},y=function(R,Q,z){for(var X=0,rt=0,$=0;$0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(G),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}},212:(n,r,i)=>{var f=function(){function d(L,b){for(var w=0;w0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(G,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=G.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,z={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var $=X.length-1;$>=0;$--)A.splice(X[$],1),Y.splice(X[$],1),j.splice(X[$],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d}();n.exports=u},657:(n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],G=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q=1)break;_=et}for(var pt=0;pt=1)break;_=et}for(var lt=0;lt0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e},140:n=>{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(be);var pr=be.exports;const yr=gr(pr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},mr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),Er=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Tr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(I,M){const C=`${I}${M}`;return Tr(C)?C:void 0},"getArchitectureDirectionPair"),Nr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Lr=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cr=ct(function(I){return I.type==="service"},"isArchitectureService"),Mr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Pe=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Ge=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ar=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Cr)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(Mr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Re(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=wr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Pe(t,s),o)}if(g.lhsId===i){const o=pe(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=pe(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Nr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ar,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Dr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await cr("architecture",I);Se.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(M,C)},"parse")},Or=ct(I=>` .edge { stroke-width: ${I.archEdgeWidth}; stroke: ${I.archEdgeColor}; diff --git a/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-DdQPoes9.js b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-wh52Ecel.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-DdQPoes9.js rename to veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-wh52Ecel.js index 6cee0688b..4b60cb008 100644 --- a/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-DdQPoes9.js +++ b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-wh52Ecel.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-CjM7JLQ8.js";import{am as fe,a7 as Ut,an as pe,b4 as ye,b3 as xe,b6 as be,b5 as we,b0 as me,a_ as Se,aV as Le,aI as ve,aB as Ee,aA as _e,au as ke,ai as Te,ah as De,aj as Ne,S as Ie,R as Be,K as Ce,m as Oe,I as Re,g as Ae,h as ze,e as Me,a as u,X as nt,B as Pe,at as v,s as Fe,aM as We,Y as M,a3 as Ye,aq as He,G as Ke,a9 as Ue,a1 as Y,F as Et,z as rt,a6 as Xe,b9 as at,x as Ve,a5 as je,aN as Ot,M as Rt,A as Ge}from"./mermaid.core-DnksLuoJ.js";import{aB as O}from"../../app/index-DZf0wXGZ.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-Cb_XsJlf.js";import"../../chunks/purify.es-BnINGy_Y.js";function Je(e){return Array.isArray(e)}function Qe(e){if(fe(e))return e;const t=Ut(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(pe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Ut(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Be:case Ie:case Ne:case De:case Te:case ke:case _e:case Ee:case ve:case Le:case Se:case me:case we:case be:case xe:case ye:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=function(){var e=u(function(N,b,d,y){for(d=d||{},y=N.length;y--;d[N[y]]=b);return d},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],h=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(b,d,y,w,D,o,k){var f=o.length-1;switch(D){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",o[f-1]),w.setHierarchy(o[f-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:w.getLogger().debug("Rule: link: ",o[f],b),this.$={edgeTypeStr:o[f],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const E=parseInt(o[f]),T=w.generateId();this.$={id:T,type:"space",label:"",width:E,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const z=w.edgeStrToEdgeData(o[f-1].edgeTypeStr),F=w.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),q=w.edgeStrToThickness(o[f-1].edgeTypeStr),I=w.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:q,pattern:I,directions:o[f].directions,arrowTypeEnd:z,arrowTypeStart:F},{id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:w.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),w.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const K=w.generateId();this.$={id:K,type:"composite",label:"",children:o[f-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:p,16:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(x,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(h,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(b,d){if(d.recoverable)this.trace(b);else{var y=new Error(b);throw y.hash=d,y}},"parseError"),parse:u(function(b){var d=this,y=[0],w=[],D=[null],o=[],k=this.table,f="",E=0,T=0,z=2,F=1,q=o.slice.call(arguments,1),I=Object.create(this.lexer),K={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(K.yy[J]=this.yy[J]);I.setInput(b,K.yy),K.yy.lexer=I,K.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var et=I.yylloc;o.push(et);var ft=I.options&&I.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(U){y.length=y.length-2*U,D.length=D.length-U,o.length=o.length-U}u(ue,"popStack");function Bt(){var U;return U=w.pop()||I.lex()||F,typeof U!="number"&&(U instanceof Array&&(w=U,U=w.pop()),U=d.symbols_[U]||U),U}u(Bt,"lex");for(var H,$,V,pt,tt={},ct,Q,Ct,lt;;){if($=y[y.length-1],this.defaultActions[$]?V=this.defaultActions[$]:((H===null||typeof H>"u")&&(H=Bt()),V=k[$]&&k[$][H]),typeof V>"u"||!V.length||!V[0]){var yt="";lt=[];for(ct in k[$])this.terminals_[ct]&&ct>z&<.push("'"+this.terminals_[ct]+"'");I.showPosition?yt="Parse error on line "+(E+1)+`: +import{g as de}from"./chunk-5VM5RSS4-0VUj4cdX.js";import{am as fe,a7 as Ut,an as pe,b4 as ye,b3 as xe,b6 as be,b5 as we,b0 as me,a_ as Se,aV as Le,aI as ve,aB as Ee,aA as _e,au as ke,ai as Te,ah as De,aj as Ne,S as Ie,R as Be,K as Ce,m as Oe,I as Re,g as Ae,h as ze,e as Me,a as u,X as nt,B as Pe,at as v,s as Fe,aM as We,Y as M,a3 as Ye,aq as He,G as Ke,a9 as Ue,a1 as Y,F as Et,z as rt,a6 as Xe,b9 as at,x as Ve,a5 as je,aN as Ot,M as Rt,A as Ge}from"./mermaid.core-Byx96n1y.js";import{aB as O}from"../../app/index-y89rQfXU.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-CK3FNdKP.js";import"../../chunks/purify.es-BnINGy_Y.js";function Je(e){return Array.isArray(e)}function Qe(e){if(fe(e))return e;const t=Ut(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(pe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Ut(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Be:case Ie:case Ne:case De:case Te:case ke:case _e:case Ee:case ve:case Le:case Se:case me:case we:case be:case xe:case ye:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=function(){var e=u(function(N,b,d,y){for(d=d||{},y=N.length;y--;d[N[y]]=b);return d},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],h=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(b,d,y,w,D,o,k){var f=o.length-1;switch(D){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",o[f-1]),w.setHierarchy(o[f-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:w.getLogger().debug("Rule: link: ",o[f],b),this.$={edgeTypeStr:o[f],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const E=parseInt(o[f]),T=w.generateId();this.$={id:T,type:"space",label:"",width:E,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const z=w.edgeStrToEdgeData(o[f-1].edgeTypeStr),F=w.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),q=w.edgeStrToThickness(o[f-1].edgeTypeStr),I=w.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:q,pattern:I,directions:o[f].directions,arrowTypeEnd:z,arrowTypeStart:F},{id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:w.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),w.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const K=w.generateId();this.$={id:K,type:"composite",label:"",children:o[f-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:p,16:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(x,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(h,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(b,d){if(d.recoverable)this.trace(b);else{var y=new Error(b);throw y.hash=d,y}},"parseError"),parse:u(function(b){var d=this,y=[0],w=[],D=[null],o=[],k=this.table,f="",E=0,T=0,z=2,F=1,q=o.slice.call(arguments,1),I=Object.create(this.lexer),K={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(K.yy[J]=this.yy[J]);I.setInput(b,K.yy),K.yy.lexer=I,K.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var et=I.yylloc;o.push(et);var ft=I.options&&I.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(U){y.length=y.length-2*U,D.length=D.length-U,o.length=o.length-U}u(ue,"popStack");function Bt(){var U;return U=w.pop()||I.lex()||F,typeof U!="number"&&(U instanceof Array&&(w=U,U=w.pop()),U=d.symbols_[U]||U),U}u(Bt,"lex");for(var H,$,V,pt,tt={},ct,Q,Ct,lt;;){if($=y[y.length-1],this.defaultActions[$]?V=this.defaultActions[$]:((H===null||typeof H>"u")&&(H=Bt()),V=k[$]&&k[$][H]),typeof V>"u"||!V.length||!V[0]){var yt="";lt=[];for(ct in k[$])this.terminals_[ct]&&ct>z&<.push("'"+this.terminals_[ct]+"'");I.showPosition?yt="Parse error on line "+(E+1)+`: `+I.showPosition()+` Expecting `+lt.join(", ")+", got '"+(this.terminals_[H]||H)+"'":yt="Parse error on line "+(E+1)+": Unexpected "+(H==F?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(yt,{text:I.match,token:this.terminals_[H]||H,line:I.yylineno,loc:et,expected:lt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+H);switch(V[0]){case 1:y.push(H),D.push(I.yytext),o.push(I.yylloc),y.push(V[1]),H=null,T=I.yyleng,f=I.yytext,E=I.yylineno,et=I.yylloc;break;case 2:if(Q=this.productions_[V[1]][1],tt.$=D[D.length-Q],tt._$={first_line:o[o.length-(Q||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Q||1)].first_column,last_column:o[o.length-1].last_column},ft&&(tt._$.range=[o[o.length-(Q||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(tt,[f,T,E,K.yy,V[1],D,o].concat(q)),typeof pt<"u")return pt;Q&&(y=y.slice(0,-1*Q*2),D=D.slice(0,-1*Q),o=o.slice(0,-1*Q)),y.push(this.productions_[V[1]][0]),D.push(tt.$),o.push(tt._$),Ct=k[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},B=function(){var N={EOF:1,parseError:u(function(d,y){if(this.yy.parser)this.yy.parser.parseError(d,y);else throw new Error(d)},"parseError"),setInput:u(function(b,d){return this.yy=d||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:u(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var d=b.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),b},"input"),unput:u(function(b){var d=b.length,y=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var w=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),y.length-1&&(this.yylineno-=y.length-1);var D=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:y?(y.length===w.length?this.yylloc.first_column:0)+w[w.length-y.length].length-y[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(b){this.unput(this.match.slice(b))},"less"),pastInput:u(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:u(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:u(function(){var b=this.pastInput(),d=new Array(b.length+1).join("-");return b+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Bra67sdL.js b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-B9klRQ1P.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Bra67sdL.js rename to veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-B9klRQ1P.js index 7df24867f..5abcdaf33 100644 --- a/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Bra67sdL.js +++ b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-B9klRQ1P.js @@ -1,4 +1,4 @@ -import{g as Se,e as De}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{aQ as Pe,V as Be,W as Ie,aR as Me,a as y,Y as Bt,at as de,B as Le,j as Ne,q as Tt,aN as ge,aO as Ye,bb as je,x as $t,p as fe}from"./mermaid.core-DnksLuoJ.js";import{aB as jt}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ft=function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[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],St=[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],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[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],qt={trace:y(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:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;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:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[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:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,X,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: +import{g as Se,e as De}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{aQ as Pe,V as Be,W as Ie,aR as Me,a as y,Y as Bt,at as de,B as Le,j as Ne,q as Tt,aN as ge,aO as Ye,bb as je,x as $t,p as fe}from"./mermaid.core-Byx96n1y.js";import{aB as jt}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ft=function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[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],St=[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],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[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],qt={trace:y(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:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;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:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[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:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,X,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,oe=D.yyleng,p=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(X=this.productions_[N[1]][1],wt.$=R[R.length-X],wt._$={first_line:h[h.length-(X||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(X||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(X||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[p,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;X&&(E=E.slice(0,-1*X*2),R=R.slice(0,-1*X),h=h.slice(0,-1*X)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.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),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;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),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(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:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CJwzhEYx.js b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-w7u93fzV.js similarity index 93% rename from veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CJwzhEYx.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-w7u93fzV.js index 85410c0f2..3fd175109 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CJwzhEYx.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-w7u93fzV.js @@ -1 +1 @@ -import{a as i,ar as d,aO as o}from"./mermaid.core-DnksLuoJ.js";import{aB as l}from"../../app/index-DZf0wXGZ.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const a in t.attrs)e.attr(a,t.attrs[a]);return t.class&&e.attr("class",t.class),e},"drawRect"),y=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),m=i((r,t)=>{const e=t.text.replace(d," "),a=r.append("text");a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),a},"drawText"),g=i((r,t,e,a)=>{const s=r.append("image");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",n)},"drawImage"),f=i((r,t,e,a)=>{const s=r.append("use");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),w=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),k=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("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")),r},"createTooltip");export{f as a,g as b,k as c,y as d,x as e,m as f,h as g,w as h}; +import{a as i,ar as d,aO as o}from"./mermaid.core-Byx96n1y.js";import{aB as l}from"../../app/index-y89rQfXU.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const a in t.attrs)e.attr(a,t.attrs[a]);return t.class&&e.attr("class",t.class),e},"drawRect"),y=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),m=i((r,t)=>{const e=t.text.replace(d," "),a=r.append("text");a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),a},"drawText"),g=i((r,t,e,a)=>{const s=r.append("image");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",n)},"drawImage"),f=i((r,t,e,a)=>{const s=r.append("use");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),w=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),k=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("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")),r},"createTooltip");export{f as a,g as b,k as c,y as d,x as e,m as f,h as g,w as h}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-naaeokok.js b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-Df19aPp9.js similarity index 66% rename from veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-naaeokok.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-Df19aPp9.js index 035dc2227..c8faeff47 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-naaeokok.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-Df19aPp9.js @@ -1 +1 @@ -import{a as s}from"./mermaid.core-DnksLuoJ.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; +import{a as s}from"./mermaid.core-Byx96n1y.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-gjMuKq5U.js b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CziPj31s.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-gjMuKq5U.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CziPj31s.js index 58bbb2cdc..01e689858 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-gjMuKq5U.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CziPj31s.js @@ -1,4 +1,4 @@ -import{g as ee}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as se}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as S,at as b,Y as F,aK as ie,b9 as re,W as ae,aR as ne,V as oe,aQ as le,aT as ce,$ as he,T as ue,x as K,s as de}from"./mermaid.core-DnksLuoJ.js";import{c as fe}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{aB as Dt}from"../../app/index-DZf0wXGZ.js";import pe from"../../chunks/purify.es-BnINGy_Y.js";var Ct=function(){var t=S(function(W,l,d,n){for(d=d||{},n=W.length;n--;d[W[n]]=l);return d},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],h=[1,11],p=[1,16],f=[1,17],T=[1,18],E=[1,19],m=[1,33],R=[1,20],C=[1,21],x=[1,22],$=[1,23],O=[1,24],u=[1,26],L=[1,27],k=[1,28],V=[1,29],P=[1,30],v=[1,31],B=[1,32],j=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],J=[1,34],y=[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],ct=[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],Lt=[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],gt={trace:S(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:S(function(l,d,n,g,_,r,Y){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const et=r[c-1];et.description=g.trimColon(r[c]),this.$=et;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var G=r[c],q=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");G=ut[0],q=[q,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:q};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},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:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:J},t(y,[2,17]),t(Lt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[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(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,72],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,81],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(function(l,d){if(d.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=d,n}},"parseError"),parse:S(function(l){var d=this,n=[0],g=[],_=[null],r=[],Y=this.table,c="",G=0,q=0,ut=2,et=1,Tt=r.slice.call(arguments,1),D=Object.create(this.lexer),H={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(H.yy[Et]=this.yy[Et]);D.setInput(l,H.yy),H.yy.lexer=D,H.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;r.push(_t);var Zt=D.options&&D.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(I){n.length=n.length-2*I,_.length=_.length-I,r.length=r.length-I}S(te,"popStack");function wt(){var I;return I=g.pop()||D.lex()||et,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=d.symbols_[I]||I),I}S(wt,"lex");for(var w,z,N,mt,Q={},dt,M,Rt,ft;;){if(z=n[n.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((w===null||typeof w>"u")&&(w=wt()),N=Y[z]&&Y[z][w]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in Y[z])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(G+1)+`: +import{g as ee}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as se}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as S,at as b,Y as F,aK as ie,b9 as re,W as ae,aR as ne,V as oe,aQ as le,aT as ce,$ as he,T as ue,x as K,s as de}from"./mermaid.core-Byx96n1y.js";import{c as fe}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{aB as Dt}from"../../app/index-y89rQfXU.js";import pe from"../../chunks/purify.es-BnINGy_Y.js";var Ct=function(){var t=S(function(W,l,d,n){for(d=d||{},n=W.length;n--;d[W[n]]=l);return d},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],h=[1,11],p=[1,16],f=[1,17],T=[1,18],E=[1,19],m=[1,33],R=[1,20],C=[1,21],x=[1,22],$=[1,23],O=[1,24],u=[1,26],L=[1,27],k=[1,28],V=[1,29],P=[1,30],v=[1,31],B=[1,32],j=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],J=[1,34],y=[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],ct=[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],Lt=[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],gt={trace:S(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:S(function(l,d,n,g,_,r,Y){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const et=r[c-1];et.description=g.trimColon(r[c]),this.$=et;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var G=r[c],q=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");G=ut[0],q=[q,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:q};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},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:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:J},t(y,[2,17]),t(Lt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[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(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,72],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,81],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(function(l,d){if(d.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=d,n}},"parseError"),parse:S(function(l){var d=this,n=[0],g=[],_=[null],r=[],Y=this.table,c="",G=0,q=0,ut=2,et=1,Tt=r.slice.call(arguments,1),D=Object.create(this.lexer),H={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(H.yy[Et]=this.yy[Et]);D.setInput(l,H.yy),H.yy.lexer=D,H.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;r.push(_t);var Zt=D.options&&D.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(I){n.length=n.length-2*I,_.length=_.length-I,r.length=r.length-I}S(te,"popStack");function wt(){var I;return I=g.pop()||D.lex()||et,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=d.symbols_[I]||I),I}S(wt,"lex");for(var w,z,N,mt,Q={},dt,M,Rt,ft;;){if(z=n[n.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((w===null||typeof w>"u")&&(w=wt()),N=Y[z]&&Y[z][w]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in Y[z])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(G+1)+`: `+D.showPosition()+` Expecting `+ft.join(", ")+", got '"+(this.terminals_[w]||w)+"'":bt="Parse error on line "+(G+1)+": Unexpected "+(w==et?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[w]||w,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+w);switch(N[0]){case 1:n.push(w),_.push(D.yytext),r.push(D.yylloc),n.push(N[1]),w=null,q=D.yyleng,c=D.yytext,G=D.yylineno,_t=D.yylloc;break;case 2:if(M=this.productions_[N[1]][1],Q.$=_[_.length-M],Q._$={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},Zt&&(Q._$.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(Q,[c,q,G,H.yy,N[1],_,r].concat(Tt)),typeof mt<"u")return mt;M&&(n=n.slice(0,-1*M*2),_=_.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[N[1]][0]),_.push(Q.$),r.push(Q._$),Rt=Y[n[n.length-2]][n[n.length-1]],n.push(Rt);break;case 3:return!0}}return!0},"parse")},Qt=function(){var W={EOF:1,parseError:S(function(d,n){if(this.yy.parser)this.yy.parser.parseError(d,n);else throw new Error(d)},"parseError"),setInput:S(function(l,d){return this.yy=d||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var d=l.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),l},"input"),unput:S(function(l){var d=l.length,n=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=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),n.length-1&&(this.yylineno-=n.length-1);var _=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:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(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:S(function(l){this.unput(this.match.slice(l))},"less"),pastInput:S(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(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:S(function(){var l=this.pastInput(),d=new Array(l.length+1).join("-");return l+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-CjM7JLQ8.js b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-0VUj4cdX.js similarity index 83% rename from veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-CjM7JLQ8.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-0VUj4cdX.js index 07a2e6b3c..78cda1498 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-CjM7JLQ8.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-0VUj4cdX.js @@ -1,4 +1,4 @@ -import{a as e}from"./mermaid.core-DnksLuoJ.js";var l=e(()=>` +import{a as e}from"./mermaid.core-Byx96n1y.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-D_idPgQl.js b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BuYPTb-v.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-D_idPgQl.js rename to veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BuYPTb-v.js index 558b494af..ca8dd8fa7 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-D_idPgQl.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BuYPTb-v.js @@ -1,4 +1,4 @@ -import{a as p,at as k,aP as H,X as _,s as q,a8 as G,B as U,aN as j,Y as K}from"./mermaid.core-DnksLuoJ.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,` +import{a as p,at as k,aP as H,X as _,s as q,a8 as G,B as U,aN as j,Y as K}from"./mermaid.core-Byx96n1y.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,` `),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ae=Y,ne=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ae,getDiagramTitle:ne},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:n,theme:a,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return le.test(n)?n:i},"sanitizeColorValue"),X=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return se.test(n)?n:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const n=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=X(e.fontFamily,f.fontFamily),n=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:n,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=_(),n={...G(),...i.themeVariables??{},...me(e)},a=pe(n),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??a.compactMode,padding:F(t.padding,a.padding),verticalSeparation:F(t.verticalSeparation,a.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,a.horizontalSeparation),arcRadius:F(t.arcRadius,a.arcRadius),fontSize:F(t.fontSize,a.fontSize),fontFamily:X(t.fontFamily,a.fontFamily),terminalFill:m(t.terminalFill,a.terminalFill),terminalStroke:m(t.terminalStroke,a.terminalStroke),terminalTextColor:m(t.terminalTextColor,a.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:m(t.lineColor,a.lineColor),strokeWidth:F(t.strokeWidth,a.strokeWidth),markerFill:m(t.markerFill,a.markerFill),commentFill:m(t.commentFill,a.commentFill),commentStroke:m(t.commentStroke,a.commentStroke),commentTextColor:m(t.commentTextColor,a.commentTextColor),specialFill:m(t.specialFill,a.specialFill),specialStroke:m(t.specialStroke,a.specialStroke),ruleNameColor:m(t.ruleNameColor,a.ruleNameColor),showMarkers:t.showMarkers??a.showMarkers,markerRadius:F(t.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:n,terminalFill:a,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return` .railroad-diagram { font-family: ${i}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-BsdMVsbj.js b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CdzaapU0.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-BsdMVsbj.js rename to veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CdzaapU0.js index 663cac03c..42a46b0ea 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-BsdMVsbj.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CdzaapU0.js @@ -1,4 +1,4 @@ -import{g as st}from"./chunk-5VM5RSS4-CjM7JLQ8.js";import{g as it}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as at}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as m,at as we,Y as F,a4 as rt,aK as nt,b9 as Ve,aR as ut,W as lt,aQ as ct,V as ot,aT as ht,$ as dt,x as I,s as pt,a0 as At,aN as ft,aD as z}from"./mermaid.core-DnksLuoJ.js";import{c as mt}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{aB as fe}from"../../app/index-DZf0wXGZ.js";import gt from"../../chunks/purify.es-BnINGy_Y.js";var Pe=function(){var s=m(function(O,o,d,p){for(d=d||{},p=O.length;p--;d[O[p]]=o);return d},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],u=[1,26],h=[1,42],f=[1,24],c=[1,25],g=[1,32],B=[1,33],R=[1,34],b=[1,45],ge=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],re=[1,62],_e=[1,63],Se=[1,64],S=[1,8,9,41],Me=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],le=[1,103],W=[1,121],Q=[1,117],j=[1,113],X=[1,119],q=[1,114],H=[1,115],J=[1,116],Z=[1,118],$=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],ce=[12,39],Ne=[1,8,9,39,41,44,46],oe=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:m(function(o,d,p,l,C,e,ee){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se}),{39:[1,65]},s(S,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(ue,[2,83],{66:94,68:te,69:se,70:ie,71:ae,72:re}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:h,54:g,56:B},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:le},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:W,50:Q,59:110,60:j,82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},{60:[1,122]},{13:Me,55:123},s(S,[2,72]),s(S,[2,138]),{22:W,50:Q,59:124,60:j,61:[1,125],82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(G,[2,16]),s(G,[2,17]),s(G,[2,18]),{11:127,12:Ue,39:[2,36]},s(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ce,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(oe,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ue,[2,82],{66:136,68:te,69:se,70:ie,71:ae,72:re}),s(ue,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:h,54:g,56:B},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(S,[2,48],{39:[1,142]}),{41:[1,143]},s(S,[2,50]),{41:[2,61],45:144,51:le},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ye,[2,107],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(S,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ce,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(oe,[2,69]),s(oe,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ue,[2,80]),s(S,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:h,54:g,56:B},{45:163,51:le},s(S,[2,49]),{41:[2,62]},s(S,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:W,50:Q,60:j,82:X,84:169,85:112,86:q,87:H,88:J,89:Z,90:$},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(ce,[2,11]),s(oe,[2,70]),s(S,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:le},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ye,[2,108],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(Ne,[2,8]),s(S,[2,51]),{41:[1,175]},s(S,[2,54]),s(A,[2,104]),s(S,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:m(function(o,d){if(d.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=d,p}},"parseError"),parse:m(function(o){var d=this,p=[0],l=[],C=[null],e=[],ee=this.table,t="",de=0,Ke=0,Ze=2,We=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(N){p.length=p.length-2*N,C.length=C.length-N,e.length=e.length-N}m(tt,"popStack");function Qe(){var N;return N=l.pop()||D.lex()||We,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=d.symbols_[N]||N),N}m(Qe,"lex");for(var _,P,L,Ie,U={},pe,v,je,Ae;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=Qe()),L=ee[P]&&ee[P][_]),typeof L>"u"||!L.length||!L[0]){var Oe="";Ae=[];for(pe in ee[P])this.terminals_[pe]&&pe>Ze&&Ae.push("'"+this.terminals_[pe]+"'");D.showPosition?Oe="Parse error on line "+(de+1)+`: +import{g as st}from"./chunk-5VM5RSS4-0VUj4cdX.js";import{g as it}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as at}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as m,at as we,Y as F,a4 as rt,aK as nt,b9 as Ve,aR as ut,W as lt,aQ as ct,V as ot,aT as ht,$ as dt,x as I,s as pt,a0 as At,aN as ft,aD as z}from"./mermaid.core-Byx96n1y.js";import{c as mt}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{aB as fe}from"../../app/index-y89rQfXU.js";import gt from"../../chunks/purify.es-BnINGy_Y.js";var Pe=function(){var s=m(function(O,o,d,p){for(d=d||{},p=O.length;p--;d[O[p]]=o);return d},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],u=[1,26],h=[1,42],f=[1,24],c=[1,25],g=[1,32],B=[1,33],R=[1,34],b=[1,45],ge=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],re=[1,62],_e=[1,63],Se=[1,64],S=[1,8,9,41],Me=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],le=[1,103],W=[1,121],Q=[1,117],j=[1,113],X=[1,119],q=[1,114],H=[1,115],J=[1,116],Z=[1,118],$=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],ce=[12,39],Ne=[1,8,9,39,41,44,46],oe=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:m(function(o,d,p,l,C,e,ee){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se}),{39:[1,65]},s(S,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(ue,[2,83],{66:94,68:te,69:se,70:ie,71:ae,72:re}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:h,54:g,56:B},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:le},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:W,50:Q,59:110,60:j,82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},{60:[1,122]},{13:Me,55:123},s(S,[2,72]),s(S,[2,138]),{22:W,50:Q,59:124,60:j,61:[1,125],82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(G,[2,16]),s(G,[2,17]),s(G,[2,18]),{11:127,12:Ue,39:[2,36]},s(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ce,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(oe,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ue,[2,82],{66:136,68:te,69:se,70:ie,71:ae,72:re}),s(ue,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:h,54:g,56:B},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(S,[2,48],{39:[1,142]}),{41:[1,143]},s(S,[2,50]),{41:[2,61],45:144,51:le},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ye,[2,107],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(S,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ce,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(oe,[2,69]),s(oe,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ue,[2,80]),s(S,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:h,54:g,56:B},{45:163,51:le},s(S,[2,49]),{41:[2,62]},s(S,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:W,50:Q,60:j,82:X,84:169,85:112,86:q,87:H,88:J,89:Z,90:$},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(ce,[2,11]),s(oe,[2,70]),s(S,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:le},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ye,[2,108],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(Ne,[2,8]),s(S,[2,51]),{41:[1,175]},s(S,[2,54]),s(A,[2,104]),s(S,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:m(function(o,d){if(d.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=d,p}},"parseError"),parse:m(function(o){var d=this,p=[0],l=[],C=[null],e=[],ee=this.table,t="",de=0,Ke=0,Ze=2,We=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(N){p.length=p.length-2*N,C.length=C.length-N,e.length=e.length-N}m(tt,"popStack");function Qe(){var N;return N=l.pop()||D.lex()||We,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=d.symbols_[N]||N),N}m(Qe,"lex");for(var _,P,L,Ie,U={},pe,v,je,Ae;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=Qe()),L=ee[P]&&ee[P][_]),typeof L>"u"||!L.length||!L[0]){var Oe="";Ae=[];for(pe in ee[P])this.terminals_[pe]&&pe>Ze&&Ae.push("'"+this.terminals_[pe]+"'");D.showPosition?Oe="Parse error on line "+(de+1)+`: `+D.showPosition()+` Expecting `+Ae.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Oe="Parse error on line "+(de+1)+": Unexpected "+(_==We?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[_]||_,line:D.yylineno,loc:ve,expected:Ae})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+_);switch(L[0]){case 1:p.push(_),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),_=null,Ke=D.yyleng,t=D.yytext,de=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],U.$=C[C.length-v],U._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(U._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(U,[t,Ke,de,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(U.$),e.push(U._$),je=ee[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=function(){var O={EOF:1,parseError:m(function(d,p){if(this.yy.parser)this.yy.parser.parseError(d,p);else throw new Error(d)},"parseError"),setInput:m(function(o,d){return this.yy=d||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:m(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var d=o.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),o},"input"),unput:m(function(o){var d=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var l=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),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(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:m(function(o){this.unput(this.match.slice(o))},"less"),pastInput:m(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var o=this.pastInput(),d=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-CWI15yjG.js b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-s5uAWi9x.js similarity index 78% rename from veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-CWI15yjG.js rename to veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-s5uAWi9x.js index 0d06f9296..dcff8dceb 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-CWI15yjG.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-s5uAWi9x.js @@ -1 +1 @@ -import{a as l}from"./mermaid.core-DnksLuoJ.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p}; +import{a as l}from"./mermaid.core-Byx96n1y.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-CNEAUy5I.js b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BwJsQpfI.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-CNEAUy5I.js rename to veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BwJsQpfI.js index f2d9951d9..597f75686 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-CNEAUy5I.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BwJsQpfI.js @@ -1 +1 @@ -import{a,B as w,at as x}from"./mermaid.core-DnksLuoJ.js";var g=a((t,e,i,o)=>{t.attr("class",i);const{width:r,height:h,x:n,y:c}=u(t,e);w(t,h,r,o);const s=B(n,c,r,h,e);t.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${e}`)},"setupViewPortForSVG"),u=a((t,e)=>{var o;const i=((o=t.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((t,e,i,o,r)=>`${t-r} ${e-r} ${i} ${o}`,"createViewBox");export{g as s}; +import{a,B as w,at as x}from"./mermaid.core-Byx96n1y.js";var g=a((t,e,i,o)=>{t.attr("class",i);const{width:r,height:h,x:n,y:c}=u(t,e);w(t,h,r,o);const s=B(n,c,r,h,e);t.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${e}`)},"setupViewPortForSVG"),u=a((t,e)=>{var o;const i=((o=t.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((t,e,i,o,r)=>`${t-r} ${e-r} ${i} ${o}`,"createViewBox");export{g as s}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DfwPULTh.js b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-CvZ-mg4G.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DfwPULTh.js rename to veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-CvZ-mg4G.js index 4c4d1fa3d..61d7d2930 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DfwPULTh.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-CvZ-mg4G.js @@ -1 +1 @@ -import{a as d,at as i}from"./mermaid.core-DnksLuoJ.js";import{Q as C,G as y}from"../../chunks/graph-Dqkl27Ch.js";import{c as j,m as X}from"../../chunks/map-8WAJQ6ap.js";var p=4;function F(e){return j(e,p)}function b(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:R(e)};return C(e.graph())||(r.value=F(e.graph())),r}function M(e){return X(e.nodes(),function(r){var s=e.node(r),n=e.parent(r),a={v:r};return C(s)||(a.value=s),C(n)||(a.parent=n),a})}function R(e){return X(e.edges(),function(r){var s=e.edge(r),n={v:r.v,w:r.w};return C(r.name)||(n.name=r.name),C(s)||(n.value=s),n})}var c=new Map,v=new Map,A=new Map,J=d(()=>{v.clear(),A.clear(),c.clear()},"clear"),g=d((e,r)=>{const s=v.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),_=d((e,r)=>{const s=v.get(r)||[];return i.info("Descendants of ",r," is ",s),i.info("Edge is ",e),e.v===r||e.w===r?!1:s?s.includes(e.v)||g(e.v,r)||g(e.w,r)||s.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),x=d((e,r,s,n)=>{i.warn("Copying children of ",e,"root",n,"data",r.node(e),n);const a=r.children(e)||[];e!==n&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(o=>{if(r.children(o).length>0)x(o,r,s,n);else{const l=r.node(o);i.info("cp ",o," to ",n," with parent ",e),s.setNode(o,l),n!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),s.setParent(o,r.parent(o))),e!==n&&o!==e?(i.debug("Setting parent",o,e),s.setParent(o,e)):(i.info("In copy ",e,"root",n,"data",r.node(e),n),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==n,"node!==clusterId",o!==e));const u=r.edges(o);i.debug("Copying Edges",u),u.forEach(t=>{i.info("Edge",t);const f=r.edge(t.v,t.w,t.name);i.info("Edge data",f,n);try{if(_(t,n)){const w=v.get(n)||[],m=w.includes(t.v)||g(t.v,n)||t.v===n,D=w.includes(t.w)||g(t.w,n)||t.w===n;if(m&&D)i.info("Copying as ",t.v,t.w,f,t.name),s.setEdge(t.v,t.w,f,t.name),i.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]));else{const N=m?n:t.v,h=D?n:t.w;i.info("Rebinding cross-boundary edge as ",N,h,f,t.name),r.setEdge(N,h,f,t.name)}}else i.info("Skipping copy of edge ",t.v,"-->",t.w," rootId: ",n," clusterId:",e)}catch(w){i.error(w)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=d((e,r)=>{const s=r.children(e);let n=[...s];for(const a of s)A.set(a,e),n=[...n,...O(a,r)];return n},"extractDescendants"),P=d((e,r,s)=>{const n=e.edges().filter(t=>t.v===r||t.w===r),a=e.edges().filter(t=>t.v===s||t.w===s),o=n.map(t=>({v:t.v===r?s:t.v,w:t.w===r?r:t.w})),l=a.map(t=>({v:t.v,w:t.w}));return o.filter(t=>l.some(f=>t.v===f.v&&t.w===f.w))},"findCommonEdges"),E=d((e,r,s)=>{const n=r.children(e);if(i.trace("Searching children of id ",e,n),n.length<1)return e;let a;for(const o of n){const l=E(o,r,s),u=P(r,s,l);if(l)if(u.length>0)a=l;else return l}return a},"findNonClusterChild"),S=d(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),Q=d((e,r)=>{var s;if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",E(n,e,n)),v.set(n,O(n,e)),c.set(n,{id:E(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),o=e.edges();a.length>0?(i.debug("Cluster identified",n,v),o.forEach(l=>{const u=g(l.v,n),t=g(l.w,n);u^t&&(i.warn("Edge: ",l," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",v.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,v)});for(let n of c.keys()){const a=c.get(n).id,o=e.parent(a);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const l=e.edges().some(u=>u.v===n);if(a&&((s=c.get(n))!=null&&s.externalConnections)&&l&&L(e,a,n)){const u=T(e,n,e.parent(a));u&&(c.get(n).id=u)}}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let o=n.v,l=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),o=S(n.v),l=S(n.w),e.removeEdge(n.v,n.w,n.name),o!==n.v){const u=e.parent(o);c.get(u).externalConnections=!0,a.fromCluster=n.v}if(l!==n.w){const u=e.parent(l);c.get(u).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",o,l,n.name),e.setEdge(o,l,a,n.name)}}),i.warn("Adjusted Graph",b(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=d((e,r)=>{var a,o,l,u;if(i.warn("extractor - ",r,b(e),e.children("D")),r>10){i.error("Bailing out");return}let s=e.nodes(),n=!1;for(const t of s){const f=e.children(t);n=n||f.length>0}if(!n){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",s,r);for(const t of s)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if((o=(a=c.get(t))==null?void 0:a.clusterData)!=null&&o.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const f=c.get(t).clusterData.dir,w=new y({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,w,t);const m=e.node(t)||{};e.setNode(t,{...m,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:w}),i.warn("Subgraph for cluster with explicit dir created:",t,b(w))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let w=e.graph().rankdir==="TB"?"LR":"TB";(u=(l=c.get(t))==null?void 0:l.clusterData)!=null&&u.dir&&(w=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,w));const m=new y({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,m,t);const D=e.node(t)||{};e.setNode(t,{...D,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:m}),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);s=e.nodes(),i.warn("New list of nodes",s);for(const t of s){const f=e.node(t);i.warn(" Now next level",t,f),f!=null&&f.clusterNode&&k(f.graph,r+1)}},"extractor"),B=d((e,r)=>{if(r.length===0)return[];let s=Object.assign([],r);return r.forEach(n=>{const a=e.children(n),o=B(e,a);s=[...s,...o]}),s},"sorter"),U=d(e=>B(e,e.children()),"sortNodesByHierarchy"),L=d((e,r,s)=>{let n=e.parent(r);for(;n&&n!==s;){const a=c.get(n);if(a&&!a.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),T=d((e,r,s)=>{const n=e.children(r)??[];for(const a of n){if(a===s||g(a,s))continue;const o=E(a,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{Q as a,c as b,J as c,E as f,U as s,b as w}; +import{a as d,at as i}from"./mermaid.core-Byx96n1y.js";import{Q as C,G as y}from"../../chunks/graph-Dqkl27Ch.js";import{c as j,m as X}from"../../chunks/map-8WAJQ6ap.js";var p=4;function F(e){return j(e,p)}function b(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:R(e)};return C(e.graph())||(r.value=F(e.graph())),r}function M(e){return X(e.nodes(),function(r){var s=e.node(r),n=e.parent(r),a={v:r};return C(s)||(a.value=s),C(n)||(a.parent=n),a})}function R(e){return X(e.edges(),function(r){var s=e.edge(r),n={v:r.v,w:r.w};return C(r.name)||(n.name=r.name),C(s)||(n.value=s),n})}var c=new Map,v=new Map,A=new Map,J=d(()=>{v.clear(),A.clear(),c.clear()},"clear"),g=d((e,r)=>{const s=v.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),_=d((e,r)=>{const s=v.get(r)||[];return i.info("Descendants of ",r," is ",s),i.info("Edge is ",e),e.v===r||e.w===r?!1:s?s.includes(e.v)||g(e.v,r)||g(e.w,r)||s.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),x=d((e,r,s,n)=>{i.warn("Copying children of ",e,"root",n,"data",r.node(e),n);const a=r.children(e)||[];e!==n&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(o=>{if(r.children(o).length>0)x(o,r,s,n);else{const l=r.node(o);i.info("cp ",o," to ",n," with parent ",e),s.setNode(o,l),n!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),s.setParent(o,r.parent(o))),e!==n&&o!==e?(i.debug("Setting parent",o,e),s.setParent(o,e)):(i.info("In copy ",e,"root",n,"data",r.node(e),n),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==n,"node!==clusterId",o!==e));const u=r.edges(o);i.debug("Copying Edges",u),u.forEach(t=>{i.info("Edge",t);const f=r.edge(t.v,t.w,t.name);i.info("Edge data",f,n);try{if(_(t,n)){const w=v.get(n)||[],m=w.includes(t.v)||g(t.v,n)||t.v===n,D=w.includes(t.w)||g(t.w,n)||t.w===n;if(m&&D)i.info("Copying as ",t.v,t.w,f,t.name),s.setEdge(t.v,t.w,f,t.name),i.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]));else{const N=m?n:t.v,h=D?n:t.w;i.info("Rebinding cross-boundary edge as ",N,h,f,t.name),r.setEdge(N,h,f,t.name)}}else i.info("Skipping copy of edge ",t.v,"-->",t.w," rootId: ",n," clusterId:",e)}catch(w){i.error(w)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=d((e,r)=>{const s=r.children(e);let n=[...s];for(const a of s)A.set(a,e),n=[...n,...O(a,r)];return n},"extractDescendants"),P=d((e,r,s)=>{const n=e.edges().filter(t=>t.v===r||t.w===r),a=e.edges().filter(t=>t.v===s||t.w===s),o=n.map(t=>({v:t.v===r?s:t.v,w:t.w===r?r:t.w})),l=a.map(t=>({v:t.v,w:t.w}));return o.filter(t=>l.some(f=>t.v===f.v&&t.w===f.w))},"findCommonEdges"),E=d((e,r,s)=>{const n=r.children(e);if(i.trace("Searching children of id ",e,n),n.length<1)return e;let a;for(const o of n){const l=E(o,r,s),u=P(r,s,l);if(l)if(u.length>0)a=l;else return l}return a},"findNonClusterChild"),S=d(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),Q=d((e,r)=>{var s;if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",E(n,e,n)),v.set(n,O(n,e)),c.set(n,{id:E(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),o=e.edges();a.length>0?(i.debug("Cluster identified",n,v),o.forEach(l=>{const u=g(l.v,n),t=g(l.w,n);u^t&&(i.warn("Edge: ",l," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",v.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,v)});for(let n of c.keys()){const a=c.get(n).id,o=e.parent(a);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const l=e.edges().some(u=>u.v===n);if(a&&((s=c.get(n))!=null&&s.externalConnections)&&l&&L(e,a,n)){const u=T(e,n,e.parent(a));u&&(c.get(n).id=u)}}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let o=n.v,l=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),o=S(n.v),l=S(n.w),e.removeEdge(n.v,n.w,n.name),o!==n.v){const u=e.parent(o);c.get(u).externalConnections=!0,a.fromCluster=n.v}if(l!==n.w){const u=e.parent(l);c.get(u).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",o,l,n.name),e.setEdge(o,l,a,n.name)}}),i.warn("Adjusted Graph",b(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=d((e,r)=>{var a,o,l,u;if(i.warn("extractor - ",r,b(e),e.children("D")),r>10){i.error("Bailing out");return}let s=e.nodes(),n=!1;for(const t of s){const f=e.children(t);n=n||f.length>0}if(!n){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",s,r);for(const t of s)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if((o=(a=c.get(t))==null?void 0:a.clusterData)!=null&&o.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const f=c.get(t).clusterData.dir,w=new y({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,w,t);const m=e.node(t)||{};e.setNode(t,{...m,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:w}),i.warn("Subgraph for cluster with explicit dir created:",t,b(w))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let w=e.graph().rankdir==="TB"?"LR":"TB";(u=(l=c.get(t))==null?void 0:l.clusterData)!=null&&u.dir&&(w=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,w));const m=new y({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,m,t);const D=e.node(t)||{};e.setNode(t,{...D,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:m}),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);s=e.nodes(),i.warn("New list of nodes",s);for(const t of s){const f=e.node(t);i.warn(" Now next level",t,f),f!=null&&f.clusterNode&&k(f.graph,r+1)}},"extractor"),B=d((e,r)=>{if(r.length===0)return[];let s=Object.assign([],r);return r.forEach(n=>{const a=e.children(n),o=B(e,a);s=[...s,...o]}),s},"sorter"),U=d(e=>B(e,e.children()),"sortNodesByHierarchy"),L=d((e,r,s)=>{let n=e.parent(r);for(;n&&n!==s;){const a=c.get(n);if(a&&!a.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),T=d((e,r,s)=>{const n=e.children(r)??[];for(const a of n){if(a===s||g(a,s))continue;const o=E(a,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{Q as a,c as b,J as c,E as f,U as s,b as w}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DWj8dVYC.js b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DF1LpnDY.js similarity index 53% rename from veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DWj8dVYC.js rename to veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DF1LpnDY.js index b3551de15..0a0ee05c1 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DWj8dVYC.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DF1LpnDY.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-DnksLuoJ.js";import{aB as o}from"../../app/index-DZf0wXGZ.js";var d=n((t,e)=>{let a;return e==="sandbox"&&(a=o("#i"+t)),(e==="sandbox"?o(a.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{a as n}from"./mermaid.core-Byx96n1y.js";import{aB as o}from"../../app/index-y89rQfXU.js";var d=n((t,e)=>{let a;return e==="sandbox"&&(a=o("#i"+t)),(e==="sandbox"?o(a.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js deleted file mode 100644 index a8c6ae154..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-BsdMVsbj.js";import{a as i}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"./chunk-5VM5RSS4-CjM7JLQ8.js";import"./chunk-XXDRQBXY-DWj8dVYC.js";import"./chunk-KBJHAD2P-CNEAUy5I.js";import"./chunk-2GRJ4B5K-CJwzhEYx.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B86LdNwl.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B86LdNwl.js new file mode 100644 index 000000000..137a7417c --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B86LdNwl.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CdzaapU0.js";import{a as i}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"./chunk-5VM5RSS4-0VUj4cdX.js";import"./chunk-XXDRQBXY-DF1LpnDY.js";import"./chunk-KBJHAD2P-BwJsQpfI.js";import"./chunk-2GRJ4B5K-w7u93fzV.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js deleted file mode 100644 index a8c6ae154..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-BsdMVsbj.js";import{a as i}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"./chunk-5VM5RSS4-CjM7JLQ8.js";import"./chunk-XXDRQBXY-DWj8dVYC.js";import"./chunk-KBJHAD2P-CNEAUy5I.js";import"./chunk-2GRJ4B5K-CJwzhEYx.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B86LdNwl.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B86LdNwl.js new file mode 100644 index 000000000..137a7417c --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B86LdNwl.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CdzaapU0.js";import{a as i}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"./chunk-5VM5RSS4-0VUj4cdX.js";import"./chunk-XXDRQBXY-DF1LpnDY.js";import"./chunk-KBJHAD2P-BwJsQpfI.js";import"./chunk-2GRJ4B5K-w7u93fzV.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-GA0ao5B_.js b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BwttPwJa.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-GA0ao5B_.js rename to veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BwttPwJa.js index c9b9353ba..bd662a346 100644 --- a/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-GA0ao5B_.js +++ b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BwttPwJa.js @@ -1 +1 @@ -import{a as V,at as k}from"./mermaid.core-DnksLuoJ.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as $,a8 as lt,aB as gt}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt={exports:{}},Z={exports:{}},Q={exports:{}},q;function ut(){return q||(q=1,function(G,b){(function(I,T){G.exports=T()})($,function(){return function(N){var I={};function T(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)}([function(N,I,T){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o},function(N,I,T){var o=T(2),e=T(8),t=T(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i},function(N,I,T){function o(e){this.vGraphObject=e}N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n},function(N,I,T){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var E=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,E=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,E,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;my&&(v=y),Ds&&(u=s),Ey&&(v=y),Ds&&(u=s),E=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h},function(N,I,T){var o,e=T(1);function t(i){o=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,C=!0):(l[0]=p,l[1]=a,C=!0):S===w&&(g>d?(l[0]=h,l[1]=a,C=!0):(l[0]=u,l[1]=D,C=!0)),-Y===w?d>g?(l[2]=c,l[3]=L,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=L,M=!0)),C&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!C)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+E*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-E*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-R/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=L,_=d+R/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o},function(N,I,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o},function(N,I,T){var o=function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e},function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(R,1)}E=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(L,1);var A=O.getNeighborsList();A.forEach(function(C){if(v.indexOf(C)<0){var M=D.get(C),S=M-1;S==1&&f.push(C),D.set(C,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h},function(N,I,T){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o},function(N,I,T){var o=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e},function(N,I,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;ay||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l}();N.exports=i},function(N,I,T){var o=function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.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),g.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},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.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%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.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=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var C;for(C=0;CL&&(L=Math.floor(R.y)),m=Math.floor(R.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-R.x/2,r.WORLD_CENTER_Y-R.y/2))},y.radialLayout=function(s,f,c){var L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var R=0;R1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(L-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],L=this.graphManager.getAllNodes(),A=0;A"u"&&(f[C]=[]),f[C]=f[C].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var L=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,L=0;LM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(C,M){return C.rect.width*C.rect.height>M.rect.width*M.rect.height?-1:C.rect.width*C.rect.height0&&(R+=s.horizontalPadding),s.rowWidth[c]=R,s.width0&&(C+=s.verticalPadding);var M=0;C>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=C,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,L=0;Lc&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]0&&(m=c+s.verticalPadding-s.rowHeight[L]);var R;s.width-A>=f+s.horizontalPadding?R=(s.height+m)/(A+f+s.horizontalPadding):R=(s.height+m)/s.width,m=c+s.verticalPadding;var C;return s.widthm&&f!=c){L.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;CR&&(R=L[C].height);f>0&&(R+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=R,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(m0)for(var F=R;F<=C;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var C;C=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(C,f,E)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v}])})})(tt);var ct=tt.exports;const pt=lt(ct);J.use(pt);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=J({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var dt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:T,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Tt=dt;export{Tt as render}; +import{a as V,at as k}from"./mermaid.core-Byx96n1y.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as $,a8 as lt,aB as gt}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt={exports:{}},Z={exports:{}},Q={exports:{}},q;function ut(){return q||(q=1,function(G,b){(function(I,T){G.exports=T()})($,function(){return function(N){var I={};function T(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)}([function(N,I,T){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o},function(N,I,T){var o=T(2),e=T(8),t=T(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i},function(N,I,T){function o(e){this.vGraphObject=e}N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n},function(N,I,T){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var E=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,E=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,E,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;my&&(v=y),Ds&&(u=s),Ey&&(v=y),Ds&&(u=s),E=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h},function(N,I,T){var o,e=T(1);function t(i){o=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,C=!0):(l[0]=p,l[1]=a,C=!0):S===w&&(g>d?(l[0]=h,l[1]=a,C=!0):(l[0]=u,l[1]=D,C=!0)),-Y===w?d>g?(l[2]=c,l[3]=L,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=L,M=!0)),C&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!C)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+E*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-E*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-R/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=L,_=d+R/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o},function(N,I,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o},function(N,I,T){var o=function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e},function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(R,1)}E=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(L,1);var A=O.getNeighborsList();A.forEach(function(C){if(v.indexOf(C)<0){var M=D.get(C),S=M-1;S==1&&f.push(C),D.set(C,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h},function(N,I,T){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o},function(N,I,T){var o=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e},function(N,I,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;ay||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l}();N.exports=i},function(N,I,T){var o=function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.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),g.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},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.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%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.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=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var C;for(C=0;CL&&(L=Math.floor(R.y)),m=Math.floor(R.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-R.x/2,r.WORLD_CENTER_Y-R.y/2))},y.radialLayout=function(s,f,c){var L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var R=0;R1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(L-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],L=this.graphManager.getAllNodes(),A=0;A"u"&&(f[C]=[]),f[C]=f[C].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var L=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,L=0;LM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(C,M){return C.rect.width*C.rect.height>M.rect.width*M.rect.height?-1:C.rect.width*C.rect.height0&&(R+=s.horizontalPadding),s.rowWidth[c]=R,s.width0&&(C+=s.verticalPadding);var M=0;C>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=C,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,L=0;Lc&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]0&&(m=c+s.verticalPadding-s.rowHeight[L]);var R;s.width-A>=f+s.horizontalPadding?R=(s.height+m)/(A+f+s.horizontalPadding):R=(s.height+m)/s.width,m=c+s.verticalPadding;var C;return s.widthm&&f!=c){L.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;CR&&(R=L[C].height);f>0&&(R+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=R,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(m0)for(var F=R;F<=C;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var C;C=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(C,f,E)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v}])})})(tt);var ct=tt.exports;const pt=lt(ct);J.use(pt);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=J({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var dt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:T,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Tt=dt;export{Tt as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DAp7f4c2.js b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-CfYIu5D_.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DAp7f4c2.js rename to veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-CfYIu5D_.js index ed1ce6928..7f5f55956 100644 --- a/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DAp7f4c2.js +++ b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-CfYIu5D_.js @@ -1,4 +1,4 @@ -var dk=Object.defineProperty;var pk=(t,e,r)=>e in t?dk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Br=(t,e,r)=>pk(t,typeof e!="symbol"?e+"":e,r);import{_ as ut}from"../../app/index-DZf0wXGZ.js";var mk=Object.create,Du=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,Th=Object.getOwnPropertyNames,yk=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,s=(t,e)=>Du(t,"name",{value:e,configurable:!0}),vk=(t,e)=>function(){return t&&(e=(0,t[Th(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[Th(t)[0]])((e={exports:{}}).exports,e),e.exports},tn=(t,e)=>{for(var r in e)Du(t,r,{get:e[r],enumerable:!0})},$h=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Th(e))!gk.call(t,a)&&a!==r&&Du(t,a,{get:()=>e[a],enumerable:!(n=hk(e,a))||n.enumerable});return t},Of=(t,e,r)=>($h(t,e,"default"),r),Rh=(t,e,r)=>(r=t!=null?mk(yk(t)):{},$h(Du(r,"default",{value:t,enumerable:!0}),t)),Ah=t=>$h(Du({},"__esModule",{value:!0}),t),Lf={};tn(Lf,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>mn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Qp,CodeActionContext:()=>Zp,CodeActionKind:()=>Jp,CodeActionTriggerKind:()=>Xl,CodeDescription:()=>Ip,CodeLens:()=>em,Color:()=>Ec,ColorInformation:()=>Ep,ColorPresentation:()=>Cp,Command:()=>pn,CompletionItem:()=>Fp,CompletionItemKind:()=>Op,CompletionItemLabelDetails:()=>Gp,CompletionItemTag:()=>Dp,CompletionList:()=>zp,CreateFile:()=>_a,DeleteFile:()=>wa,Diagnostic:()=>Vl,DiagnosticRelatedInformation:()=>Cc,DiagnosticSeverity:()=>Sp,DiagnosticTag:()=>wp,DocumentHighlight:()=>Wp,DocumentHighlightKind:()=>Kp,DocumentLink:()=>rm,DocumentSymbol:()=>Xp,DocumentUri:()=>$p,EOL:()=>x$,FoldingRange:()=>_p,FoldingRangeKind:()=>bp,FormattingOptions:()=>tm,Hover:()=>jp,InlayHint:()=>fm,InlayHintKind:()=>Sc,InlayHintLabelPart:()=>wc,InlineCompletionContext:()=>gm,InlineCompletionItem:()=>pm,InlineCompletionList:()=>mm,InlineCompletionTriggerKind:()=>hm,InlineValueContext:()=>cm,InlineValueEvaluatableExpression:()=>um,InlineValueText:()=>om,InlineValueVariableLookup:()=>lm,InsertReplaceEdit:()=>Mp,InsertTextFormat:()=>Lp,InsertTextMode:()=>xp,Location:()=>Wl,LocationLink:()=>Ap,MarkedString:()=>Yl,MarkupContent:()=>Ia,MarkupKind:()=>_c,OptionalVersionedTextDocumentIdentifier:()=>Hl,ParameterInformation:()=>Bp,Position:()=>oe,Range:()=>te,RenameFile:()=>Sa,SelectedCompletionInfo:()=>ym,SelectionRange:()=>nm,SemanticTokenModifiers:()=>im,SemanticTokenTypes:()=>am,SemanticTokens:()=>sm,SignatureInformation:()=>Up,StringValue:()=>dm,SymbolInformation:()=>Hp,SymbolKind:()=>Vp,SymbolTag:()=>qp,TextDocument:()=>Tm,TextDocumentEdit:()=>ql,TextDocumentIdentifier:()=>Np,TextDocumentItem:()=>kp,TextEdit:()=>ar,URI:()=>Ac,VersionedTextDocumentIdentifier:()=>Pp,WorkspaceChange:()=>M$,WorkspaceEdit:()=>bc,WorkspaceFolder:()=>vm,WorkspaceSymbol:()=>Yp,integer:()=>Rp,uinteger:()=>Kl});var $p,Ac,Rp,Kl,oe,te,Wl,Ap,Ec,Ep,Cp,bp,_p,Cc,Sp,wp,Ip,Vl,pn,ar,mn,et,Ar,ql,_a,Sa,wa,bc,kl,Ud,M$,Np,Pp,Hl,kp,_c,Ia,Op,Lp,Dp,Mp,xp,Gp,Fp,zp,Yl,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Jp,Xl,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,cm,Sc,wc,fm,dm,pm,mm,hm,ym,gm,vm,x$,Tm,iv,C,Mu=vk({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})($p||($p={})),function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i}(Ac||(Ac={})),function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Rp||(Rp={})),function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Kl||(Kl={})),function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Kl.MAX_VALUE),l===Number.MAX_VALUE&&(l=Kl.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&C.uinteger(l.line)&&C.uinteger(l.character)}s(o,"is"),a.is=o}(oe||(oe={})),function(a){function i(u,l,c,f){if(C.uinteger(u)&&C.uinteger(l)&&C.uinteger(c)&&C.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o}(te||(te={})),function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(C.string(l.uri)||C.undefined(l.uri))}s(o,"is"),a.is=o}(Wl||(Wl={})),function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.targetRange)&&C.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||C.undefined(l.originSelectionRange))}s(o,"is"),a.is=o}(Ap||(Ap={})),function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.numberRange(l.red,0,1)&&C.numberRange(l.green,0,1)&&C.numberRange(l.blue,0,1)&&C.numberRange(l.alpha,0,1)}s(o,"is"),a.is=o}(Ec||(Ec={})),function(a){function i(u,l){return{range:u,color:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&te.is(l.range)&&Ec.is(l.color)}s(o,"is"),a.is=o}(Ep||(Ep={})),function(a){function i(u,l,c){return{label:u,textEdit:l,additionalTextEdits:c}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.undefined(l.textEdit)||ar.is(l))&&(C.undefined(l.additionalTextEdits)||C.typedArray(l.additionalTextEdits,ar.is))}s(o,"is"),a.is=o}(Cp||(Cp={})),function(a){a.Comment="comment",a.Imports="imports",a.Region="region"}(bp||(bp={})),function(a){function i(u,l,c,f,d,p){const h={startLine:u,endLine:l};return C.defined(c)&&(h.startCharacter=c),C.defined(f)&&(h.endCharacter=f),C.defined(d)&&(h.kind=d),C.defined(p)&&(h.collapsedText=p),h}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.uinteger(l.startLine)&&C.uinteger(l.startLine)&&(C.undefined(l.startCharacter)||C.uinteger(l.startCharacter))&&(C.undefined(l.endCharacter)||C.uinteger(l.endCharacter))&&(C.undefined(l.kind)||C.string(l.kind))}s(o,"is"),a.is=o}(_p||(_p={})),function(a){function i(u,l){return{location:u,message:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Wl.is(l.location)&&C.string(l.message)}s(o,"is"),a.is=o}(Cc||(Cc={})),function(a){a.Error=1,a.Warning=2,a.Information=3,a.Hint=4}(Sp||(Sp={})),function(a){a.Unnecessary=1,a.Deprecated=2}(wp||(wp={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&C.string(u.href)}s(i,"is"),a.is=i}(Ip||(Ip={})),function(a){function i(u,l,c,f,d,p){let h={range:u,message:l};return C.defined(c)&&(h.severity=c),C.defined(f)&&(h.code=f),C.defined(d)&&(h.source=d),C.defined(p)&&(h.relatedInformation=p),h}s(i,"create"),a.create=i;function o(u){var l;let c=u;return C.defined(c)&&te.is(c.range)&&C.string(c.message)&&(C.number(c.severity)||C.undefined(c.severity))&&(C.integer(c.code)||C.string(c.code)||C.undefined(c.code))&&(C.undefined(c.codeDescription)||C.string((l=c.codeDescription)===null||l===void 0?void 0:l.href))&&(C.string(c.source)||C.undefined(c.source))&&(C.undefined(c.relatedInformation)||C.typedArray(c.relatedInformation,Cc.is))}s(o,"is"),a.is=o}(Vl||(Vl={})),function(a){function i(u,l,...c){let f={title:u,command:l};return C.defined(c)&&c.length>0&&(f.arguments=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.title)&&C.string(l.command)}s(o,"is"),a.is=o}(pn||(pn={})),function(a){function i(c,f){return{range:c,newText:f}}s(i,"replace"),a.replace=i;function o(c,f){return{range:{start:c,end:c},newText:f}}s(o,"insert"),a.insert=o;function u(c){return{range:c,newText:""}}s(u,"del"),a.del=u;function l(c){const f=c;return C.objectLiteral(f)&&C.string(f.newText)&&te.is(f.range)}s(l,"is"),a.is=l}(ar||(ar={})),function(a){function i(u,l,c){const f={label:u};return l!==void 0&&(f.needsConfirmation=l),c!==void 0&&(f.description=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(C.string(l.description)||l.description===void 0)}s(o,"is"),a.is=o}(mn||(mn={})),function(a){function i(o){const u=o;return C.string(u)}s(i,"is"),a.is=i}(et||(et={})),function(a){function i(c,f,d){return{range:c,newText:f,annotationId:d}}s(i,"replace"),a.replace=i;function o(c,f,d){return{range:{start:c,end:c},newText:f,annotationId:d}}s(o,"insert"),a.insert=o;function u(c,f){return{range:c,newText:"",annotationId:f}}s(u,"del"),a.del=u;function l(c){const f=c;return ar.is(f)&&(mn.is(f.annotationId)||et.is(f.annotationId))}s(l,"is"),a.is=l}(Ar||(Ar={})),function(a){function i(u,l){return{textDocument:u,edits:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Hl.is(l.textDocument)&&Array.isArray(l.edits)}s(o,"is"),a.is=o}(ql||(ql={})),function(a){function i(u,l,c){let f={kind:"create",uri:u};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="create"&&C.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(_a||(_a={})),function(a){function i(u,l,c,f){let d={kind:"rename",oldUri:u,newUri:l};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(d.options=c),f!==void 0&&(d.annotationId=f),d}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="rename"&&C.string(l.oldUri)&&C.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(Sa||(Sa={})),function(a){function i(u,l,c){let f={kind:"delete",uri:u};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="delete"&&C.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||C.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||C.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(wa||(wa={})),function(a){function i(o){let u=o;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(l=>C.string(l.kind)?_a.is(l)||Sa.is(l)||wa.is(l):ql.is(l)))}s(i,"is"),a.is=i}(bc||(bc={})),kl=(t=class{constructor(i,o){this.edits=i,this.changeAnnotations=o}insert(i,o,u){let l,c;if(u===void 0?l=ar.insert(i,o):et.is(u)?(c=u,l=Ar.insert(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.insert(i,o,c)),this.edits.push(l),c!==void 0)return c}replace(i,o,u){let l,c;if(u===void 0?l=ar.replace(i,o):et.is(u)?(c=u,l=Ar.replace(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.replace(i,o,c)),this.edits.push(l),c!==void 0)return c}delete(i,o){let u,l;if(o===void 0?u=ar.del(i):et.is(o)?(l=o,u=Ar.del(i,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),u=Ar.del(i,l)),this.edits.push(u),l!==void 0)return l}add(i){this.edits.push(i)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(i){if(i===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},s(t,"TextEditChangeImpl"),t),Ud=(e=class{constructor(i){this._annotations=i===void 0?Object.create(null):i,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(i,o){let u;if(et.is(i)?u=i:(u=this.nextId(),o=i),this._annotations[u]!==void 0)throw new Error(`Id ${u} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${u}`);return this._annotations[u]=o,this._size++,u}nextId(){return this._counter++,this._counter.toString()}},s(e,"ChangeAnnotations"),e),M$=(r=class{constructor(i){this._textEditChanges=Object.create(null),i!==void 0?(this._workspaceEdit=i,i.documentChanges?(this._changeAnnotations=new Ud(i.changeAnnotations),i.changeAnnotations=this._changeAnnotations.all(),i.documentChanges.forEach(o=>{if(ql.is(o)){const u=new kl(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=u}})):i.changes&&Object.keys(i.changes).forEach(o=>{const u=new kl(i.changes[o]);this._textEditChanges[o]=u})):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(i){if(Hl.is(i)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:i.uri,version:i.version};let u=this._textEditChanges[o.uri];if(!u){const l=[],c={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(c),u=new kl(l,this._changeAnnotations),this._textEditChanges[o.uri]=u}return u}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[i];if(!o){let u=[];this._workspaceEdit.changes[i]=u,o=new kl(u),this._textEditChanges[i]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ud,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(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=_a.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=_a.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}renameFile(i,o,u,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let c;mn.is(u)||et.is(u)?c=u:l=u;let f,d;if(c===void 0?f=Sa.create(i,o,l):(d=et.is(c)?c:this._changeAnnotations.manage(c),f=Sa.create(i,o,l,d)),this._workspaceEdit.documentChanges.push(f),d!==void 0)return d}deleteFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=wa.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=wa.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}},s(r,"WorkspaceChange"),r),function(a){function i(u){return{uri:u}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)}s(o,"is"),a.is=o}(Np||(Np={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.integer(l.version)}s(o,"is"),a.is=o}(Pp||(Pp={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&(l.version===null||C.integer(l.version))}s(o,"is"),a.is=o}(Hl||(Hl={})),function(a){function i(u,l,c,f){return{uri:u,languageId:l,version:c,text:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.string(l.languageId)&&C.integer(l.version)&&C.string(l.text)}s(o,"is"),a.is=o}(kp||(kp={})),function(a){a.PlainText="plaintext",a.Markdown="markdown";function i(o){const u=o;return u===a.PlainText||u===a.Markdown}s(i,"is"),a.is=i}(_c||(_c={})),function(a){function i(o){const u=o;return C.objectLiteral(o)&&_c.is(u.kind)&&C.string(u.value)}s(i,"is"),a.is=i}(Ia||(Ia={})),function(a){a.Text=1,a.Method=2,a.Function=3,a.Constructor=4,a.Field=5,a.Variable=6,a.Class=7,a.Interface=8,a.Module=9,a.Property=10,a.Unit=11,a.Value=12,a.Enum=13,a.Keyword=14,a.Snippet=15,a.Color=16,a.File=17,a.Reference=18,a.Folder=19,a.EnumMember=20,a.Constant=21,a.Struct=22,a.Event=23,a.Operator=24,a.TypeParameter=25}(Op||(Op={})),function(a){a.PlainText=1,a.Snippet=2}(Lp||(Lp={})),function(a){a.Deprecated=1}(Dp||(Dp={})),function(a){function i(u,l,c){return{newText:u,insert:l,replace:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l&&C.string(l.newText)&&te.is(l.insert)&&te.is(l.replace)}s(o,"is"),a.is=o}(Mp||(Mp={})),function(a){a.asIs=1,a.adjustIndentation=2}(xp||(xp={})),function(a){function i(o){const u=o;return u&&(C.string(u.detail)||u.detail===void 0)&&(C.string(u.description)||u.description===void 0)}s(i,"is"),a.is=i}(Gp||(Gp={})),function(a){function i(o){return{label:o}}s(i,"create"),a.create=i}(Fp||(Fp={})),function(a){function i(o,u){return{items:o||[],isIncomplete:!!u}}s(i,"create"),a.create=i}(zp||(zp={})),function(a){function i(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(i,"fromPlainText"),a.fromPlainText=i;function o(u){const l=u;return C.string(l)||C.objectLiteral(l)&&C.string(l.language)&&C.string(l.value)}s(o,"is"),a.is=o}(Yl||(Yl={})),function(a){function i(o){let u=o;return!!u&&C.objectLiteral(u)&&(Ia.is(u.contents)||Yl.is(u.contents)||C.typedArray(u.contents,Yl.is))&&(o.range===void 0||te.is(o.range))}s(i,"is"),a.is=i}(jp||(jp={})),function(a){function i(o,u){return u?{label:o,documentation:u}:{label:o}}s(i,"create"),a.create=i}(Bp||(Bp={})),function(a){function i(o,u,...l){let c={label:o};return C.defined(u)&&(c.documentation=u),C.defined(l)?c.parameters=l:c.parameters=[],c}s(i,"create"),a.create=i}(Up||(Up={})),function(a){a.Text=1,a.Read=2,a.Write=3}(Kp||(Kp={})),function(a){function i(o,u){let l={range:o};return C.number(u)&&(l.kind=u),l}s(i,"create"),a.create=i}(Wp||(Wp={})),function(a){a.File=1,a.Module=2,a.Namespace=3,a.Package=4,a.Class=5,a.Method=6,a.Property=7,a.Field=8,a.Constructor=9,a.Enum=10,a.Interface=11,a.Function=12,a.Variable=13,a.Constant=14,a.String=15,a.Number=16,a.Boolean=17,a.Array=18,a.Object=19,a.Key=20,a.Null=21,a.EnumMember=22,a.Struct=23,a.Event=24,a.Operator=25,a.TypeParameter=26}(Vp||(Vp={})),function(a){a.Deprecated=1}(qp||(qp={})),function(a){function i(o,u,l,c,f){let d={name:o,kind:u,location:{uri:c,range:l}};return f&&(d.containerName=f),d}s(i,"create"),a.create=i}(Hp||(Hp={})),function(a){function i(o,u,l,c){return c!==void 0?{name:o,kind:u,location:{uri:l,range:c}}:{name:o,kind:u,location:{uri:l}}}s(i,"create"),a.create=i}(Yp||(Yp={})),function(a){function i(u,l,c,f,d,p){let h={name:u,detail:l,kind:c,range:f,selectionRange:d};return p!==void 0&&(h.children=p),h}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.name)&&C.number(l.kind)&&te.is(l.range)&&te.is(l.selectionRange)&&(l.detail===void 0||C.string(l.detail))&&(l.deprecated===void 0||C.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}s(o,"is"),a.is=o}(Xp||(Xp={})),function(a){a.Empty="",a.QuickFix="quickfix",a.Refactor="refactor",a.RefactorExtract="refactor.extract",a.RefactorInline="refactor.inline",a.RefactorRewrite="refactor.rewrite",a.Source="source",a.SourceOrganizeImports="source.organizeImports",a.SourceFixAll="source.fixAll"}(Jp||(Jp={})),function(a){a.Invoked=1,a.Automatic=2}(Xl||(Xl={})),function(a){function i(u,l,c){let f={diagnostics:u};return l!=null&&(f.only=l),c!=null&&(f.triggerKind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.typedArray(l.diagnostics,Vl.is)&&(l.only===void 0||C.typedArray(l.only,C.string))&&(l.triggerKind===void 0||l.triggerKind===Xl.Invoked||l.triggerKind===Xl.Automatic)}s(o,"is"),a.is=o}(Zp||(Zp={})),function(a){function i(u,l,c){let f={title:u},d=!0;return typeof l=="string"?(d=!1,f.kind=l):pn.is(l)?f.command=l:f.edit=l,d&&c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.title)&&(l.diagnostics===void 0||C.typedArray(l.diagnostics,Vl.is))&&(l.kind===void 0||C.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pn.is(l.command))&&(l.isPreferred===void 0||C.boolean(l.isPreferred))&&(l.edit===void 0||bc.is(l.edit))}s(o,"is"),a.is=o}(Qp||(Qp={})),function(a){function i(u,l){let c={range:u};return C.defined(l)&&(c.data=l),c}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.command)||pn.is(l.command))}s(o,"is"),a.is=o}(em||(em={})),function(a){function i(u,l){return{tabSize:u,insertSpaces:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.uinteger(l.tabSize)&&C.boolean(l.insertSpaces)}s(o,"is"),a.is=o}(tm||(tm={})),function(a){function i(u,l,c){return{range:u,target:l,data:c}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.target)||C.string(l.target))}s(o,"is"),a.is=o}(rm||(rm={})),function(a){function i(u,l){return{range:u,parent:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(l.parent===void 0||a.is(l.parent))}s(o,"is"),a.is=o}(nm||(nm={})),function(a){a.namespace="namespace",a.type="type",a.class="class",a.enum="enum",a.interface="interface",a.struct="struct",a.typeParameter="typeParameter",a.parameter="parameter",a.variable="variable",a.property="property",a.enumMember="enumMember",a.event="event",a.function="function",a.method="method",a.macro="macro",a.keyword="keyword",a.modifier="modifier",a.comment="comment",a.string="string",a.number="number",a.regexp="regexp",a.operator="operator",a.decorator="decorator"}(am||(am={})),function(a){a.declaration="declaration",a.definition="definition",a.readonly="readonly",a.static="static",a.deprecated="deprecated",a.abstract="abstract",a.async="async",a.modification="modification",a.documentation="documentation",a.defaultLibrary="defaultLibrary"}(im||(im={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}s(i,"is"),a.is=i}(sm||(sm={})),function(a){function i(u,l){return{range:u,text:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.string(l.text)}s(o,"is"),a.is=o}(om||(om={})),function(a){function i(u,l,c){return{range:u,variableName:l,caseSensitiveLookup:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.boolean(l.caseSensitiveLookup)&&(C.string(l.variableName)||l.variableName===void 0)}s(o,"is"),a.is=o}(lm||(lm={})),function(a){function i(u,l){return{range:u,expression:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&(C.string(l.expression)||l.expression===void 0)}s(o,"is"),a.is=o}(um||(um={})),function(a){function i(u,l){return{frameId:u,stoppedLocation:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.defined(l)&&te.is(u.stoppedLocation)}s(o,"is"),a.is=o}(cm||(cm={})),function(a){a.Type=1,a.Parameter=2;function i(o){return o===1||o===2}s(i,"is"),a.is=i}(Sc||(Sc={})),function(a){function i(u){return{value:u}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.location===void 0||Wl.is(l.location))&&(l.command===void 0||pn.is(l.command))}s(o,"is"),a.is=o}(wc||(wc={})),function(a){function i(u,l,c){const f={position:u,label:l};return c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&oe.is(l.position)&&(C.string(l.label)||C.typedArray(l.label,wc.is))&&(l.kind===void 0||Sc.is(l.kind))&&l.textEdits===void 0||C.typedArray(l.textEdits,ar.is)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.paddingLeft===void 0||C.boolean(l.paddingLeft))&&(l.paddingRight===void 0||C.boolean(l.paddingRight))}s(o,"is"),a.is=o}(fm||(fm={})),function(a){function i(o){return{kind:"snippet",value:o}}s(i,"createSnippet"),a.createSnippet=i}(dm||(dm={})),function(a){function i(o,u,l,c){return{insertText:o,filterText:u,range:l,command:c}}s(i,"create"),a.create=i}(pm||(pm={})),function(a){function i(o){return{items:o}}s(i,"create"),a.create=i}(mm||(mm={})),function(a){a.Invoked=0,a.Automatic=1}(hm||(hm={})),function(a){function i(o,u){return{range:o,text:u}}s(i,"create"),a.create=i}(ym||(ym={})),function(a){function i(o,u){return{triggerKind:o,selectedCompletionInfo:u}}s(i,"create"),a.create=i}(gm||(gm={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&Ac.is(u.uri)&&C.string(u.name)}s(i,"is"),a.is=i}(vm||(vm={})),x$=[` +var dk=Object.defineProperty;var pk=(t,e,r)=>e in t?dk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Br=(t,e,r)=>pk(t,typeof e!="symbol"?e+"":e,r);import{_ as ut}from"../../app/index-y89rQfXU.js";var mk=Object.create,Du=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,Th=Object.getOwnPropertyNames,yk=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,s=(t,e)=>Du(t,"name",{value:e,configurable:!0}),vk=(t,e)=>function(){return t&&(e=(0,t[Th(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[Th(t)[0]])((e={exports:{}}).exports,e),e.exports},tn=(t,e)=>{for(var r in e)Du(t,r,{get:e[r],enumerable:!0})},$h=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Th(e))!gk.call(t,a)&&a!==r&&Du(t,a,{get:()=>e[a],enumerable:!(n=hk(e,a))||n.enumerable});return t},Of=(t,e,r)=>($h(t,e,"default"),r),Rh=(t,e,r)=>(r=t!=null?mk(yk(t)):{},$h(Du(r,"default",{value:t,enumerable:!0}),t)),Ah=t=>$h(Du({},"__esModule",{value:!0}),t),Lf={};tn(Lf,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>mn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Qp,CodeActionContext:()=>Zp,CodeActionKind:()=>Jp,CodeActionTriggerKind:()=>Xl,CodeDescription:()=>Ip,CodeLens:()=>em,Color:()=>Ec,ColorInformation:()=>Ep,ColorPresentation:()=>Cp,Command:()=>pn,CompletionItem:()=>Fp,CompletionItemKind:()=>Op,CompletionItemLabelDetails:()=>Gp,CompletionItemTag:()=>Dp,CompletionList:()=>zp,CreateFile:()=>_a,DeleteFile:()=>wa,Diagnostic:()=>Vl,DiagnosticRelatedInformation:()=>Cc,DiagnosticSeverity:()=>Sp,DiagnosticTag:()=>wp,DocumentHighlight:()=>Wp,DocumentHighlightKind:()=>Kp,DocumentLink:()=>rm,DocumentSymbol:()=>Xp,DocumentUri:()=>$p,EOL:()=>x$,FoldingRange:()=>_p,FoldingRangeKind:()=>bp,FormattingOptions:()=>tm,Hover:()=>jp,InlayHint:()=>fm,InlayHintKind:()=>Sc,InlayHintLabelPart:()=>wc,InlineCompletionContext:()=>gm,InlineCompletionItem:()=>pm,InlineCompletionList:()=>mm,InlineCompletionTriggerKind:()=>hm,InlineValueContext:()=>cm,InlineValueEvaluatableExpression:()=>um,InlineValueText:()=>om,InlineValueVariableLookup:()=>lm,InsertReplaceEdit:()=>Mp,InsertTextFormat:()=>Lp,InsertTextMode:()=>xp,Location:()=>Wl,LocationLink:()=>Ap,MarkedString:()=>Yl,MarkupContent:()=>Ia,MarkupKind:()=>_c,OptionalVersionedTextDocumentIdentifier:()=>Hl,ParameterInformation:()=>Bp,Position:()=>oe,Range:()=>te,RenameFile:()=>Sa,SelectedCompletionInfo:()=>ym,SelectionRange:()=>nm,SemanticTokenModifiers:()=>im,SemanticTokenTypes:()=>am,SemanticTokens:()=>sm,SignatureInformation:()=>Up,StringValue:()=>dm,SymbolInformation:()=>Hp,SymbolKind:()=>Vp,SymbolTag:()=>qp,TextDocument:()=>Tm,TextDocumentEdit:()=>ql,TextDocumentIdentifier:()=>Np,TextDocumentItem:()=>kp,TextEdit:()=>ar,URI:()=>Ac,VersionedTextDocumentIdentifier:()=>Pp,WorkspaceChange:()=>M$,WorkspaceEdit:()=>bc,WorkspaceFolder:()=>vm,WorkspaceSymbol:()=>Yp,integer:()=>Rp,uinteger:()=>Kl});var $p,Ac,Rp,Kl,oe,te,Wl,Ap,Ec,Ep,Cp,bp,_p,Cc,Sp,wp,Ip,Vl,pn,ar,mn,et,Ar,ql,_a,Sa,wa,bc,kl,Ud,M$,Np,Pp,Hl,kp,_c,Ia,Op,Lp,Dp,Mp,xp,Gp,Fp,zp,Yl,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Jp,Xl,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,cm,Sc,wc,fm,dm,pm,mm,hm,ym,gm,vm,x$,Tm,iv,C,Mu=vk({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})($p||($p={})),function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i}(Ac||(Ac={})),function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Rp||(Rp={})),function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Kl||(Kl={})),function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Kl.MAX_VALUE),l===Number.MAX_VALUE&&(l=Kl.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&C.uinteger(l.line)&&C.uinteger(l.character)}s(o,"is"),a.is=o}(oe||(oe={})),function(a){function i(u,l,c,f){if(C.uinteger(u)&&C.uinteger(l)&&C.uinteger(c)&&C.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o}(te||(te={})),function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(C.string(l.uri)||C.undefined(l.uri))}s(o,"is"),a.is=o}(Wl||(Wl={})),function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.targetRange)&&C.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||C.undefined(l.originSelectionRange))}s(o,"is"),a.is=o}(Ap||(Ap={})),function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.numberRange(l.red,0,1)&&C.numberRange(l.green,0,1)&&C.numberRange(l.blue,0,1)&&C.numberRange(l.alpha,0,1)}s(o,"is"),a.is=o}(Ec||(Ec={})),function(a){function i(u,l){return{range:u,color:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&te.is(l.range)&&Ec.is(l.color)}s(o,"is"),a.is=o}(Ep||(Ep={})),function(a){function i(u,l,c){return{label:u,textEdit:l,additionalTextEdits:c}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.undefined(l.textEdit)||ar.is(l))&&(C.undefined(l.additionalTextEdits)||C.typedArray(l.additionalTextEdits,ar.is))}s(o,"is"),a.is=o}(Cp||(Cp={})),function(a){a.Comment="comment",a.Imports="imports",a.Region="region"}(bp||(bp={})),function(a){function i(u,l,c,f,d,p){const h={startLine:u,endLine:l};return C.defined(c)&&(h.startCharacter=c),C.defined(f)&&(h.endCharacter=f),C.defined(d)&&(h.kind=d),C.defined(p)&&(h.collapsedText=p),h}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.uinteger(l.startLine)&&C.uinteger(l.startLine)&&(C.undefined(l.startCharacter)||C.uinteger(l.startCharacter))&&(C.undefined(l.endCharacter)||C.uinteger(l.endCharacter))&&(C.undefined(l.kind)||C.string(l.kind))}s(o,"is"),a.is=o}(_p||(_p={})),function(a){function i(u,l){return{location:u,message:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Wl.is(l.location)&&C.string(l.message)}s(o,"is"),a.is=o}(Cc||(Cc={})),function(a){a.Error=1,a.Warning=2,a.Information=3,a.Hint=4}(Sp||(Sp={})),function(a){a.Unnecessary=1,a.Deprecated=2}(wp||(wp={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&C.string(u.href)}s(i,"is"),a.is=i}(Ip||(Ip={})),function(a){function i(u,l,c,f,d,p){let h={range:u,message:l};return C.defined(c)&&(h.severity=c),C.defined(f)&&(h.code=f),C.defined(d)&&(h.source=d),C.defined(p)&&(h.relatedInformation=p),h}s(i,"create"),a.create=i;function o(u){var l;let c=u;return C.defined(c)&&te.is(c.range)&&C.string(c.message)&&(C.number(c.severity)||C.undefined(c.severity))&&(C.integer(c.code)||C.string(c.code)||C.undefined(c.code))&&(C.undefined(c.codeDescription)||C.string((l=c.codeDescription)===null||l===void 0?void 0:l.href))&&(C.string(c.source)||C.undefined(c.source))&&(C.undefined(c.relatedInformation)||C.typedArray(c.relatedInformation,Cc.is))}s(o,"is"),a.is=o}(Vl||(Vl={})),function(a){function i(u,l,...c){let f={title:u,command:l};return C.defined(c)&&c.length>0&&(f.arguments=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.title)&&C.string(l.command)}s(o,"is"),a.is=o}(pn||(pn={})),function(a){function i(c,f){return{range:c,newText:f}}s(i,"replace"),a.replace=i;function o(c,f){return{range:{start:c,end:c},newText:f}}s(o,"insert"),a.insert=o;function u(c){return{range:c,newText:""}}s(u,"del"),a.del=u;function l(c){const f=c;return C.objectLiteral(f)&&C.string(f.newText)&&te.is(f.range)}s(l,"is"),a.is=l}(ar||(ar={})),function(a){function i(u,l,c){const f={label:u};return l!==void 0&&(f.needsConfirmation=l),c!==void 0&&(f.description=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(C.string(l.description)||l.description===void 0)}s(o,"is"),a.is=o}(mn||(mn={})),function(a){function i(o){const u=o;return C.string(u)}s(i,"is"),a.is=i}(et||(et={})),function(a){function i(c,f,d){return{range:c,newText:f,annotationId:d}}s(i,"replace"),a.replace=i;function o(c,f,d){return{range:{start:c,end:c},newText:f,annotationId:d}}s(o,"insert"),a.insert=o;function u(c,f){return{range:c,newText:"",annotationId:f}}s(u,"del"),a.del=u;function l(c){const f=c;return ar.is(f)&&(mn.is(f.annotationId)||et.is(f.annotationId))}s(l,"is"),a.is=l}(Ar||(Ar={})),function(a){function i(u,l){return{textDocument:u,edits:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Hl.is(l.textDocument)&&Array.isArray(l.edits)}s(o,"is"),a.is=o}(ql||(ql={})),function(a){function i(u,l,c){let f={kind:"create",uri:u};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="create"&&C.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(_a||(_a={})),function(a){function i(u,l,c,f){let d={kind:"rename",oldUri:u,newUri:l};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(d.options=c),f!==void 0&&(d.annotationId=f),d}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="rename"&&C.string(l.oldUri)&&C.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(Sa||(Sa={})),function(a){function i(u,l,c){let f={kind:"delete",uri:u};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="delete"&&C.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||C.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||C.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(wa||(wa={})),function(a){function i(o){let u=o;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(l=>C.string(l.kind)?_a.is(l)||Sa.is(l)||wa.is(l):ql.is(l)))}s(i,"is"),a.is=i}(bc||(bc={})),kl=(t=class{constructor(i,o){this.edits=i,this.changeAnnotations=o}insert(i,o,u){let l,c;if(u===void 0?l=ar.insert(i,o):et.is(u)?(c=u,l=Ar.insert(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.insert(i,o,c)),this.edits.push(l),c!==void 0)return c}replace(i,o,u){let l,c;if(u===void 0?l=ar.replace(i,o):et.is(u)?(c=u,l=Ar.replace(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.replace(i,o,c)),this.edits.push(l),c!==void 0)return c}delete(i,o){let u,l;if(o===void 0?u=ar.del(i):et.is(o)?(l=o,u=Ar.del(i,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),u=Ar.del(i,l)),this.edits.push(u),l!==void 0)return l}add(i){this.edits.push(i)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(i){if(i===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},s(t,"TextEditChangeImpl"),t),Ud=(e=class{constructor(i){this._annotations=i===void 0?Object.create(null):i,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(i,o){let u;if(et.is(i)?u=i:(u=this.nextId(),o=i),this._annotations[u]!==void 0)throw new Error(`Id ${u} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${u}`);return this._annotations[u]=o,this._size++,u}nextId(){return this._counter++,this._counter.toString()}},s(e,"ChangeAnnotations"),e),M$=(r=class{constructor(i){this._textEditChanges=Object.create(null),i!==void 0?(this._workspaceEdit=i,i.documentChanges?(this._changeAnnotations=new Ud(i.changeAnnotations),i.changeAnnotations=this._changeAnnotations.all(),i.documentChanges.forEach(o=>{if(ql.is(o)){const u=new kl(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=u}})):i.changes&&Object.keys(i.changes).forEach(o=>{const u=new kl(i.changes[o]);this._textEditChanges[o]=u})):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(i){if(Hl.is(i)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:i.uri,version:i.version};let u=this._textEditChanges[o.uri];if(!u){const l=[],c={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(c),u=new kl(l,this._changeAnnotations),this._textEditChanges[o.uri]=u}return u}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[i];if(!o){let u=[];this._workspaceEdit.changes[i]=u,o=new kl(u),this._textEditChanges[i]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ud,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(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=_a.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=_a.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}renameFile(i,o,u,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let c;mn.is(u)||et.is(u)?c=u:l=u;let f,d;if(c===void 0?f=Sa.create(i,o,l):(d=et.is(c)?c:this._changeAnnotations.manage(c),f=Sa.create(i,o,l,d)),this._workspaceEdit.documentChanges.push(f),d!==void 0)return d}deleteFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=wa.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=wa.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}},s(r,"WorkspaceChange"),r),function(a){function i(u){return{uri:u}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)}s(o,"is"),a.is=o}(Np||(Np={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.integer(l.version)}s(o,"is"),a.is=o}(Pp||(Pp={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&(l.version===null||C.integer(l.version))}s(o,"is"),a.is=o}(Hl||(Hl={})),function(a){function i(u,l,c,f){return{uri:u,languageId:l,version:c,text:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.string(l.languageId)&&C.integer(l.version)&&C.string(l.text)}s(o,"is"),a.is=o}(kp||(kp={})),function(a){a.PlainText="plaintext",a.Markdown="markdown";function i(o){const u=o;return u===a.PlainText||u===a.Markdown}s(i,"is"),a.is=i}(_c||(_c={})),function(a){function i(o){const u=o;return C.objectLiteral(o)&&_c.is(u.kind)&&C.string(u.value)}s(i,"is"),a.is=i}(Ia||(Ia={})),function(a){a.Text=1,a.Method=2,a.Function=3,a.Constructor=4,a.Field=5,a.Variable=6,a.Class=7,a.Interface=8,a.Module=9,a.Property=10,a.Unit=11,a.Value=12,a.Enum=13,a.Keyword=14,a.Snippet=15,a.Color=16,a.File=17,a.Reference=18,a.Folder=19,a.EnumMember=20,a.Constant=21,a.Struct=22,a.Event=23,a.Operator=24,a.TypeParameter=25}(Op||(Op={})),function(a){a.PlainText=1,a.Snippet=2}(Lp||(Lp={})),function(a){a.Deprecated=1}(Dp||(Dp={})),function(a){function i(u,l,c){return{newText:u,insert:l,replace:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l&&C.string(l.newText)&&te.is(l.insert)&&te.is(l.replace)}s(o,"is"),a.is=o}(Mp||(Mp={})),function(a){a.asIs=1,a.adjustIndentation=2}(xp||(xp={})),function(a){function i(o){const u=o;return u&&(C.string(u.detail)||u.detail===void 0)&&(C.string(u.description)||u.description===void 0)}s(i,"is"),a.is=i}(Gp||(Gp={})),function(a){function i(o){return{label:o}}s(i,"create"),a.create=i}(Fp||(Fp={})),function(a){function i(o,u){return{items:o||[],isIncomplete:!!u}}s(i,"create"),a.create=i}(zp||(zp={})),function(a){function i(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(i,"fromPlainText"),a.fromPlainText=i;function o(u){const l=u;return C.string(l)||C.objectLiteral(l)&&C.string(l.language)&&C.string(l.value)}s(o,"is"),a.is=o}(Yl||(Yl={})),function(a){function i(o){let u=o;return!!u&&C.objectLiteral(u)&&(Ia.is(u.contents)||Yl.is(u.contents)||C.typedArray(u.contents,Yl.is))&&(o.range===void 0||te.is(o.range))}s(i,"is"),a.is=i}(jp||(jp={})),function(a){function i(o,u){return u?{label:o,documentation:u}:{label:o}}s(i,"create"),a.create=i}(Bp||(Bp={})),function(a){function i(o,u,...l){let c={label:o};return C.defined(u)&&(c.documentation=u),C.defined(l)?c.parameters=l:c.parameters=[],c}s(i,"create"),a.create=i}(Up||(Up={})),function(a){a.Text=1,a.Read=2,a.Write=3}(Kp||(Kp={})),function(a){function i(o,u){let l={range:o};return C.number(u)&&(l.kind=u),l}s(i,"create"),a.create=i}(Wp||(Wp={})),function(a){a.File=1,a.Module=2,a.Namespace=3,a.Package=4,a.Class=5,a.Method=6,a.Property=7,a.Field=8,a.Constructor=9,a.Enum=10,a.Interface=11,a.Function=12,a.Variable=13,a.Constant=14,a.String=15,a.Number=16,a.Boolean=17,a.Array=18,a.Object=19,a.Key=20,a.Null=21,a.EnumMember=22,a.Struct=23,a.Event=24,a.Operator=25,a.TypeParameter=26}(Vp||(Vp={})),function(a){a.Deprecated=1}(qp||(qp={})),function(a){function i(o,u,l,c,f){let d={name:o,kind:u,location:{uri:c,range:l}};return f&&(d.containerName=f),d}s(i,"create"),a.create=i}(Hp||(Hp={})),function(a){function i(o,u,l,c){return c!==void 0?{name:o,kind:u,location:{uri:l,range:c}}:{name:o,kind:u,location:{uri:l}}}s(i,"create"),a.create=i}(Yp||(Yp={})),function(a){function i(u,l,c,f,d,p){let h={name:u,detail:l,kind:c,range:f,selectionRange:d};return p!==void 0&&(h.children=p),h}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.name)&&C.number(l.kind)&&te.is(l.range)&&te.is(l.selectionRange)&&(l.detail===void 0||C.string(l.detail))&&(l.deprecated===void 0||C.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}s(o,"is"),a.is=o}(Xp||(Xp={})),function(a){a.Empty="",a.QuickFix="quickfix",a.Refactor="refactor",a.RefactorExtract="refactor.extract",a.RefactorInline="refactor.inline",a.RefactorRewrite="refactor.rewrite",a.Source="source",a.SourceOrganizeImports="source.organizeImports",a.SourceFixAll="source.fixAll"}(Jp||(Jp={})),function(a){a.Invoked=1,a.Automatic=2}(Xl||(Xl={})),function(a){function i(u,l,c){let f={diagnostics:u};return l!=null&&(f.only=l),c!=null&&(f.triggerKind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.typedArray(l.diagnostics,Vl.is)&&(l.only===void 0||C.typedArray(l.only,C.string))&&(l.triggerKind===void 0||l.triggerKind===Xl.Invoked||l.triggerKind===Xl.Automatic)}s(o,"is"),a.is=o}(Zp||(Zp={})),function(a){function i(u,l,c){let f={title:u},d=!0;return typeof l=="string"?(d=!1,f.kind=l):pn.is(l)?f.command=l:f.edit=l,d&&c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.title)&&(l.diagnostics===void 0||C.typedArray(l.diagnostics,Vl.is))&&(l.kind===void 0||C.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pn.is(l.command))&&(l.isPreferred===void 0||C.boolean(l.isPreferred))&&(l.edit===void 0||bc.is(l.edit))}s(o,"is"),a.is=o}(Qp||(Qp={})),function(a){function i(u,l){let c={range:u};return C.defined(l)&&(c.data=l),c}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.command)||pn.is(l.command))}s(o,"is"),a.is=o}(em||(em={})),function(a){function i(u,l){return{tabSize:u,insertSpaces:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.uinteger(l.tabSize)&&C.boolean(l.insertSpaces)}s(o,"is"),a.is=o}(tm||(tm={})),function(a){function i(u,l,c){return{range:u,target:l,data:c}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.target)||C.string(l.target))}s(o,"is"),a.is=o}(rm||(rm={})),function(a){function i(u,l){return{range:u,parent:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(l.parent===void 0||a.is(l.parent))}s(o,"is"),a.is=o}(nm||(nm={})),function(a){a.namespace="namespace",a.type="type",a.class="class",a.enum="enum",a.interface="interface",a.struct="struct",a.typeParameter="typeParameter",a.parameter="parameter",a.variable="variable",a.property="property",a.enumMember="enumMember",a.event="event",a.function="function",a.method="method",a.macro="macro",a.keyword="keyword",a.modifier="modifier",a.comment="comment",a.string="string",a.number="number",a.regexp="regexp",a.operator="operator",a.decorator="decorator"}(am||(am={})),function(a){a.declaration="declaration",a.definition="definition",a.readonly="readonly",a.static="static",a.deprecated="deprecated",a.abstract="abstract",a.async="async",a.modification="modification",a.documentation="documentation",a.defaultLibrary="defaultLibrary"}(im||(im={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}s(i,"is"),a.is=i}(sm||(sm={})),function(a){function i(u,l){return{range:u,text:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.string(l.text)}s(o,"is"),a.is=o}(om||(om={})),function(a){function i(u,l,c){return{range:u,variableName:l,caseSensitiveLookup:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.boolean(l.caseSensitiveLookup)&&(C.string(l.variableName)||l.variableName===void 0)}s(o,"is"),a.is=o}(lm||(lm={})),function(a){function i(u,l){return{range:u,expression:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&(C.string(l.expression)||l.expression===void 0)}s(o,"is"),a.is=o}(um||(um={})),function(a){function i(u,l){return{frameId:u,stoppedLocation:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.defined(l)&&te.is(u.stoppedLocation)}s(o,"is"),a.is=o}(cm||(cm={})),function(a){a.Type=1,a.Parameter=2;function i(o){return o===1||o===2}s(i,"is"),a.is=i}(Sc||(Sc={})),function(a){function i(u){return{value:u}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.location===void 0||Wl.is(l.location))&&(l.command===void 0||pn.is(l.command))}s(o,"is"),a.is=o}(wc||(wc={})),function(a){function i(u,l,c){const f={position:u,label:l};return c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&oe.is(l.position)&&(C.string(l.label)||C.typedArray(l.label,wc.is))&&(l.kind===void 0||Sc.is(l.kind))&&l.textEdits===void 0||C.typedArray(l.textEdits,ar.is)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.paddingLeft===void 0||C.boolean(l.paddingLeft))&&(l.paddingRight===void 0||C.boolean(l.paddingRight))}s(o,"is"),a.is=o}(fm||(fm={})),function(a){function i(o){return{kind:"snippet",value:o}}s(i,"createSnippet"),a.createSnippet=i}(dm||(dm={})),function(a){function i(o,u,l,c){return{insertText:o,filterText:u,range:l,command:c}}s(i,"create"),a.create=i}(pm||(pm={})),function(a){function i(o){return{items:o}}s(i,"create"),a.create=i}(mm||(mm={})),function(a){a.Invoked=0,a.Automatic=1}(hm||(hm={})),function(a){function i(o,u){return{range:o,text:u}}s(i,"create"),a.create=i}(ym||(ym={})),function(a){function i(o,u){return{triggerKind:o,selectedCompletionInfo:u}}s(i,"create"),a.create=i}(gm||(gm={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&Ac.is(u.uri)&&C.string(u.name)}s(i,"is"),a.is=i}(vm||(vm={})),x$=[` `,`\r `,"\r"],function(a){function i(c,f,d,p){return new iv(c,f,d,p)}s(i,"create"),a.create=i;function o(c){let f=c;return!!(C.defined(f)&&C.string(f.uri)&&(C.undefined(f.languageId)||C.string(f.languageId))&&C.uinteger(f.lineCount)&&C.func(f.getText)&&C.func(f.positionAt)&&C.func(f.offsetAt))}s(o,"is"),a.is=o;function u(c,f){let d=c.getText(),p=l(f,(y,v)=>{let E=y.range.start.line-v.range.start.line;return E===0?y.range.start.character-v.range.start.character:E}),h=d.length;for(let y=p.length-1;y>=0;y--){let v=p[y],E=c.offsetAt(v.range.start),T=c.offsetAt(v.range.end);if(T<=h)d=d.substring(0,E)+v.newText+d.substring(T,d.length);else throw new Error("Overlapping edit");h=E}return d}s(u,"applyEdits"),a.applyEdits=u;function l(c,f){if(c.length<=1)return c;const d=c.length/2|0,p=c.slice(0,d),h=c.slice(d);l(p,f),l(h,f);let y=0,v=0,E=0;for(;y({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(X.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Pt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Nt=s(()=>{kt(),H=rt()},"clear"),O={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Pt,clear:Nt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,O),O.setDomains(t.domains),O.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);X.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();X.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},T=Dt(e);Tt(T,F,V,o.useMaxWidth??!0),T.attr("viewBox",`0 0 ${V} ${F}`),d&&T.append("title").text(d),D&&T.append("desc").text(D);const k=T.append("g").attr("transform",`translate(${b}, ${b})`),_=Rt(i,f),Z=it(o.seed,e),mt=k.append("g").attr("class","cynefin-backgrounds"),Y=["complex","complicated","chaotic","clear"];for(const l of Y){const r=_[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=k.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;k.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=k.append("g").attr("class","cynefin-labels");for(const l of Y){const r=_[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=k.append("g").attr("class","cynefin-subtitles");for(const r of Y){const u=_[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=k.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=_[l],y=l==="confusion";let L=r.items,P=0;y&&r.items.length>q&&(P=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),N=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=N.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),N.attr("x",C/2).attr("y",A/2)}),P>0){const g=B+L.length*(A+4),S=`+${P} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let N=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(N=W.width)}const x=N+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=T.select("defs").empty()?T.append("defs"):T.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=k.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=_[y.from],P=_[y.to];if(!L||!P)return;if(y.from===y.to){X.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=P.cx,w=P.cy,M=(B+S)/2,N=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,G=-x/C,ht=$/C,et=M+G*W,nt=N+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&k.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),_t={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return` +import{p as xt}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{aQ as gt,V as $t,$ as bt,aT as wt,W as Ct,aR as vt,a as s,at as X,aP as Dt,B as Tt,s as kt,r as Q,X as U,O as At,a8 as ot}from"./mermaid.core-Byx96n1y.js";import{p as Bt}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(X.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Pt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Nt=s(()=>{kt(),H=rt()},"clear"),O={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Pt,clear:Nt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,O),O.setDomains(t.domains),O.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);X.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();X.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},T=Dt(e);Tt(T,F,V,o.useMaxWidth??!0),T.attr("viewBox",`0 0 ${V} ${F}`),d&&T.append("title").text(d),D&&T.append("desc").text(D);const k=T.append("g").attr("transform",`translate(${b}, ${b})`),_=Rt(i,f),Z=it(o.seed,e),mt=k.append("g").attr("class","cynefin-backgrounds"),Y=["complex","complicated","chaotic","clear"];for(const l of Y){const r=_[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=k.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;k.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=k.append("g").attr("class","cynefin-labels");for(const l of Y){const r=_[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=k.append("g").attr("class","cynefin-subtitles");for(const r of Y){const u=_[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=k.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=_[l],y=l==="confusion";let L=r.items,P=0;y&&r.items.length>q&&(P=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),N=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=N.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),N.attr("x",C/2).attr("y",A/2)}),P>0){const g=B+L.length*(A+4),S=`+${P} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let N=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(N=W.width)}const x=N+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=T.select("defs").empty()?T.append("defs"):T.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=k.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=_[y.from],P=_[y.to];if(!L||!P)return;if(y.from===y.to){X.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=P.cx,w=P.cy,M=(B+S)/2,N=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,G=-x/C,ht=$/C,et=M+G*W,nt=N+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&k.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),_t={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return` .cynefinDomain { stroke: none; } diff --git a/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-CoK1hzcv.js b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-Bh80CoKM.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-CoK1hzcv.js rename to veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-Bh80CoKM.js index 1a01fe357..ae9ea2d4a 100644 --- a/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-CoK1hzcv.js +++ b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-Bh80CoKM.js @@ -1,4 +1,4 @@ -import{c as O,w as M,a as J,f as P,b as N,s as A}from"./chunk-RYQCIY6F-DfwPULTh.js";import{a as X,aw as v,v as D,t as Y,u as H,at as d,Y as _,b8 as F,aU as W,ag as $,a6 as j,aG as R,ad as U,ae as q,aF as z,af as G}from"./mermaid.core-DnksLuoJ.js";import{G as K}from"../../chunks/graph-Dqkl27Ch.js";import{l as Q}from"../../chunks/layout-B6FSD_Du.js";import"../../chunks/map-8WAJQ6ap.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var C=X((o,s,l)=>Math.max(s,Math.min(l,o)),"clamp"),B=X((o="TB")=>{switch(o){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=X(o=>o==="flowchart"||o==="flowchart-v2"||o==="stateDiagram","shouldMergeSelfLoopSegments"),Z=X((o,s,l,y,a)=>{const f=[],p=new Set;if(l.forEach(({start:r,end:t})=>{r!==y&&p.add(r),t!==y&&p.add(t)}),p.forEach(r=>{const t=o.node(r);typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)}),f.length===0&&l.forEach(({edge:r})=>{(r.points??[]).forEach(t=>{typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)})}),f.length===0)return B(a);const c=f.reduce((r,t)=>({x:r.x+t.x/f.length,y:r.y+t.y/f.length}),{x:0,y:0}),h=c.x-s.x,i=c.y-s.y;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":B(a)},"getSelfLoopSide"),ee=X((o,s="top",l=0,y=0)=>{const a=o.x,f=o.y-l,p=o.width/2,c=o.height/2,h=Math.max(36,Math.min(100,o.width*.8)),i=C(Math.max(y,o.width*.35),36,h),r=C(Math.min(o.width,o.height)*.45,24,48);switch(s){case"bottom":{const t=f+c;return[{x:a-i/2,y:t},{x:a-i/2,y:t+r},{x:a+i/2,y:t+r},{x:a+i/2,y:t}]}case"right":{const t=a+p;return[{x:t,y:f-i/2},{x:t+r,y:f-i/2},{x:t+r,y:f+i/2},{x:t,y:f+i/2}]}case"left":{const t=a-p;return[{x:t,y:f-i/2},{x:t-r,y:f-i/2},{x:t-r,y:f+i/2},{x:t,y:f+i/2}]}case"top":default:{const t=f-c;return[{x:a-i/2,y:t},{x:a-i/2,y:t-r},{x:a+i/2,y:t-r},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),te=X((o,s,l="top",y=0,a={})=>{const p=o.x,c=o.y-y,h=a.width??0,i=a.height??0;switch(l){case"bottom":return{x:p,y:Math.max(...s.map(r=>r.y))+i/2+4};case"right":return{x:Math.max(...s.map(r=>r.x))+h/2+4,y:c};case"left":return{x:Math.min(...s.map(r=>r.x))-h/2-4,y:c};case"top":default:return{x:p,y:Math.min(...s.map(r=>r.y))-i/2-4}}},"getSelfLoopLabelPosition"),se=X((o,s=0,{mergeSelfLoops:l=!0}={})=>{var p;const y=new Map,a=[],f=(p=o.graph())==null?void 0:p.rankdir;return o.edges().forEach(c=>{const h=o.edge(c);if(l&&h.selfLoop){const i=h.selfLoop.id;y.has(i)||y.set(i,[]),y.get(i).push({edge:h,start:c.v,end:c.w})}else a.push({edge:h,start:c.v,end:c.w})}),y.forEach(c=>{if(c.length!==3){c.forEach(n=>a.push(n));return}c.sort((n,e)=>n.edge.selfLoop.order-e.edge.selfLoop.order);const[h,i,r]=c,t=h.edge.originalEdge??i.edge.originalEdge??r.edge.originalEdge??i.edge,g=o.node(t.start);if(!g){c.forEach(n=>a.push(n));return}const S={width:i.edge.width,height:i.edge.height},w=Z(o,g,c,t.start,f),b=ee(g,w,s,S.width??0),E=te(g,b,w,s,S),m={...i.edge,...t,id:t.id,points:b,start:t.start,end:t.end,x:E.x,y:E.y,width:S.width,height:S.height,labelStyle:i.edge.labelStyle,fromCluster:h.edge.fromCluster??i.edge.fromCluster??r.edge.fromCluster,toCluster:h.edge.toCluster??i.edge.toCluster??r.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),T=X(async(o,s,l,y,a,f)=>{d.warn("Graph in recursive render:XAX",M(s),a);const p=s.graph().rankdir;d.trace("Dir in recursive render - dir:",p);const c=o.insert("g").attr("class","root");s.nodes()?d.info("Recursive render XXX",s.nodes()):d.info("No nodes found for",s),s.edges().length>0&&d.info("Recursive edges",s.edge(s.edges()[0]));const h=c.insert("g").attr("class","clusters"),i=c.insert("g").attr("class","edgePaths"),r=c.insert("g").attr("class","edgeLabels"),t=c.insert("g").attr("class","nodes"),g=V(l);await Promise.all(s.nodes().map(async function(n){const e=s.node(n);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));d.trace(`Setting data for parent cluster XXX +import{c as O,w as M,a as J,f as P,b as N,s as A}from"./chunk-RYQCIY6F-CvZ-mg4G.js";import{a as X,aw as v,v as D,t as Y,u as H,at as d,Y as _,b8 as F,aU as W,ag as $,a6 as j,aG as R,ad as U,ae as q,aF as z,af as G}from"./mermaid.core-Byx96n1y.js";import{G as K}from"../../chunks/graph-Dqkl27Ch.js";import{l as Q}from"../../chunks/layout-B6FSD_Du.js";import"../../chunks/map-8WAJQ6ap.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var C=X((o,s,l)=>Math.max(s,Math.min(l,o)),"clamp"),B=X((o="TB")=>{switch(o){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=X(o=>o==="flowchart"||o==="flowchart-v2"||o==="stateDiagram","shouldMergeSelfLoopSegments"),Z=X((o,s,l,y,a)=>{const f=[],p=new Set;if(l.forEach(({start:r,end:t})=>{r!==y&&p.add(r),t!==y&&p.add(t)}),p.forEach(r=>{const t=o.node(r);typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)}),f.length===0&&l.forEach(({edge:r})=>{(r.points??[]).forEach(t=>{typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)})}),f.length===0)return B(a);const c=f.reduce((r,t)=>({x:r.x+t.x/f.length,y:r.y+t.y/f.length}),{x:0,y:0}),h=c.x-s.x,i=c.y-s.y;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":B(a)},"getSelfLoopSide"),ee=X((o,s="top",l=0,y=0)=>{const a=o.x,f=o.y-l,p=o.width/2,c=o.height/2,h=Math.max(36,Math.min(100,o.width*.8)),i=C(Math.max(y,o.width*.35),36,h),r=C(Math.min(o.width,o.height)*.45,24,48);switch(s){case"bottom":{const t=f+c;return[{x:a-i/2,y:t},{x:a-i/2,y:t+r},{x:a+i/2,y:t+r},{x:a+i/2,y:t}]}case"right":{const t=a+p;return[{x:t,y:f-i/2},{x:t+r,y:f-i/2},{x:t+r,y:f+i/2},{x:t,y:f+i/2}]}case"left":{const t=a-p;return[{x:t,y:f-i/2},{x:t-r,y:f-i/2},{x:t-r,y:f+i/2},{x:t,y:f+i/2}]}case"top":default:{const t=f-c;return[{x:a-i/2,y:t},{x:a-i/2,y:t-r},{x:a+i/2,y:t-r},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),te=X((o,s,l="top",y=0,a={})=>{const p=o.x,c=o.y-y,h=a.width??0,i=a.height??0;switch(l){case"bottom":return{x:p,y:Math.max(...s.map(r=>r.y))+i/2+4};case"right":return{x:Math.max(...s.map(r=>r.x))+h/2+4,y:c};case"left":return{x:Math.min(...s.map(r=>r.x))-h/2-4,y:c};case"top":default:return{x:p,y:Math.min(...s.map(r=>r.y))-i/2-4}}},"getSelfLoopLabelPosition"),se=X((o,s=0,{mergeSelfLoops:l=!0}={})=>{var p;const y=new Map,a=[],f=(p=o.graph())==null?void 0:p.rankdir;return o.edges().forEach(c=>{const h=o.edge(c);if(l&&h.selfLoop){const i=h.selfLoop.id;y.has(i)||y.set(i,[]),y.get(i).push({edge:h,start:c.v,end:c.w})}else a.push({edge:h,start:c.v,end:c.w})}),y.forEach(c=>{if(c.length!==3){c.forEach(n=>a.push(n));return}c.sort((n,e)=>n.edge.selfLoop.order-e.edge.selfLoop.order);const[h,i,r]=c,t=h.edge.originalEdge??i.edge.originalEdge??r.edge.originalEdge??i.edge,g=o.node(t.start);if(!g){c.forEach(n=>a.push(n));return}const S={width:i.edge.width,height:i.edge.height},w=Z(o,g,c,t.start,f),b=ee(g,w,s,S.width??0),E=te(g,b,w,s,S),m={...i.edge,...t,id:t.id,points:b,start:t.start,end:t.end,x:E.x,y:E.y,width:S.width,height:S.height,labelStyle:i.edge.labelStyle,fromCluster:h.edge.fromCluster??i.edge.fromCluster??r.edge.fromCluster,toCluster:h.edge.toCluster??i.edge.toCluster??r.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),T=X(async(o,s,l,y,a,f)=>{d.warn("Graph in recursive render:XAX",M(s),a);const p=s.graph().rankdir;d.trace("Dir in recursive render - dir:",p);const c=o.insert("g").attr("class","root");s.nodes()?d.info("Recursive render XXX",s.nodes()):d.info("No nodes found for",s),s.edges().length>0&&d.info("Recursive edges",s.edge(s.edges()[0]));const h=c.insert("g").attr("class","clusters"),i=c.insert("g").attr("class","edgePaths"),r=c.insert("g").attr("class","edgeLabels"),t=c.insert("g").attr("class","nodes"),g=V(l);await Promise.all(s.nodes().map(async function(n){const e=s.node(n);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));d.trace(`Setting data for parent cluster XXX Node.id = `,n,` data=`,u.height,` Parent cluster`,a.height),s.setNode(a.id,u),s.parent(n)||(d.trace("Setting parent",n,a.id),s.setParent(n,a.id,u))}if(d.info("(Insert) Node XXX"+n+": "+JSON.stringify(s.node(n))),e!=null&&e.clusterNode){d.info("Cluster identified XBX",n,e.width,s.node(n));const{ranksep:u,nodesep:x}=s.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const L=await T(t,e.graph,l,y,s.node(n),f),I=L.elem;F(e,I),e.diff=L.diff||0,d.info("New compound node after recursive render XAX",n,"width",e.width,"height",e.height),W(I,e)}else s.children(n).length>0?(d.trace("Cluster - the non recursive path XBX",n,e.id,e,e.width,"Graph:",s),d.trace(P(e.id,s)),N.set(e.id,{id:P(e.id,s),node:e})):(d.trace("Node - the non recursive path XAX",n,t,s.node(n),p),await $(t,s.node(n),{config:f,dir:p}))})),await X(async()=>{const n=s.edges().map(async function(e){const u=s.edge(e.v,e.w,e.name);if(d.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(s.edge(e))),d.info("Fix",N,"ids:",e.v,e.w,"Translating: ",N.get(e.v),N.get(e.w)),g&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(r,u),u.id=x;return}await G(r,u)});await Promise.all(n)},"processEdges")(),d.info("Graph before layout:",JSON.stringify(M(s))),d.info("############################################# XXX"),d.info("### Layout ### XXX"),d.info("############################################# XXX"),Q(s),d.info("Graph after layout:",JSON.stringify(M(s)));let w=0,{subGraphTitleTotalMargin:b}=j(f);await Promise.all(A(s).map(async function(n){var u;const e=s.node(n);if(d.info("Position XBX => "+n+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e!=null&&e.clusterNode)e.y+=b,d.info("A tainted cluster node XBX1",n,e.id,e.width,e.height,e.x,e.y,s.parent(n)),N.get(e.id).node=e,R(e);else if(s.children(n).length>0){d.info("A pure cluster node XBX1",n,e.id,e.x,e.y,e.width,e.height,s.parent(n)),e.height+=b,s.node(e.parentId);const x=(e==null?void 0:e.padding)/2||0,L=((u=e==null?void 0:e.labelBBox)==null?void 0:u.height)||0,I=L-x||0;d.debug("OffsetY",I,"labelHeight",L,"halfPadding",x),await U(h,e),N.get(e.id).node=e}else{const x=s.node(e.parentId);e.y+=b/2,d.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",x,x==null?void 0:x.offsetY,e),R(e)}}));const E=b/2;return se(s,E,{mergeSelfLoops:g}).forEach(function({edge:n,start:e,end:u}){d.info("Edge "+e+" -> "+u+": "+JSON.stringify(n),n),n.points.forEach(k=>k.y+=E);const x=s.node(e),L=s.node(u),I=q(i,n,N,l,x,L,y);z(n,I)}),s.nodes().forEach(function(n){const e=s.node(n);d.info(n,e.type,e.diff),e.isGroup&&(w=e.diff)}),d.warn("Returning from recursive render XAX",c,w),{elem:c,diff:w}},"recursiveRender"),le=X(async(o,s)=>{var f,p,c,h,i,r;const l=new K({multigraph:!0,compound:!0}).setGraph({rankdir:o.direction,nodesep:((f=o.config)==null?void 0:f.nodeSpacing)||((c=(p=o.config)==null?void 0:p.flowchart)==null?void 0:c.nodeSpacing)||o.nodeSpacing,ranksep:((h=o.config)==null?void 0:h.rankSpacing)||((r=(i=o.config)==null?void 0:i.flowchart)==null?void 0:r.rankSpacing)||o.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),y=s.select("g");v(y,o.markers,o.type,o.diagramId),D(),Y(),H(),O(),o.nodes.forEach(t=>{l.setNode(t.id,{...t}),t.parentId&&l.setParent(t.id,t.parentId)}),d.debug("Edges:",o.edges),o.edges.forEach(t=>{if(t.start===t.end){const g=t.start,S=g+"---"+g+"---1",w=g+"---"+g+"---2",b=l.node(g);l.setNode(S,{domId:S,id:S,parentId:b.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),l.setParent(S,b.parentId),l.setNode(w,{domId:w,id:w,parentId:b.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),l.setParent(w,b.parentId);const E=structuredClone(t),m=structuredClone(t),n=structuredClone(t),e=structuredClone(t);m.originalEdge=E,m.selfLoop={id:E.id,order:0},n.originalEdge=E,n.selfLoop={id:E.id,order:1},e.originalEdge=E,e.selfLoop={id:E.id,order:2},m.label="",m.arrowTypeEnd="none",m.endLabelLeft="",m.endLabelRight="",m.startLabelLeft="",m.id=g+"-cyclic-special-1",n.startLabelRight="",n.startLabelLeft="",n.endLabelLeft="",n.endLabelRight="",n.arrowTypeStart="none",n.arrowTypeEnd="none",n.id=g+"-cyclic-special-mid",e.label="",e.startLabelRight="",e.startLabelLeft="",e.arrowTypeStart="none",b.isGroup&&(m.fromCluster=g,e.toCluster=g),e.id=g+"-cyclic-special-2",e.arrowTypeStart="none",l.setEdge(g,S,m,g+"-cyclic-special-0"),l.setEdge(S,w,n,g+"-cyclic-special-1"),l.setEdge(w,g,e,g+"-cyclic-special-2")}else l.setEdge(t.start,t.end,{...t},t.id)}),d.warn("Graph at first:",JSON.stringify(M(l))),J(l),d.warn("Graph after XAX:",JSON.stringify(M(l)));const a=_();await T(y,l,o.type,o.diagramId,void 0,a)},"render");export{se as getEdgesToRender,le as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-SC1XlXnp.js b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-CHjc3YK7.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-SC1XlXnp.js rename to veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-CHjc3YK7.js index 5acbe403e..f55b49cd8 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-SC1XlXnp.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-CHjc3YK7.js @@ -1,4 +1,4 @@ -import{I as z}from"./chunk-2Q5K7J3B-naaeokok.js";import{p as O}from"./chunk-JWPE2WC7-CWI15yjG.js";import{aT as G,aR as P,aQ as Y,$ as F,V as j,W as Z,a as p,r as A,at as D,aP as q,B as U,X as E,s as J,aN as Q,a2 as K,O as ee,aJ as te}from"./mermaid.core-DnksLuoJ.js";import{p as re}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var S=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,$=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function _(r){return r.some(e=>S.test(e))}p(_,"isBoxDrawingFormat");function M(r){for(const e of r){const t=L.exec(e);if(t!=null&&t.index&&t.index>0)return t.index}return 4}p(M,"inferSegmentWidth");function R(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const o=parseInt(i,10),c=e.get(o);return c?`line ${c}`:t})}p(R,"remapErrorLines");function H(r){const e=r.split(` +import{I as z}from"./chunk-2Q5K7J3B-Df19aPp9.js";import{p as O}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{aT as G,aR as P,aQ as Y,$ as F,V as j,W as Z,a as p,r as A,at as D,aP as q,B as U,X as E,s as J,aN as Q,a2 as K,O as ee,aJ as te}from"./mermaid.core-Byx96n1y.js";import{p as re}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var S=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,$=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function _(r){return r.some(e=>S.test(e))}p(_,"isBoxDrawingFormat");function M(r){for(const e of r){const t=L.exec(e);if(t!=null&&t.index&&t.index>0)return t.index}return 4}p(M,"inferSegmentWidth");function R(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const o=parseInt(i,10),c=e.get(o);return c?`line ${c}`:t})}p(R,"remapErrorLines");function H(r){const e=r.split(` `),t=new Map;let i=-1;for(const[a,s]of e.entries())if(s.trim()==="treeView-beta"){i=a;break}if(i===-1)return{text:r,lineMap:t};const o=[];for(let a=i+1;a({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=p(()=>{x.reset(),J()},"clear"),se=p(()=>x.records.stack[0],"getRoot"),ae=p(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=p(()=>A(ce,E().treeView),"getConfig"),de=p((r,e,t,i,o,c)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const n={id:x.records.cnt++,level:r,name:e,nodeType:t,icon:o,cssClass:i,description:c,children:[]};x.records.stack[x.records.stack.length-1].children.push(n),x.records.stack.push(n)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:j,getDiagramTitle:F,setAccDescription:Y,setAccTitle:P,setDiagramTitle:G},y=he,pe=p(r=>{O(r,y);for(const e of r.nodes){const t=typeof e.indent=="number"?e.indent:0;let i=e.name;const o=i.endsWith("/");o&&(i=i.slice(0,-1));const c=o?"directory":"file",n=e.classAnnotation||void 0,l=e.iconAnnotation,a=l!==void 0?l||"none":void 0,s=e.descAnnotation||void 0,u=s?Q(s,E()):void 0;y.addNode(t,i,c,n,a,u)}},"populate"),fe={parse:p(async r=>{const{text:e,lineMap:t}=H(r);try{const i=await re("treeView",e);D.debug(i),pe(i)}catch(i){throw t.size>0&&i instanceof Error&&(i.message=R(i.message,t)),i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function W(r,e){var o;const t=(o=e==null?void 0:e.filenameIcons)==null?void 0:o[r];if(t)return t;const i=r.lastIndexOf(".");if(i>0){const c=r.substring(i).toLowerCase(),n=e==null?void 0:e.extensionIcons;return(n==null?void 0:n[c])??(n==null?void 0:n[c.slice(1)])}}p(W,"detectIcon");function I(r,e){return r.includes(":")?r:r in C.icons||!e?`${C.prefix}:${r}`:`${e}:${r}`}p(I,"qualifyIcon");function V(r,e){if(r.icon!=="none"){if(r.icon)return I(r.icon,e.defaultIconPack);if(e.showIcons){if(r.nodeType==="file"){const t=W(r.name,e);if(t==="none")return;if(t)return I(t,e.defaultIconPack)}return`${C.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}p(V,"getNodeIcon");te([{name:C.prefix,icons:C}]);var B=14,ge=4,ue=16,X=p((r,e)=>`tv-icon-${r}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=p(async(r,e,t,i)=>{const o=new Set,c=p(a=>{const s=V(a,t);s&&o.add(s),a.children.forEach(c)},"collect");if(c(e),o.size===0)return;const n=await Promise.all([...o].map(async a=>({icon:a,svg:await K(a,{height:B,width:B})}))),l=r.append("defs");for(const{icon:a,svg:s}of n)l.append("g").attr("id",X(i,a)).html(s)},"injectIconDefs"),me=p((r,e,t,i,o,c)=>{var b;const n=i.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const a=B+ge,s=V(t,o),u=s!==void 0;s&&n.append("use").attr("xlink:href",`#${X(c,s)}`).attr("x",r+o.paddingX).attr("y",e+o.paddingY).attr("class","treeView-node-icon");const d=n.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:f,width:h}=d.node().getBBox(),m=f+o.paddingY*2,w=r+o.paddingX+(u?a:0);d.attr("x",w),d.attr("y",e+m/2);const g=w+h,v=h+o.paddingX*2+(u?a:0);return t.BBox={x:r,y:e,width:v,height:m},(b=t.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&n.insert("rect",":first-child").attr("x",r).attr("y",e+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:n,labelRightEdge:g,centerY:e+m/2}},"positionLabel"),N=p((r,e,t,i,o,c)=>r.append("line").attr("x1",e).attr("y1",t).attr("x2",i).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),ve=p((r,e,t,i)=>{var u;let o=0,c=0;const n=[],l=p((d,f,h,m)=>{const w=m*(h.rowIndent+h.paddingX),g=me(w,o,f,d,h,i);n.push(g);const{height:v,width:b}=f.BBox;N(d,w-h.rowIndent,o+v/2,w,o+v/2,h.lineThickness),c=Math.max(c,w+b),o+=v},"drawNode"),a=p((d,f=0)=>{l(r,d,t,f),d.children.forEach(g=>{a(g,f+1)});const{x:h,y:m,height:w}=d.BBox;if(d.children.length){const{y:g,height:v}=d.children[d.children.length-1].BBox;N(r,h+t.paddingX,m+w,h+t.paddingX,g+v/2+t.lineThickness/2,t.lineThickness)}},"processNode");a(e);const s=n.filter(d=>d.node.description);if(s.length>0){const f=Math.max(...n.map(h=>h.labelRightEdge))+ue;for(const h of s){const w=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();c=Math.max(c,f+w.width+t.paddingX)}}for(const d of n)if((u=d.node.cssClass)!=null&&u.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const h=c-d.node.BBox.x+8;f.attr("width",h),c=Math.max(c,d.node.BBox.x+h+2)}}return{totalHeight:o,totalWidth:c}},"drawTree"),xe=p(async(r,e,t,i)=>{D.debug(`Rendering treeView diagram `+r);const o=i.db,c=o.getRoot(),n=o.getConfig(),l=q(e);await we(l,c,n,e);const a=l.append("g");a.attr("class","tree-view");const{totalHeight:s,totalWidth:u}=ve(a,c,n,e);l.attr("viewBox",`-${n.lineThickness/2} 0 ${u} ${s}`),U(l,s,u,n.useMaxWidth)},"draw"),be={draw:xe},Ce=be,ye={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=p(({treeView:r})=>{const{labelFontSize:e,labelColor:t,lineColor:i,iconColor:o,descriptionColor:c,highlightBg:n,highlightStroke:l}=A(ye,r);return` diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-60-I7wkZ.js b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-Crk5VMXY.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-60-I7wkZ.js rename to veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-Crk5VMXY.js index 926ebcd77..687ffcbb1 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-60-I7wkZ.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-Crk5VMXY.js @@ -1,3 +1,3 @@ -import{p as oe}from"./chunk-JWPE2WC7-CWI15yjG.js";import{$ as se,aT as de,aQ as le,V as ce,W as me,aR as ue,a as o,at as g,Y as T,aX as xe,s as fe,r as ge,X as E,O as he,aN as P,bb as S,o as pe}from"./mermaid.core-DnksLuoJ.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import{aB as we}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var N="position frame",D="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),fe()},"clear");function O(){R={}}o(O,"reset");var ke=he.eventmodeling,Me=o(()=>ge({...ke,...E().eventmodeling}),"getConfig"),R={};function W(){let e=Be;const{ast:n}=R,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=w(e,{$kind:N,index:a,frame:i,textProps:r});let d;Q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){R.ast=e}o(I,"setAst");var s={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 A(){return s}o(A,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function V(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(V,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(v,"findNextAvailableIndex");function X(e,n){const t=H(e.entityIdentifier),i=V(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(X,"calculateSwimlaneProps");function _(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(_,"calculateEntityVisualProps");function L(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${S(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as oe}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{$ as se,aT as de,aQ as le,V as ce,W as me,aR as ue,a as o,at as g,Y as T,aX as xe,s as fe,r as ge,X as E,O as he,aN as P,bb as S,o as pe}from"./mermaid.core-Byx96n1y.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import{aB as we}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var N="position frame",D="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),fe()},"clear");function O(){R={}}o(O,"reset");var ke=he.eventmodeling,Me=o(()=>ge({...ke,...E().eventmodeling}),"getConfig"),R={};function W(){let e=Be;const{ast:n}=R,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=w(e,{$kind:N,index:a,frame:i,textProps:r});let d;Q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){R.ast=e}o(I,"setAst");var s={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 A(){return s}o(A,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function V(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(V,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(v,"findNextAvailableIndex");function X(e,n){const t=H(e.entityIdentifier),i=V(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(X,"calculateSwimlaneProps");function _(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(_,"calculateEntityVisualProps");function L(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${S(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function G(e,n){const t=n,i=_(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(G,"decidePositionFrame");function Y(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(Y,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function $(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o($,"sortedSwimlanesArray");function z(e,n){const t=n,i=X(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=Y(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=$(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(Q,"hasSourceFrame");function B(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(B,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||K(t.index,t.frame))return[];const i=B(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=B(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Z(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Z,"evolveRelationPositioned");var Fe={[N]:G,[M]:J},Ee={[D]:z,[C]:Z};function ee(e,n){const t=Fe[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(ee,"decide");function te(e,n){const t=n.reduce((i,a)=>{const r=Ee[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(te,"evolve");function w(e,n){const t=ee(e,n);return te(e,t)}o(w,"dispatch");var F={getConfig:Me,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:ue,getAccTitle:me,getAccDescription:ce,setAccDescription:le,setDiagramTitle:de,getDiagramTitle:se,setAst:I,getDiagramProps:A,getState:W},Re={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),oe(n,F)},"parse")},k=T(),Ae=k==null?void 0:k.eventmodeling;function ne(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.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(t.text)}}o(ne,"renderD3Box");function ie(e,n){return e>n}o(ie,"dirUpwards");function ae(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ie(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ae,"renderD3Relation");function re(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(re,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Ae)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=we(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).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",u),xe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),Te={draw:$e},Ne=o(e=>"","getStyles"),De=Ne,Ue={parser:Re,db:F,renderer:Te,styles:De};export{Ue as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-Du7527yu.js b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B24oG5BD.js similarity index 94% rename from veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-Du7527yu.js rename to veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B24oG5BD.js index 2411c4c6c..043b6f662 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-Du7527yu.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B24oG5BD.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a as b,r as m,aP as C,B as S,at as w,aR as T,W as D,aT as P,$ as z,V as E,aQ as F,X as A,O as W,s as _}from"./mermaid.core-DnksLuoJ.js";import{p as N}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=T,this.getAccTitle=D,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=E,this.setAccDescription=F}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,O=b((e,t)=>{B(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),O(t,s)},"parse")},I=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())R(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),R=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),X={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:e}={})=>{const t=m(j,e);return` +import{p as B}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as b,r as m,aP as C,B as S,at as w,aR as T,W as D,aT as P,$ as z,V as E,aQ as F,X as A,O as W,s as _}from"./mermaid.core-Byx96n1y.js";import{p as N}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=T,this.getAccTitle=D,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=E,this.setAccDescription=F}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,O=b((e,t)=>{B(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),O(t,s)},"parse")},I=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())R(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),R=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),X={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:e}={})=>{const t=m(j,e);return` .packetByte { font-size: ${t.byteFontSize}; } diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-s-EXVUXN.js b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-CHt3iGyV.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-s-EXVUXN.js rename to veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-CHt3iGyV.js index fc887b306..586ed28f4 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-s-EXVUXN.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-CHt3iGyV.js @@ -1,4 +1,4 @@ -import{p as ge}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a as w,a8 as ye,X as ae,r as ee,aP as Se,B as ve,at as te,a$ as B,aR as xe,W as be,aT as we,$ as Ce,V as Te,aQ as $e,O as Le,al as Ae,s as Fe}from"./mermaid.core-DnksLuoJ.js";import{s as Ne}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{p as Me}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import{aB as Q}from"../../app/index-DZf0wXGZ.js";import{f as O}from"../../chunks/defaultLocale-CrowFXzY.js";import{o as K}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function Ve(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ze(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h=0;)l+=n[r].value;a.value=l})}function Re(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function We(t){for(var a=this,l=Ee(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ee(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Xe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r=0;--d)r.push(s=h[d]=new U(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ue)}function qe(){return ne(this).eachBefore(Qe)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ue(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=ne.prototype={constructor:U,count:ke,each:Ve,eachAfter:De,eachBefore:ze,find:Pe,sum:Be,sort:Re,path:We,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:qe,[Symbol.iterator]:Xe};function Ze(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function X(t){return function(){return t}}function Je(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 Ke(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++dM&&(M=c),_=p*p*E,A=Math.max(M/_,_/y),A>z){p-=c;break}z=A}h.push(g={value:p,dice:x1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Je),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,y=i.y1-x;p{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(W,"TreeMapDB"),W);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],u=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,R=10,q=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*R:960,x=s.nodeHeight?s.nodeHeight*R:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?q+R:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?R:0).paddingRight(e=>e.children&&e.children.length>0?R:0).paddingBottom(e=>e.children&&e.children.length>0?R:0).round(!0)(E),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=Q(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,$=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-$:T=C-$-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const L="...";let V=f;for(;V.length>0;){if(V=f.substring(0,V.length-1),V.length===0){o.text(L),k.getComputedTextLength()>m&&o.text("");break}if(o.text(V+L),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,ue=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,Z=F?2:4,se=F?8:10,J=F?1:2,j=z.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=Q(this),f=e.x1-e.x0,C=e.y1-e.y0,$=o.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),L=m+J+N;for(;L>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(NT||m(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=Q(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=Q(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const T=parseFloat($.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+J;f.attr("y",N);const L=o.x1-o.x0,ie=o.y1-o.y0-4,me=L-2*Z;f.node().getComputedTextLength()>me||N+m>ie||m{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return` +import{p as ge}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as w,a8 as ye,X as ae,r as ee,aP as Se,B as ve,at as te,a$ as B,aR as xe,W as be,aT as we,$ as Ce,V as Te,aQ as $e,O as Le,al as Ae,s as Fe}from"./mermaid.core-Byx96n1y.js";import{s as Ne}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{p as Me}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import{aB as Q}from"../../app/index-y89rQfXU.js";import{f as O}from"../../chunks/defaultLocale-CrowFXzY.js";import{o as K}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function Ve(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ze(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h=0;)l+=n[r].value;a.value=l})}function Re(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function We(t){for(var a=this,l=Ee(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ee(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Xe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r=0;--d)r.push(s=h[d]=new U(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ue)}function qe(){return ne(this).eachBefore(Qe)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ue(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=ne.prototype={constructor:U,count:ke,each:Ve,eachAfter:De,eachBefore:ze,find:Pe,sum:Be,sort:Re,path:We,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:qe,[Symbol.iterator]:Xe};function Ze(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function X(t){return function(){return t}}function Je(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 Ke(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++dM&&(M=c),_=p*p*E,A=Math.max(M/_,_/y),A>z){p-=c;break}z=A}h.push(g={value:p,dice:x1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Je),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,y=i.y1-x;p{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(W,"TreeMapDB"),W);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],u=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,R=10,q=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*R:960,x=s.nodeHeight?s.nodeHeight*R:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?q+R:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?R:0).paddingRight(e=>e.children&&e.children.length>0?R:0).paddingBottom(e=>e.children&&e.children.length>0?R:0).round(!0)(E),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=Q(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,$=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-$:T=C-$-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const L="...";let V=f;for(;V.length>0;){if(V=f.substring(0,V.length-1),V.length===0){o.text(L),k.getComputedTextLength()>m&&o.text("");break}if(o.text(V+L),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,ue=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,Z=F?2:4,se=F?8:10,J=F?1:2,j=z.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=Q(this),f=e.x1-e.x0,C=e.y1-e.y0,$=o.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),L=m+J+N;for(;L>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(NT||m(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=Q(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=Q(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const T=parseFloat($.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+J;f.attr("y",N);const L=o.x1-o.x0,ie=o.y1-o.y0-4,me=L-2*Z;f.node().getComputedTextLength()>me||N+m>ie||m{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-BSO8qbf3.js b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-C0u56O7S.js similarity index 95% rename from veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-BSO8qbf3.js rename to veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-C0u56O7S.js index 8b75db89a..f362b8707 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-BSO8qbf3.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-C0u56O7S.js @@ -1,4 +1,4 @@ -import{p as I}from"./chunk-JWPE2WC7-CWI15yjG.js";import{aQ as _,V as E,$ as F,aT as D,W as P,aR as z,a as c,aP as G,s as B,r as w,X as C,O as W,at as b,a8 as V,B as H}from"./mermaid.core-DnksLuoJ.js";import{p as X}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),j=W.radar,U=c(()=>w({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),q=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Q,setCurves:Y,setOptions:q,getConfig:U,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;rw({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),q=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Q,setCurves:Y,setOptions:q,getConfig:U,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:l,styles:m};export{S as diagram}; +import{g as m,r as l,d as n}from"./chunk-6Q2QTUOP-BuYPTb-v.js";import{p}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as t,at as o}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:l,styles:m};export{S as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-llttpfV5.js b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-Ccaixrdp.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-llttpfV5.js rename to veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-Ccaixrdp.js index f71aa73f9..877a70c5a 100644 --- a/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-llttpfV5.js +++ b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-Ccaixrdp.js @@ -1,4 +1,4 @@ -import{g as Bt}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as Ft}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as p,aR as Yt,W as Pt,aQ as zt,V as Kt,aT as Gt,$ as Ut,Y as rt,at as V,s as Zt,a0 as jt,aM as Wt,_ as Qt,a4 as Xt,aK as qt,b9 as Ht}from"./mermaid.core-DnksLuoJ.js";import{aB as Jt}from"../../app/index-DZf0wXGZ.js";import{c as $t}from"../../chunks/channel-Cb_XsJlf.js";import"../../chunks/purify.es-BnINGy_Y.js";var gt=function(){var s=p(function(R,n,a,l){for(a=a||{},l=R.length;l--;a[R[l]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],h=[1,11],c=[1,12],u=[1,13],y=[1,23],d=[1,24],m=[1,25],W=[1,26],Q=[1,27],T=[1,19],X=[1,28],B=[1,29],D=[1,20],I=[1,18],S=[1,21],x=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],K=[1,64],A=[1,61],G=[1,65],U=[1,67],q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],Tt=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:p(function(n,a,l,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:x},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:T,48:D,50:I,51:S,52:x},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:K,42:A,45:62,46:63,48:G,49:U},s(q,[2,37]),s(q,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:K,42:A,45:62,46:63,48:G,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:Tt},{40:[1,86],41:[1,87]},s(St,[2,43],{46:88,13:z,41:K,48:G,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:Tt},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:T,48:D,50:I,51:S,52:x},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:K,45:105,46:63,48:G,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(q,[2,39]),s(q,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(St,[2,44],{46:88,13:z,41:K,48:G,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:p(function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},"parseError"),parse:p(function(n){var a=this,l=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,Rt=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(C.yy[pt]=this.yy[pt]);_.setInput(n,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){l.length=l.length-2*b,f.length=f.length-b,t.length=t.length-b}p(Mt,"popStack");function It(){var b;return b=r.pop()||_.lex()||Rt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}p(It,"lex");for(var g,v,k,yt,w={},st,E,xt,it;;){if(v=l[l.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`: +import{g as Bt}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as Ft}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as p,aR as Yt,W as Pt,aQ as zt,V as Kt,aT as Gt,$ as Ut,Y as rt,at as V,s as Zt,a0 as jt,aM as Wt,_ as Qt,a4 as Xt,aK as qt,b9 as Ht}from"./mermaid.core-Byx96n1y.js";import{aB as Jt}from"../../app/index-y89rQfXU.js";import{c as $t}from"../../chunks/channel-CK3FNdKP.js";import"../../chunks/purify.es-BnINGy_Y.js";var gt=function(){var s=p(function(R,n,a,l){for(a=a||{},l=R.length;l--;a[R[l]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],h=[1,11],c=[1,12],u=[1,13],y=[1,23],d=[1,24],m=[1,25],W=[1,26],Q=[1,27],T=[1,19],X=[1,28],B=[1,29],D=[1,20],I=[1,18],S=[1,21],x=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],K=[1,64],A=[1,61],G=[1,65],U=[1,67],q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],Tt=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:p(function(n,a,l,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:x},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:T,48:D,50:I,51:S,52:x},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:K,42:A,45:62,46:63,48:G,49:U},s(q,[2,37]),s(q,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:K,42:A,45:62,46:63,48:G,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:Tt},{40:[1,86],41:[1,87]},s(St,[2,43],{46:88,13:z,41:K,48:G,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:Tt},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:T,48:D,50:I,51:S,52:x},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:K,45:105,46:63,48:G,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(q,[2,39]),s(q,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(St,[2,44],{46:88,13:z,41:K,48:G,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:p(function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},"parseError"),parse:p(function(n){var a=this,l=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,Rt=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(C.yy[pt]=this.yy[pt]);_.setInput(n,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){l.length=l.length-2*b,f.length=f.length-b,t.length=t.length-b}p(Mt,"popStack");function It(){var b;return b=r.pop()||_.lex()||Rt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}p(It,"lex");for(var g,v,k,yt,w={},st,E,xt,it;;){if(v=l[l.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`: `+_.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==Rt?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:l.push(g),f.push(_.yytext),t.push(_.yylloc),l.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,C.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(l=l.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),xt=j[l[l.length-2]][l[l.length-1]],l.push(xt);break;case 3:return!0}}return!0},"parse")},Dt=function(){var R={EOF:1,parseError:p(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:p(function(n,a){return this.yy=a||this.yy||{},this._input=n,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:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var a=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=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),l.length-1&&(this.yylineno-=l.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===r.length?this.yylloc.first_column:0)+r[r.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-CvT_V9C-.js b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DmwC0ruo.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-CvT_V9C-.js rename to veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DmwC0ruo.js index 8dde8cb38..a6f03e909 100644 --- a/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-CvT_V9C-.js +++ b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DmwC0ruo.js @@ -1,4 +1,4 @@ -import{g as Xt}from"./chunk-5VM5RSS4-CjM7JLQ8.js";import{g as Qt}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as Jt}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as m,aa as Zt,aS as Mt,at as J,Y as g1,a4 as $t,aK as te,b9 as rt,aR as ee,aQ as se,aT as ie,W as re,V as ae,$ as ne,x as ue,as as le,J as oe,ao as ce,a0 as st,s as he,N as de,aM as pe}from"./mermaid.core-DnksLuoJ.js";import{c as fe}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{aB as it}from"../../app/index-DZf0wXGZ.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-Cb_XsJlf.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(` +import{g as Xt}from"./chunk-5VM5RSS4-0VUj4cdX.js";import{g as Qt}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as Jt}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as m,aa as Zt,aS as Mt,at as J,Y as g1,a4 as $t,aK as te,b9 as rt,aR as ee,aQ as se,aT as ie,W as re,V as ae,$ as ne,x as ue,as as le,J as oe,ao as ce,a0 as st,s as he,N as de,aM as pe}from"./mermaid.core-Byx96n1y.js";import{c as fe}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{aB as it}from"../../app/index-y89rQfXU.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-CK3FNdKP.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(` `)?f=g+` `:f=`{ `+g+` diff --git a/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CuYQpRVn.js b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CDLstIj6.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CuYQpRVn.js rename to veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CDLstIj6.js index 43d4bd711..26b4e8599 100644 --- a/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CuYQpRVn.js +++ b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CDLstIj6.js @@ -1,4 +1,4 @@ -import{V as An,aQ as Wn,$ as On,aT as $n,W as Hn,aR as Nn,a as d,Y as Yt,B as Vn,L as it,at as Tt,x as Pn,aO as zn,s as Rn,b9 as Bn}from"./mermaid.core-DnksLuoJ.js";import{q as Ke,aA as Zn,a1 as tn,a3 as en,a as nn,at as ae,ak as Xn,L as re,a8 as ie,aB as Xt}from"../../app/index-DZf0wXGZ.js";import{b as qn,t as Oe,c as Gn,a as jn,l as Qn}from"../../chunks/linear-CeDfK4RZ.js";import{i as Jn}from"../../chunks/init-Gi6I4Gst.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";const Kn=Math.PI/180,tr=180/Math.PI,Jt=18,rn=.96422,sn=1,an=.82521,on=4/29,Ft=6/29,cn=3*Ft*Ft,er=Ft*Ft*Ft;function un(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return ln(t);t instanceof Ke||(t=Zn(t));var e=le(t.r),n=le(t.g),r=le(t.b),i=oe((.2225045*e+.7168786*n+.0606169*r)/sn),s,a;return e===n&&n===r?s=a=i:(s=oe((.4360747*e+.3850649*n+.1430804*r)/rn),a=oe((.0139322*e+.0971045*n+.7141733*r)/an)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function nr(t,e,n,r){return arguments.length===1?un(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}tn(ft,nr,en(nn,{brighter(t){return new ft(this.l+Jt*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-Jt*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=rn*ce(e),t=sn*ce(t),n=an*ce(n),new Ke(ue(3.1338561*e-1.6168667*t-.4906146*n),ue(-.9787684*e+1.9161415*t+.033454*n),ue(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oe(t){return t>er?Math.pow(t,1/3):t/cn+on}function ce(t){return t>Ft?t*t*t:cn*(t-on)}function ue(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=un(t)),t.a===0&&t.b===0)return new ht(NaN,0=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function or(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cr(t){return t}var Gt=1,fe=2,ve=3,qt=4,$e=1e-6;function ur(t){return"translate("+t+",0)"}function lr(t){return"translate(0,"+t+")"}function fr(t){return e=>+t(e)}function dr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===qt?-1:1,w=t===qt||t===fe?"x":"y",V=t===Gt||t===ve?ur:lr;function _(Y){var q=r??(e.ticks?e.ticks.apply(e,n):e.domain()),Z=i??(e.tickFormat?e.tickFormat.apply(e,n):cr),v=Math.max(s,0)+y,U=e.range(),z=+U[0]+F,E=+U[U.length-1]+F,R=(e.bandwidth?dr:fr)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(q,e).order(),p=k.exit(),I=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(I),x=x.merge(I.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(I.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===ve?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",$e).attr("transform",function(M){return isFinite(M=R(M))?V(M+F):this.getAttribute("transform")}),I.attr("opacity",$e).attr("transform",function(M){var D=this.parentNode.__axis;return V((D&&isFinite(D=D(M))?D:R(M))+F)})),p.remove(),T.attr("d",t===qt||t===fe?a?"M"+S*a+","+z+"H"+F+"V"+E+"H"+S*a:"M"+F+","+z+"V"+E:a?"M"+z+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+z+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return V(R(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(Z),G.filter(hr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===fe?"start":t===qt?"end":"middle"),G.each(function(){this.__axis=R})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function mr(t){return fn(Gt,t)}function gr(t){return fn(ve,t)}function yr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(de.setTime(+s),he.setTime(+a),t(de),t(he),Math.floor(n(de,he))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,De=yt*7,He=yt*30,me=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const kr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());kr.range;const Vt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Vt.range;const pr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());pr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const Me=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);Me.range;const vr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));vr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/De)}const Rt=Dt(0),Pt=Dt(1),dn=Dt(2),hn=Dt(3),bt=Dt(4),mn=Dt(5),gn=Dt(6);Rt.range;Pt.range;dn.range;hn.range;bt.range;mn.range;gn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/De)}const yn=Mt(0),Kt=Mt(1),Tr=Mt(2),xr=Mt(3),Lt=Mt(4),br=Mt(5),wr=Mt(6);yn.range;Kt.range;Tr.range;xr.range;Lt.range;br.range;wr.range;const zt=nt(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());zt.range;const Dr=nt(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());Dr.range;const kt=nt(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());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Mr(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,De],[e,1,He],[e,3,3*He],[t,1,me]];function y(S,w,V){const _=wv).right(a,_);if(Y===a.length)return t.every(Oe(S/me,w/me,V));if(Y===0)return Et.every(Math.max(Oe(S,w,V),1));const[q,Z]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ye(Ot(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?Kt.ceil(A):Kt(A),A=Me.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=ge(Ot(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Pt.ceil(A):Pt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ye(Ot(f.y,0,1)).getUTCDay():ge(Ot(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ye(f)):ge(f)}}function p(h,N,P,f){for(var tt=0,A=N.length,Q=P.length,X,st;tt=Q)return-1;if(X=N.charCodeAt(tt++),X===37){if(X=N.charAt(tt++),st=G[X in Ne?N.charAt(tt++):X],!st||(f=st(h,P,f))<0)return-1}else if(X!=P.charCodeAt(f++))return-1}return f}function I(h,N,P){var f=S.exec(N.slice(P));return f?(h.p=w.get(f[0].toLowerCase()),P+f[0].length):-1}function x(h,N,P){var f=Y.exec(N.slice(P));return f?(h.w=q.get(f[0].toLowerCase()),P+f[0].length):-1}function C(h,N,P){var f=V.exec(N.slice(P));return f?(h.w=_.get(f[0].toLowerCase()),P+f[0].length):-1}function M(h,N,P){var f=U.exec(N.slice(P));return f?(h.m=z.get(f[0].toLowerCase()),P+f[0].length):-1}function D(h,N,P){var f=Z.exec(N.slice(P));return f?(h.m=v.get(f[0].toLowerCase()),P+f[0].length):-1}function c(h,N,P){return p(h,e,N,P)}function g(h,N,P){return p(h,n,N,P)}function b(h,N,P){return p(h,r,N,P)}function m(h){return a[h.getDay()]}function L(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function $(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",R);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Ne={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Yr=/^%/,Fr=/[\\^$*+?|[\]().{}]/g;function B(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Er(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Ir(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ve(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Pe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Re(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Zr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Be(t,e){return B(t.getDate(),e,2)}function qr(t,e){return B(t.getHours(),e,2)}function Gr(t,e){return B(t.getHours()%12||12,e,2)}function jr(t,e){return B(1+xt.count(kt(t),t),e,3)}function kn(t,e){return B(t.getMilliseconds(),e,3)}function Qr(t,e){return kn(t,e)+"000"}function Jr(t,e){return B(t.getMonth()+1,e,2)}function Kr(t,e){return B(t.getMinutes(),e,2)}function ti(t,e){return B(t.getSeconds(),e,2)}function ei(t){var e=t.getDay();return e===0?7:e}function ni(t,e){return B(Rt.count(kt(t)-1,t),e,2)}function pn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ri(t,e){return t=pn(t),B(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ii(t){return t.getDay()}function si(t,e){return B(Pt.count(kt(t)-1,t),e,2)}function ai(t,e){return B(t.getFullYear()%100,e,2)}function oi(t,e){return t=pn(t),B(t.getFullYear()%100,e,2)}function ci(t,e){return B(t.getFullYear()%1e4,e,4)}function ui(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),B(t.getFullYear()%1e4,e,4)}function li(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+B(e/60|0,"0",2)+B(e%60,"0",2)}function Ze(t,e){return B(t.getUTCDate(),e,2)}function fi(t,e){return B(t.getUTCHours(),e,2)}function di(t,e){return B(t.getUTCHours()%12||12,e,2)}function hi(t,e){return B(1+Me.count(wt(t),t),e,3)}function vn(t,e){return B(t.getUTCMilliseconds(),e,3)}function mi(t,e){return vn(t,e)+"000"}function gi(t,e){return B(t.getUTCMonth()+1,e,2)}function yi(t,e){return B(t.getUTCMinutes(),e,2)}function ki(t,e){return B(t.getUTCSeconds(),e,2)}function pi(t){var e=t.getUTCDay();return e===0?7:e}function vi(t,e){return B(yn.count(wt(t)-1,t),e,2)}function Tn(t){var e=t.getUTCDay();return e>=4||e===0?Lt(t):Lt.ceil(t)}function Ti(t,e){return t=Tn(t),B(Lt.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function xi(t){return t.getUTCDay()}function bi(t,e){return B(Kt.count(wt(t)-1,t),e,2)}function wi(t,e){return B(t.getUTCFullYear()%100,e,2)}function Di(t,e){return t=Tn(t),B(t.getUTCFullYear()%100,e,2)}function Mi(t,e){return B(t.getUTCFullYear()%1e4,e,4)}function Ci(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Lt(t):Lt.ceil(t),B(t.getUTCFullYear()%1e4,e,4)}function Si(){return"+0000"}function Xe(){return"%"}function qe(t){return+t}function Ge(t){return Math.floor(+t/1e3)}var St,te;_i({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 _i(t){return St=_r(t),te=St.format,St.parse,St.utcFormat,St.utcParse,St}function Yi(t){return new Date(t)}function Fi(t){return t instanceof Date?+t:+new Date(+t)}function xn(t,e,n,r,i,s,a,y,F,S){var w=Gn(),V=w.invert,_=w.domain,Y=S(".%L"),q=S(":%S"),Z=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),z=S("%b %d"),E=S("%B"),R=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return q.diff(Z,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var V=this.$utils(),_=!!V.u(w)||w;return V.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}})})(bn);var Ei=bn.exports;const Li=ie(Ei);var wn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},V=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(U){if(!U||U==="Z")return 0;var z=U.match(/([+-]|\d\d)/g),E=60*z[1]+(+z[2]||0);return E===0?0:z[0]==="+"?-E:E}(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var z,E=F.meridiem;if(E){for(var R=1;R<=24;R+=1)if(v.indexOf(E(R,0,U))>-1){z=R>12;break}}else z=v===(U?"pm":"PM");return z},q={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,z=v.match(/\d+/);if(this.day=z[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),z=(_("monthsShort")||U.map(function(E){return E.slice(0,3)})).indexOf(v)+1;if(z<1)throw new Error;this.month=z%12||z}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:V,ZZ:V};function Z(v){var U,z;U=v,z=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,C,M){var D=M&&M.toUpperCase();return C||z[M]||n[M]||z[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,g,b){return g||b.slice(1)})})).match(r),R=E.length,G=0;G-1)return new Date((L==="X"?1e3:1)*m);var u=Z(L)(m),K=u.year,l=u.month,O=u.day,$=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,P=new Date,f=O||(K||l?1:P.getDate()),tt=K||P.getFullYear(),A=0;K&&!l||(A=l>0?l-1:P.getMonth());var Q,X=$||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,X,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,X,st,at,pt)):(Q=new Date(tt,A,f,X,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}}(T,I,k,z),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(I)&&(this.$d=new Date("")),F={}}else if(I instanceof Array)for(var c=I.length,g=1;g<=c;g+=1){p[1]=I[g-1];var b=z.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else R.call(this,G)}}})})(wn);var Ii=wn.exports;const Ai=ie(Ii);var Dn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(V){switch(V){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),V==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),V==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),V==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return V}});return s.bind(this)(w)}}})})(Dn);var Wi=Dn.exports;const Oi=ie(Wi);var Mn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,V=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof R},q=function(T,k,p){return new R(T,p,k.$l)},Z=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},z=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+z(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},R=function(){function T(p,I,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),I)return q(p*_[Z(I)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach(function(c){C.$d[Z(c)]=p[c]}),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map(function(c){return c!=null?Number(c):0});return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(I,x){return I+(p.$d[x]||0)*_[x]},0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),I=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||I.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",L=(b?"-":"")+"P"+p.format+I.format+C.format+m+M.format+D.format+g.format;return L==="P"||L==="-P"?"P0D":L},k.toJSON=function(){return this.toISOString()},k.format=function(p){var I=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return I.replace(V,function(C,M){return M||String(x[C])})},k.as=function(p){return this.$ms/_[Z(p)]},k.get=function(p){var I=this.$ms,x=Z(p);return x==="milliseconds"?I%=1e3:I=x==="weeks"?U(I/_[x]):this.$d[x],I||0},k.add=function(p,I,x){var C;return C=I?p*_[Z(I)]:Y(p)?p.$ms:q(p,this).$ms,q(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,I){return this.add(p,I,!0)},k.locale=function(p){var I=this.clone();return I.$l=p,I},k.clone=function(){return q(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T}(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return q(C,{$l:D},M)},p.isDuration=Y;var I=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):I.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}})})(Mn);var $i=Mn.exports;const Hi=ie($i);var Te=function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],V=[1,9],_=[1,10],Y=[1,11],q=[1,12],Z=[1,13],v=[1,14],U=[1,15],z=[1,16],E=[1,19],R=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],I=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,L,o,W){var u=o.length-1;switch(L){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:q,26:Z,27:v,28:U,29:z,30:E,31:R,33:G,35:T,36:k,37:24,38:p,40:I},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:q,26:Z,27:v,28:U,29:z,30:E,31:R,33:G,35:T,36:k,37:24,38:p,40:I},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],L=[null],o=[],W=this.table,u="",K=0,l=0,O=2,$=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var P=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,L.length=L.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||$,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,X,st,at={},pt,ut,We,Zt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),X=W[Q]&&W[Q][A]),typeof X>"u"||!X.length||!X[0]){var se="";Zt=[];for(pt in W[Q])this.terminals_[pt]&&pt>O&&Zt.push("'"+this.terminals_[pt]+"'");H.showPosition?se="Parse error on line "+(K+1)+`: +import{V as An,aQ as Wn,$ as On,aT as $n,W as Hn,aR as Nn,a as d,Y as Yt,B as Vn,L as it,at as Tt,x as Pn,aO as zn,s as Rn,b9 as Bn}from"./mermaid.core-Byx96n1y.js";import{q as Ke,aA as Zn,a1 as tn,a3 as en,a as nn,at as ae,ak as Xn,L as re,a8 as ie,aB as Xt}from"../../app/index-y89rQfXU.js";import{b as qn,t as Oe,c as Gn,a as jn,l as Qn}from"../../chunks/linear-FRN7TzCz.js";import{i as Jn}from"../../chunks/init-Gi6I4Gst.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";const Kn=Math.PI/180,tr=180/Math.PI,Jt=18,rn=.96422,sn=1,an=.82521,on=4/29,Ft=6/29,cn=3*Ft*Ft,er=Ft*Ft*Ft;function un(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return ln(t);t instanceof Ke||(t=Zn(t));var e=le(t.r),n=le(t.g),r=le(t.b),i=oe((.2225045*e+.7168786*n+.0606169*r)/sn),s,a;return e===n&&n===r?s=a=i:(s=oe((.4360747*e+.3850649*n+.1430804*r)/rn),a=oe((.0139322*e+.0971045*n+.7141733*r)/an)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function nr(t,e,n,r){return arguments.length===1?un(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}tn(ft,nr,en(nn,{brighter(t){return new ft(this.l+Jt*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-Jt*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=rn*ce(e),t=sn*ce(t),n=an*ce(n),new Ke(ue(3.1338561*e-1.6168667*t-.4906146*n),ue(-.9787684*e+1.9161415*t+.033454*n),ue(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oe(t){return t>er?Math.pow(t,1/3):t/cn+on}function ce(t){return t>Ft?t*t*t:cn*(t-on)}function ue(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=un(t)),t.a===0&&t.b===0)return new ht(NaN,0=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function or(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cr(t){return t}var Gt=1,fe=2,ve=3,qt=4,$e=1e-6;function ur(t){return"translate("+t+",0)"}function lr(t){return"translate(0,"+t+")"}function fr(t){return e=>+t(e)}function dr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===qt?-1:1,w=t===qt||t===fe?"x":"y",V=t===Gt||t===ve?ur:lr;function _(Y){var q=r??(e.ticks?e.ticks.apply(e,n):e.domain()),Z=i??(e.tickFormat?e.tickFormat.apply(e,n):cr),v=Math.max(s,0)+y,U=e.range(),z=+U[0]+F,E=+U[U.length-1]+F,R=(e.bandwidth?dr:fr)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(q,e).order(),p=k.exit(),I=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(I),x=x.merge(I.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(I.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===ve?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",$e).attr("transform",function(M){return isFinite(M=R(M))?V(M+F):this.getAttribute("transform")}),I.attr("opacity",$e).attr("transform",function(M){var D=this.parentNode.__axis;return V((D&&isFinite(D=D(M))?D:R(M))+F)})),p.remove(),T.attr("d",t===qt||t===fe?a?"M"+S*a+","+z+"H"+F+"V"+E+"H"+S*a:"M"+F+","+z+"V"+E:a?"M"+z+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+z+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return V(R(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(Z),G.filter(hr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===fe?"start":t===qt?"end":"middle"),G.each(function(){this.__axis=R})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function mr(t){return fn(Gt,t)}function gr(t){return fn(ve,t)}function yr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(de.setTime(+s),he.setTime(+a),t(de),t(he),Math.floor(n(de,he))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,De=yt*7,He=yt*30,me=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const kr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());kr.range;const Vt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Vt.range;const pr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());pr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const Me=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);Me.range;const vr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));vr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/De)}const Rt=Dt(0),Pt=Dt(1),dn=Dt(2),hn=Dt(3),bt=Dt(4),mn=Dt(5),gn=Dt(6);Rt.range;Pt.range;dn.range;hn.range;bt.range;mn.range;gn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/De)}const yn=Mt(0),Kt=Mt(1),Tr=Mt(2),xr=Mt(3),Lt=Mt(4),br=Mt(5),wr=Mt(6);yn.range;Kt.range;Tr.range;xr.range;Lt.range;br.range;wr.range;const zt=nt(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());zt.range;const Dr=nt(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());Dr.range;const kt=nt(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());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Mr(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,De],[e,1,He],[e,3,3*He],[t,1,me]];function y(S,w,V){const _=wv).right(a,_);if(Y===a.length)return t.every(Oe(S/me,w/me,V));if(Y===0)return Et.every(Math.max(Oe(S,w,V),1));const[q,Z]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ye(Ot(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?Kt.ceil(A):Kt(A),A=Me.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=ge(Ot(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Pt.ceil(A):Pt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ye(Ot(f.y,0,1)).getUTCDay():ge(Ot(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ye(f)):ge(f)}}function p(h,N,P,f){for(var tt=0,A=N.length,Q=P.length,X,st;tt=Q)return-1;if(X=N.charCodeAt(tt++),X===37){if(X=N.charAt(tt++),st=G[X in Ne?N.charAt(tt++):X],!st||(f=st(h,P,f))<0)return-1}else if(X!=P.charCodeAt(f++))return-1}return f}function I(h,N,P){var f=S.exec(N.slice(P));return f?(h.p=w.get(f[0].toLowerCase()),P+f[0].length):-1}function x(h,N,P){var f=Y.exec(N.slice(P));return f?(h.w=q.get(f[0].toLowerCase()),P+f[0].length):-1}function C(h,N,P){var f=V.exec(N.slice(P));return f?(h.w=_.get(f[0].toLowerCase()),P+f[0].length):-1}function M(h,N,P){var f=U.exec(N.slice(P));return f?(h.m=z.get(f[0].toLowerCase()),P+f[0].length):-1}function D(h,N,P){var f=Z.exec(N.slice(P));return f?(h.m=v.get(f[0].toLowerCase()),P+f[0].length):-1}function c(h,N,P){return p(h,e,N,P)}function g(h,N,P){return p(h,n,N,P)}function b(h,N,P){return p(h,r,N,P)}function m(h){return a[h.getDay()]}function L(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function $(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",R);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Ne={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Yr=/^%/,Fr=/[\\^$*+?|[\]().{}]/g;function B(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Er(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Ir(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ve(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Pe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Re(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Zr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Be(t,e){return B(t.getDate(),e,2)}function qr(t,e){return B(t.getHours(),e,2)}function Gr(t,e){return B(t.getHours()%12||12,e,2)}function jr(t,e){return B(1+xt.count(kt(t),t),e,3)}function kn(t,e){return B(t.getMilliseconds(),e,3)}function Qr(t,e){return kn(t,e)+"000"}function Jr(t,e){return B(t.getMonth()+1,e,2)}function Kr(t,e){return B(t.getMinutes(),e,2)}function ti(t,e){return B(t.getSeconds(),e,2)}function ei(t){var e=t.getDay();return e===0?7:e}function ni(t,e){return B(Rt.count(kt(t)-1,t),e,2)}function pn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ri(t,e){return t=pn(t),B(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ii(t){return t.getDay()}function si(t,e){return B(Pt.count(kt(t)-1,t),e,2)}function ai(t,e){return B(t.getFullYear()%100,e,2)}function oi(t,e){return t=pn(t),B(t.getFullYear()%100,e,2)}function ci(t,e){return B(t.getFullYear()%1e4,e,4)}function ui(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),B(t.getFullYear()%1e4,e,4)}function li(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+B(e/60|0,"0",2)+B(e%60,"0",2)}function Ze(t,e){return B(t.getUTCDate(),e,2)}function fi(t,e){return B(t.getUTCHours(),e,2)}function di(t,e){return B(t.getUTCHours()%12||12,e,2)}function hi(t,e){return B(1+Me.count(wt(t),t),e,3)}function vn(t,e){return B(t.getUTCMilliseconds(),e,3)}function mi(t,e){return vn(t,e)+"000"}function gi(t,e){return B(t.getUTCMonth()+1,e,2)}function yi(t,e){return B(t.getUTCMinutes(),e,2)}function ki(t,e){return B(t.getUTCSeconds(),e,2)}function pi(t){var e=t.getUTCDay();return e===0?7:e}function vi(t,e){return B(yn.count(wt(t)-1,t),e,2)}function Tn(t){var e=t.getUTCDay();return e>=4||e===0?Lt(t):Lt.ceil(t)}function Ti(t,e){return t=Tn(t),B(Lt.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function xi(t){return t.getUTCDay()}function bi(t,e){return B(Kt.count(wt(t)-1,t),e,2)}function wi(t,e){return B(t.getUTCFullYear()%100,e,2)}function Di(t,e){return t=Tn(t),B(t.getUTCFullYear()%100,e,2)}function Mi(t,e){return B(t.getUTCFullYear()%1e4,e,4)}function Ci(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Lt(t):Lt.ceil(t),B(t.getUTCFullYear()%1e4,e,4)}function Si(){return"+0000"}function Xe(){return"%"}function qe(t){return+t}function Ge(t){return Math.floor(+t/1e3)}var St,te;_i({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 _i(t){return St=_r(t),te=St.format,St.parse,St.utcFormat,St.utcParse,St}function Yi(t){return new Date(t)}function Fi(t){return t instanceof Date?+t:+new Date(+t)}function xn(t,e,n,r,i,s,a,y,F,S){var w=Gn(),V=w.invert,_=w.domain,Y=S(".%L"),q=S(":%S"),Z=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),z=S("%b %d"),E=S("%B"),R=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return q.diff(Z,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var V=this.$utils(),_=!!V.u(w)||w;return V.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}})})(bn);var Ei=bn.exports;const Li=ie(Ei);var wn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},V=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(U){if(!U||U==="Z")return 0;var z=U.match(/([+-]|\d\d)/g),E=60*z[1]+(+z[2]||0);return E===0?0:z[0]==="+"?-E:E}(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var z,E=F.meridiem;if(E){for(var R=1;R<=24;R+=1)if(v.indexOf(E(R,0,U))>-1){z=R>12;break}}else z=v===(U?"pm":"PM");return z},q={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,z=v.match(/\d+/);if(this.day=z[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),z=(_("monthsShort")||U.map(function(E){return E.slice(0,3)})).indexOf(v)+1;if(z<1)throw new Error;this.month=z%12||z}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:V,ZZ:V};function Z(v){var U,z;U=v,z=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,C,M){var D=M&&M.toUpperCase();return C||z[M]||n[M]||z[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,g,b){return g||b.slice(1)})})).match(r),R=E.length,G=0;G-1)return new Date((L==="X"?1e3:1)*m);var u=Z(L)(m),K=u.year,l=u.month,O=u.day,$=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,P=new Date,f=O||(K||l?1:P.getDate()),tt=K||P.getFullYear(),A=0;K&&!l||(A=l>0?l-1:P.getMonth());var Q,X=$||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,X,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,X,st,at,pt)):(Q=new Date(tt,A,f,X,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}}(T,I,k,z),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(I)&&(this.$d=new Date("")),F={}}else if(I instanceof Array)for(var c=I.length,g=1;g<=c;g+=1){p[1]=I[g-1];var b=z.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else R.call(this,G)}}})})(wn);var Ii=wn.exports;const Ai=ie(Ii);var Dn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(V){switch(V){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),V==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),V==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),V==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return V}});return s.bind(this)(w)}}})})(Dn);var Wi=Dn.exports;const Oi=ie(Wi);var Mn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,V=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof R},q=function(T,k,p){return new R(T,p,k.$l)},Z=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},z=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+z(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},R=function(){function T(p,I,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),I)return q(p*_[Z(I)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach(function(c){C.$d[Z(c)]=p[c]}),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map(function(c){return c!=null?Number(c):0});return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(I,x){return I+(p.$d[x]||0)*_[x]},0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),I=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||I.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",L=(b?"-":"")+"P"+p.format+I.format+C.format+m+M.format+D.format+g.format;return L==="P"||L==="-P"?"P0D":L},k.toJSON=function(){return this.toISOString()},k.format=function(p){var I=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return I.replace(V,function(C,M){return M||String(x[C])})},k.as=function(p){return this.$ms/_[Z(p)]},k.get=function(p){var I=this.$ms,x=Z(p);return x==="milliseconds"?I%=1e3:I=x==="weeks"?U(I/_[x]):this.$d[x],I||0},k.add=function(p,I,x){var C;return C=I?p*_[Z(I)]:Y(p)?p.$ms:q(p,this).$ms,q(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,I){return this.add(p,I,!0)},k.locale=function(p){var I=this.clone();return I.$l=p,I},k.clone=function(){return q(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T}(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return q(C,{$l:D},M)},p.isDuration=Y;var I=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):I.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}})})(Mn);var $i=Mn.exports;const Hi=ie($i);var Te=function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],V=[1,9],_=[1,10],Y=[1,11],q=[1,12],Z=[1,13],v=[1,14],U=[1,15],z=[1,16],E=[1,19],R=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],I=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,L,o,W){var u=o.length-1;switch(L){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:q,26:Z,27:v,28:U,29:z,30:E,31:R,33:G,35:T,36:k,37:24,38:p,40:I},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:q,26:Z,27:v,28:U,29:z,30:E,31:R,33:G,35:T,36:k,37:24,38:p,40:I},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],L=[null],o=[],W=this.table,u="",K=0,l=0,O=2,$=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var P=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,L.length=L.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||$,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,X,st,at={},pt,ut,We,Zt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),X=W[Q]&&W[Q][A]),typeof X>"u"||!X.length||!X[0]){var se="";Zt=[];for(pt in W[Q])this.terminals_[pt]&&pt>O&&Zt.push("'"+this.terminals_[pt]+"'");H.showPosition?se="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Zt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":se="Parse error on line "+(K+1)+": Unexpected "+(A==$?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(se,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Zt})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(X[0]){case 1:b.push(A),L.push(H.yytext),o.push(H.yylloc),b.push(X[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[X[1]][1],at.$=L[L.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},P&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,X[1],L,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),L=L.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[X[1]][0]),L.push(at.$),o.push(at._$),We=W[b[b.length-2]][b[b.length-1]],b.push(We);break;case 3:return!0}}return!0},"parse")},C=function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.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),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var L=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:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[L[0],L[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-D9mrrxwi.js b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-B7nKkelP.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-D9mrrxwi.js rename to veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-B7nKkelP.js index e8da7983d..72ee7b4a8 100644 --- a/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-D9mrrxwi.js +++ b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-B7nKkelP.js @@ -1,4 +1,4 @@ -import{I as he}from"./chunk-2Q5K7J3B-naaeokok.js";import{p as $e}from"./chunk-JWPE2WC7-CWI15yjG.js";import{$ as fe,aT as ge,aQ as ue,V as ye,W as xe,aR as me,a as $,X as J,at as k,Y as z,b9 as pe,aX as be,s as we,x as L,r as ke,O as ve,aH as Ee}from"./mermaid.core-DnksLuoJ.js";import{p as Be}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import{aB as Ce}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=ve.gitGraph,D=$(()=>ke({...Te,...J().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Ee({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Se=$(function(){i.reset(),we()},"clear"),Ae=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),We=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),qe=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Se,getBranchesAsObjArray:Ae,getBranches:De,getCommits:We,getCommitsArray:se,getCurrentBranch:Pe,getDirection:qe,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Be("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,S=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Q=12,ee=new Set(["redux-color","redux-dark-color"]),Qe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),A=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Je=$(()=>{C.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=C.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=C.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Qe.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${A(s,S,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${A(s,S,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${A(s,S,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",` +import{I as he}from"./chunk-2Q5K7J3B-Df19aPp9.js";import{p as $e}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{$ as fe,aT as ge,aQ as ue,V as ye,W as xe,aR as me,a as $,X as J,at as k,Y as z,b9 as pe,aX as be,s as we,x as L,r as ke,O as ve,aH as Ee}from"./mermaid.core-Byx96n1y.js";import{p as Be}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import{aB as Ce}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=ve.gitGraph,D=$(()=>ke({...Te,...J().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Ee({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Se=$(function(){i.reset(),we()},"clear"),Ae=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),We=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),qe=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Se,getBranchesAsObjArray:Ae,getBranches:De,getCommits:We,getCommitsArray:se,getCurrentBranch:Pe,getDirection:qe,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Be("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,S=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Q=12,ee=new Set(["redux-color","redux-dark-color"]),Qe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),A=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Je=$(()=>{C.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=C.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=C.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Qe.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${A(s,S,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${A(s,S,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${A(s,S,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",` ${o-n/2-M/2},${u+I} ${o-n/2-M/2},${u-I} ${t.posWithOffset-n/2-M},${u-x-I} diff --git a/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-BdqavOdZ.js b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-B7-q34pi.js similarity index 69% rename from veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-BdqavOdZ.js rename to veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-B7-q34pi.js index 5c72a203a..44cc876e5 100644 --- a/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-BdqavOdZ.js +++ b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-B7-q34pi.js @@ -1,2 +1,2 @@ -import{a as e,at as s,aP as n,B as i}from"./mermaid.core-DnksLuoJ.js";import{p}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.16.1"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram +import{a as e,at as s,aP as n,B as i}from"./mermaid.core-Byx96n1y.js";import{p}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.16.1"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram `+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),f={draw:c},w={parser:g,db:m,renderer:f};export{w as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-C-ri3OTd.js b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-C-ri3OTd.js rename to veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js index f29be4c6e..a9b8296fc 100644 --- a/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-C-ri3OTd.js +++ b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js @@ -1,4 +1,4 @@ -import{a as o,Y as ot,aC as ut,aP as dt,k as yt,s as ft,x as pt,aT as it,W as gt,aR as kt,V as mt,aQ as wt,$ as _t,B as xt}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],b=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(b,[2,11]),e(b,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),x=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);x.setInput(t,C.yy),C.yy.lexer=x,C.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var T=x.yylloc;n.push(T);var D=x.options&&x.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||x.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,Q,H={},Z,V,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var q="";X=[];for(Z in v[W])this.terminals_[Z]&&Z>L&&X.push("'"+this.terminals_[Z]+"'");x.showPosition?q="Parse error on line "+(I+1)+`: +import{a as o,Y as ot,aC as ut,aP as dt,k as yt,s as ft,x as pt,aT as it,W as gt,aR as kt,V as mt,aQ as wt,$ as _t,B as xt}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],b=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(b,[2,11]),e(b,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),x=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);x.setInput(t,C.yy),C.yy.lexer=x,C.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var T=x.yylloc;n.push(T);var D=x.options&&x.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||x.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,Q,H={},Z,V,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var q="";X=[];for(Z in v[W])this.terminals_[Z]&&Z>L&&X.push("'"+this.terminals_[Z]+"'");x.showPosition?q="Parse error on line "+(I+1)+`: `+x.showPosition()+` Expecting `+X.join(", ")+", got '"+(this.terminals_[A]||A)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:T,expected:X})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(x.yytext),n.push(x.yylloc),i.push(B[1]),A=null,S=x.yyleng,w=x.yytext,I=x.yylineno,T=x.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),Q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof Q<"u")return Q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;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),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-DItBOT4l.js b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-CEEbz2Rm.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-DItBOT4l.js rename to veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-CEEbz2Rm.js index 3efc07d4e..81532b9b6 100644 --- a/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-DItBOT4l.js +++ b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-CEEbz2Rm.js @@ -1,4 +1,4 @@ -import{g as gt}from"./chunk-5VM5RSS4-CjM7JLQ8.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{V as _t,aQ as vt,W as bt,aR as wt,$ as Tt,aT as St,a as s,Y as R,B as $t,s as Mt}from"./mermaid.core-DnksLuoJ.js";import{aB as G}from"../../app/index-DZf0wXGZ.js";import{d as it}from"../../chunks/arc-CXEGKubz.js";import"../../chunks/purify.es-BnINGy_Y.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,K=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`: +import{g as gt}from"./chunk-5VM5RSS4-0VUj4cdX.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{V as _t,aQ as vt,W as bt,aR as wt,$ as Tt,aT as St,a as s,Y as R,B as $t,s as Mt}from"./mermaid.core-Byx96n1y.js";import{aB as G}from"../../app/index-y89rQfXU.js";import{d as it}from"../../chunks/arc-BmSNZeim.js";import"../../chunks/purify.es-BnINGy_Y.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,K=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`: `+_.showPosition()+` Expecting `+W.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:W})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,K=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,K,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||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:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.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),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=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),l.length-1&&(this.yylineno-=l.length-1);var d=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:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(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:s(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:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-DwDU3r_E.js b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-4S3DxCBE.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-DwDU3r_E.js rename to veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-4S3DxCBE.js index 19b9f7d93..4fa1fbdb1 100644 --- a/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-DwDU3r_E.js +++ b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-4S3DxCBE.js @@ -1,4 +1,4 @@ -import{a as c,at as te,Y as W,aP as fe,ad as ye,ag as be,aG as me,aW as ke,O as K,aN as F,as as Ee,J as _e,ak as Se,ap as le,H as ce}from"./mermaid.core-DnksLuoJ.js";import{g as Ne}from"./chunk-5VM5RSS4-CjM7JLQ8.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var $=function(){var t=c(function(k,s,n,a){for(n=n||{},a=k.length;a--;n[k[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],E=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],H=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:H}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:H}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var _,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((_===null||typeof _>"u")&&(_=ae()),v=B[R]&&B[R][_]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`: +import{a as c,at as te,Y as W,aP as fe,ad as ye,ag as be,aG as me,aW as ke,O as K,aN as F,as as Ee,J as _e,ak as Se,ap as le,H as ce}from"./mermaid.core-Byx96n1y.js";import{g as Ne}from"./chunk-5VM5RSS4-0VUj4cdX.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var $=function(){var t=c(function(k,s,n,a){for(n=n||{},a=k.length;a--;n[k[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],E=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],H=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:H}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:H}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var _,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((_===null||typeof _>"u")&&(_=ae()),v=B[R]&&B[R][_]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`: `+m.showPosition()+` Expecting `+Y.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(_==re?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[_]||_,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+_);switch(v[0]){case 1:a.push(_),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),_=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var k={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.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),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js b/veadk/webui/assets/visualizations/mermaid/mermaid.core-Byx96n1y.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js rename to veadk/webui/assets/visualizations/mermaid/mermaid.core-Byx96n1y.js index 892de468d..d899ca743 100644 --- a/veadk/webui/assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js +++ b/veadk/webui/assets/visualizations/mermaid/mermaid.core-Byx96n1y.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/dagre-VZM6K2ZE-CoK1hzcv.js","assets/visualizations/mermaid/chunk-RYQCIY6F-DfwPULTh.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-DZf0wXGZ.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-D1dh_Nns.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-GA0ao5B_.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Bra67sdL.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-CJwzhEYx.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-CvT_V9C-.js","assets/visualizations/mermaid/chunk-5VM5RSS4-CjM7JLQ8.js","assets/visualizations/mermaid/chunk-XXDRQBXY-DWj8dVYC.js","assets/visualizations/mermaid/chunk-KBJHAD2P-CNEAUy5I.js","assets/chunks/channel-Cb_XsJlf.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-llttpfV5.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-D9mrrxwi.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-naaeokok.js","assets/visualizations/mermaid/chunk-JWPE2WC7-CWI15yjG.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-DAp7f4c2.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CuYQpRVn.js","assets/chunks/linear-CeDfK4RZ.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-BdqavOdZ.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-DnQbiAd6.js","assets/chunks/arc-CXEGKubz.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-BHagSQYD.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DfWAA2AU.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-JYMpFkh0.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Bqv2AfOc.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-B8-0NVyL.js","assets/visualizations/mermaid/chunk-GF5L2VYU-BsdMVsbj.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B8-0NVyL.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-7KBZw4rp.js","assets/visualizations/mermaid/chunk-5RXB4S5H-gjMuKq5U.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-DItBOT4l.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dz8AxK7r.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CgfY0Ls2.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-DwDU3r_E.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BF_iEz9u.js","assets/visualizations/mermaid/diagram-LBJQPF4R-Du7527yu.js","assets/visualizations/mermaid/diagram-UB23O5K3-BSO8qbf3.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-DdQPoes9.js","assets/visualizations/mermaid/diagram-7IWD3JNH-SC1XlXnp.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-Bqx-XTbw.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-60-I7wkZ.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-C-ri3OTd.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-qZKAtDe0.js","assets/visualizations/mermaid/diagram-Q27KOJAE-s-EXVUXN.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-DvjwaJgh.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-B1L5kWTo.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-Biow3FMP.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-D_idPgQl.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-D1IH6bGb.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-BCBAEFx3.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-Reiw3hvB.js"])))=>i.map(i=>d[i]); -var gg=Object.defineProperty;var pg=(e,t,r)=>t in e?gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xt=(e,t,r)=>pg(e,typeof t!="symbol"?t+"":t,r);import{a8 as fg,L as mg,_ as ht,aB as ct}from"../../app/index-DZf0wXGZ.js";import fr from"../../chunks/purify.es-BnINGy_Y.js";var pl=Object.defineProperty,p=(e,t)=>pl(e,"name",{value:t,configurable:!0}),yg=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fl={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(mg,function(){var r=1e3,i=6e4,s=36e5,a="millisecond",o="second",l="minute",n="hour",c="day",h="week",d="month",g="quarter",u="year",y="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|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($){var F=["th","st","nd","rd"],_=$%100;return"["+$+(F[(_-20)%10]||F[_]||F[0])+"]"}},k=function($,F,_){var E=String($);return!E||E.length>=F?$:""+Array(F+1-E.length).join(_)+$},S={s:k,z:function($){var F=-$.utcOffset(),_=Math.abs(F),E=Math.floor(_/60),M=_%60;return(F<=0?"+":"-")+k(E,2,"0")+":"+k(M,2,"0")},m:function $(F,_){if(F.date()<_.date())return-$(_,F);var E=12*(_.year()-F.year())+(_.month()-F.month()),M=F.clone().add(E,d),R=_-M<0,N=F.clone().add(E+(R?-1:1),d);return+(-(E+(_-M)/(R?M-N:N-M))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:u,w:h,d:c,D:y,h:n,m:l,s:o,ms:a,Q:g}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",w={};w[T]=b;var L="$isDayjsObject",v=function($){return $ instanceof H||!(!$||!$[L])},W=function $(F,_,E){var M;if(!F)return T;if(typeof F=="string"){var R=F.toLowerCase();w[R]&&(M=R),_&&(w[R]=_,M=R);var N=F.split("-");if(!M&&N.length>1)return $(N[0])}else{var U=F.name;w[U]=F,M=U}return!E&&M&&(T=M),M||!E&&T},P=function($,F){if(v($))return $.clone();var _=typeof F=="object"?F:{};return _.date=$,_.args=arguments,new H(_)},A=S;A.l=W,A.i=v,A.w=function($,F){return P($,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var H=function(){function $(_){this.$L=W(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[L]=!0}var F=$.prototype;return F.parse=function(_){this.$d=function(E){var M=E.date,R=E.utc;if(M===null)return new Date(NaN);if(A.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var N=M.match(m);if(N){var U=N[2]-1||0,Z=(N[7]||"0").substring(0,3);return R?new Date(Date.UTC(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)):new Date(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)}}return new Date(M)}(_),this.init()},F.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},F.$utils=function(){return A},F.isValid=function(){return this.$d.toString()!==f},F.isSame=function(_,E){var M=P(_);return this.startOf(E)<=M&&M<=this.endOf(E)},F.isAfter=function(_,E){return P(_){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},ua=p(function(e="fatal"){let t=ue.fatal;typeof e=="string"?e.toLowerCase()in ue&&(t=ue[e]):typeof e=="number"&&(t=e),z.trace=()=>{},z.debug=()=>{},z.info=()=>{},z.warn=()=>{},z.error=()=>{},z.fatal=()=>{},t<=ue.fatal&&(z.fatal=console.error?console.error.bind(console,Xt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xt("FATAL"))),t<=ue.error&&(z.error=console.error?console.error.bind(console,Xt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xt("ERROR"))),t<=ue.warn&&(z.warn=console.warn?console.warn.bind(console,Xt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xt("WARN"))),t<=ue.info&&(z.info=console.info?console.info.bind(console,Xt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xt("INFO"))),t<=ue.debug&&(z.debug=console.debug?console.debug.bind(console,Xt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("DEBUG"))),t<=ue.trace&&(z.trace=console.debug?console.debug.bind(console,Xt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("TRACE")))},"setLogLevel"),Xt=p(e=>`%c${xg().format("ss.SSS")} : ${e} : `,"format");const di={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:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s;switch(i){case"r":return di.hue2rgb(a,s,e+1/3)*255;case"g":return di.hue2rgb(a,s,e)*255;case"b":return di.hue2rgb(a,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),a=Math.min(e,t,r),o=(s+a)/2;if(i==="l")return o*100;if(s===a)return 0;const l=s-a,n=o>.5?l/(2-s-a):l/(s+a);if(i==="s")return n*100;switch(s){case e:return((t-r)/l+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},kg={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},nt={channel:di,lang:bg,unit:kg},xe={};for(let e=0;e<=255;e++)xe[e]=nt.unit.dec2hex(e);const Ot={ALL:0,RGB:1,HSL:2};class Sg{constructor(){this.type=Ot.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ot.ALL}is(t){return this.type===t}}class Tg{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Sg}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ot.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=nt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=nt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=nt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=nt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=nt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=nt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ot.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ot.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ot.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ot.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ot.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ot.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ui=new Tg({r:0,g:0,b:0,a:0},"transparent"),Je={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Je.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,a=s%4===0,o=s>4,l=o?1:17,n=o?8:4,c=a?0:-1,h=o?255:15;return Ui.set({r:(i>>n*(c+3)&h)*l,g:(i>>n*(c+2)&h)*l,b:(i>>n*(c+1)&h)*l,a:a?(i&h)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}${xe[Math.round(s*255)]}`:`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}`}},$e={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:e=>{const t=e.match($e.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return nt.channel.clamp.h(parseFloat(r)*.9);case"rad":return nt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return nt.channel.clamp.h(parseFloat(r)*360)}}return nt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match($e.re);if(!r)return;const[,i,s,a,o,l]=r;return Ui.set({h:$e._hue2deg(i),s:nt.channel.clamp.s(parseFloat(s)),l:nt.channel.clamp.l(parseFloat(a)),a:o?nt.channel.clamp.a(l?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%, ${s})`:`hsl(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%)`}},Ir={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:e=>{e=e.toLowerCase();const t=Ir.colors[e];if(t)return Je.parse(t)},stringify:e=>{const t=Je.stringify(e);for(const r in Ir.colors)if(Ir.colors[r]===t)return r}},Mr={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:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Mr.re);if(!r)return;const[,i,s,a,o,l,n,c,h]=r;return Ui.set({r:nt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:nt.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:nt.channel.clamp.b(n?parseFloat(l)*2.55:parseFloat(l)),a:c?nt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)}, ${nt.lang.round(s)})`:`rgb(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)})`}},oe={format:{keyword:Ir,hex:Je,rgb:Mr,rgba:Mr,hsl:$e,hsla:$e},parse:e=>{if(typeof e!="string")return e;const t=Je.parse(e)||Mr.parse(e)||$e.parse(e)||Ir.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ot.HSL)||e.data.r===void 0?$e.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Mr.stringify(e):Je.stringify(e)},ml=(e,t)=>{const r=oe.parse(e);for(const i in t)r[i]=nt.channel.clamp[i](t[i]);return oe.stringify(r)},Se=(e,t,r=0,i=1)=>{if(typeof e!="number")return ml(e,{a:t});const s=Ui.set({r:nt.channel.clamp.r(e),g:nt.channel.clamp.g(t),b:nt.channel.clamp.b(r),a:nt.channel.clamp.a(i)});return oe.stringify(s)},wg=e=>{const{r:t,g:r,b:i}=oe.parse(e),s=.2126*nt.channel.toLinear(t)+.7152*nt.channel.toLinear(r)+.0722*nt.channel.toLinear(i);return nt.lang.round(s)},Bg=e=>wg(e)>=.5,re=e=>!Bg(e),yl=(e,t,r)=>{const i=oe.parse(e),s=i[t],a=nt.channel.clamp[t](s+r);return s!==a&&(i[t]=a),oe.stringify(i)},I=(e,t)=>yl(e,"l",t),D=(e,t)=>yl(e,"l",-t),x=(e,t)=>{const r=oe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return ml(e,i)},_g=(e,t,r=50)=>{const{r:i,g:s,b:a,a:o}=oe.parse(e),{r:l,g:n,b:c,a:h}=oe.parse(t),d=r/100,g=d*2-1,u=o-h,f=((g*u===-1?g:(g+u)/(1+g*u))+1)/2,m=1-f,C=i*f+l*m,b=s*f+n*m,k=a*f+c*m,S=o*d+h*(1-d);return Se(C,b,k,S)},B=(e,t=100)=>{const r=oe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,_g(r,e,t)};var ks=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ks(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([a,o])=>{if(typeof o=="object"){if(o===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[a]===void 0&&(s[a]=Array.isArray(o)?[]:{}),typeof s[a]=="object"&&(s[a]=ks(s[a],o,{depth:r-1}))}else typeof s[a]!="object"&&(Object.hasOwn(e,a)?s[a]=o:Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ft=ks,ne="#ffffff",he="#f2f2f2",at=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),er,vg=(er=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,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft,O;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||D(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10)):(this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let lt=0;lt{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(er,"Theme"),er),Lg=p(e=>{const t=new vg;return t.calculate(e),t},"getThemeVariables"),rr,Fg=(rr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Se(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=D("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=D(this.sectionBkgColor,10),this.taskBorderColor=Se(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Se(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||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(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=I(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=I(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=B(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=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(rr,"Theme"),rr),Mg=p(e=>{const t=new Fg;return t.calculate(e),t},"getThemeVariables"),ir,Ag=(ir=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=at(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=Se(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ir,"Theme"),ir),Eg=p(e=>{const t=new Ag;return t.calculate(e),t},"getThemeVariables"),sr,$g=(sr=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=I("#cde498",10),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.actorBorder=D(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(sr,"Theme"),sr),Og=p(e=>{const t=new $g;return t.calculate(e),t},"getThemeVariables"),ar,Ig=(ar=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=I(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(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||I(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.contrast,55),this.border2=this.contrast,this.actorBorder=I(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 O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ar,"Theme"),ar),Dg=p(e=>{const t=new Ig;return t.calculate(e),t},"getThemeVariables"),or,Pg=(or=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=at(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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||x(t,{h:30}),this.cScale4=this.cScale4||x(t,{h:60}),this.cScale5=this.cScale5||x(t,{h:90}),this.cScale6=this.cScale6||x(t,{h:120}),this.cScale7=this.cScale7||x(t,{h:150}),this.cScale8=this.cScale8||x(t,{h:210,l:150}),this.cScale9=this.cScale9||x(t,{h:270}),this.cScale10=this.cScale10||x(t,{h:300}),this.cScale11=this.cScale11||x(t,{h:330}),this.darkMode)for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(or,"Theme"),or),Rg=p(e=>{const t=new Pg;return t.calculate(e),t},"getThemeVariables"),lr,qg=(lr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(lr,"Theme"),lr),Wg=p(e=>{const t=new qg;return t.calculate(e),t},"getThemeVariables"),nr,zg=(nr=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=at("#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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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 m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(nr,"Theme"),nr),Ng=p(e=>{const t=new zg;return t.calculate(e),t},"getThemeVariables"),hr,Hg=(hr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(hr,"Theme"),hr),Yg=p(e=>{const t=new Hg;return t.calculate(e),t},"getThemeVariables"),cr,jg=(cr=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=at(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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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 m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(cr,"Theme"),cr),Ug=p(e=>{const t=new jg;return t.calculate(e),t},"getThemeVariables"),dr,Xg=(dr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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 u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(dr,"Theme"),dr),Gg=p(e=>{const t=new Xg;return t.calculate(e),t},"getThemeVariables"),fe={base:{getThemeVariables:Lg},dark:{getThemeVariables:Mg},default:{getThemeVariables:Eg},forest:{getThemeVariables:Og},neutral:{getThemeVariables:Dg},neo:{getThemeVariables:Rg},"neo-dark":{getThemeVariables:Wg},redux:{getThemeVariables:Ng},"redux-dark":{getThemeVariables:Yg},"redux-color":{getThemeVariables:Ug},"redux-dark-color":{getThemeVariables:Gg}},At={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},Cl={...At,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:fe.default.getThemeVariables(),sequence:{...At.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...At.gantt,tickInterval:void 0,useWidth:void 0},c4:{...At.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...At.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...At.pie,useWidth:984},xyChart:{...At.xyChart,useWidth:void 0},requirement:{...At.requirement,useWidth:void 0},packet:{...At.packet},eventmodeling:{...At.eventmodeling},treeView:{...At.treeView,useWidth:void 0},radar:{...At.radar},railroad:{...At.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:{...At.ishikawa},sankey:{...At.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:{...At.venn},cynefin:{...At.cynefin}},xl=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...xl(e[i],"")]:[...r,t+i],[]),"keyify"),Vg=new Set(xl(Cl,"")),bl=Cl,Zg={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qg=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(z.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ki=p(e=>{if(z.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ki(t));return}for(const t of Object.keys(e)){if(z.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Vg.has(t)||e[t]==null){z.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=Zg[t];i?Qg(e[t],i):(z.debug("sanitizing object",t),ki(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(z.debug("sanitizing css option",t),e[t]=kl(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}z.debug("After sanitization",e)}},"sanitizeDirective"),kl=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ht=Ft({},mr),Si,Pe=[],Dr=Ft({},mr),Vr=p((e,t)=>{let r=Ft({},e),i={};for(const s of t)wl(s),i=Ft(i,s);if(r=Ft(r,i),i.theme&&i.theme in fe){const s=Ft({},Si),a=Ft(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in fe&&(r.themeVariables=fe[r.theme].getThemeVariables(a))}return Dr=r,ip(Dr),Dr},"updateCurrentConfig"),Kg=p(e=>(Ht=Ft({},mr),Ht=Ft(Ht,e),e.theme&&fe[e.theme]&&(Ht.themeVariables=fe[e.theme].getThemeVariables(e.themeVariables)),Vr(Ht,Pe),Ht),"setSiteConfig"),Jg=p(e=>{Si=Ft({},e)},"saveConfigFromInitialize"),tp=p(e=>(Ht=Ft(Ht,e),Vr(Ht,Pe),Ht),"updateSiteConfig"),Sl=p(()=>Ft({},Ht),"getSiteConfig"),Tl=p(e=>(Vr(Dr,[e]),Tt()),"setConfig"),Tt=p(()=>Ft({},Dr),"getConfig"),wl=p(e=>{e&&(["secure",...Ht.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(z.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&wl(e[t])}))},"sanitize"),ep=p(e=>{var t;ki(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Pe.push(e),Vr(Ht,Pe)},"addDirective"),Ti=p((e=Ht)=>{Pe=[],Vr(e,Pe)},"reset"),rp={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."},no={},Bl=p(e=>{no[e]||(z.warn(rp[e]),no[e]=!0)},"issueWarning"),ip=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bl("LAZY_LOAD_DEPRECATED")},"checkConfig"),$1=p(()=>{let e={};Si&&(e=Ft(e,Si));for(const t of Pe)e=Ft(e,t);return e},"getUserDefinedConfig"),zt=p(e=>{var t,r;return((t=e.flowchart)==null?void 0:t.htmlLabels)!=null&&Bl("FLOWCHART_HTML_LABELS_DEPRECATED"),ce(e.htmlLabels??((r=e.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),_l=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Pr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sp=/\s*%%.*\n/gm,ur,vl=(ur=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(ur,"UnknownDiagramError"),ur),Re={},ga=p(function(e,t){e=e.replace(_l,"").replace(Pr,"").replace(sp,` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/dagre-VZM6K2ZE-Bh80CoKM.js","assets/visualizations/mermaid/chunk-RYQCIY6F-CvZ-mg4G.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-y89rQfXU.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-CR3Yx4nf.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BwttPwJa.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-B9klRQ1P.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-w7u93fzV.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DmwC0ruo.js","assets/visualizations/mermaid/chunk-5VM5RSS4-0VUj4cdX.js","assets/visualizations/mermaid/chunk-XXDRQBXY-DF1LpnDY.js","assets/visualizations/mermaid/chunk-KBJHAD2P-BwJsQpfI.js","assets/chunks/channel-CK3FNdKP.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DpcZasdm.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-Ccaixrdp.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-B7nKkelP.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-Df19aPp9.js","assets/visualizations/mermaid/chunk-JWPE2WC7-s5uAWi9x.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-CfYIu5D_.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-CDLstIj6.js","assets/chunks/linear-FRN7TzCz.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-B7-q34pi.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-9it0uedZ.js","assets/chunks/arc-BmSNZeim.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CTiy7YiT.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CSukDV3q.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BEni_WUb.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-ClGkLfJ7.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-B86LdNwl.js","assets/visualizations/mermaid/chunk-GF5L2VYU-CdzaapU0.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B86LdNwl.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-BrlX_tes.js","assets/visualizations/mermaid/chunk-5RXB4S5H-CziPj31s.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-BUH5KdnU.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-CEEbz2Rm.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dq9PHz3C.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-N5zHU5MK.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-4S3DxCBE.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CmNhKWbi.js","assets/visualizations/mermaid/diagram-LBJQPF4R-B24oG5BD.js","assets/visualizations/mermaid/diagram-UB23O5K3-C0u56O7S.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-wh52Ecel.js","assets/visualizations/mermaid/diagram-7IWD3JNH-CHjc3YK7.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BC0iLzBL.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-Crk5VMXY.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-CYHQcSxC.js","assets/visualizations/mermaid/diagram-Q27KOJAE-CHt3iGyV.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Dkoo2yzf.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-h-hlAvXc.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-PGVg3Gs4.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-BuYPTb-v.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-288CQcDu.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-DmJtql8p.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-BOK0qG_k.js"])))=>i.map(i=>d[i]); +var gg=Object.defineProperty;var pg=(e,t,r)=>t in e?gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xt=(e,t,r)=>pg(e,typeof t!="symbol"?t+"":t,r);import{a8 as fg,L as mg,_ as ht,aB as ct}from"../../app/index-y89rQfXU.js";import fr from"../../chunks/purify.es-BnINGy_Y.js";var pl=Object.defineProperty,p=(e,t)=>pl(e,"name",{value:t,configurable:!0}),yg=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fl={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(mg,function(){var r=1e3,i=6e4,s=36e5,a="millisecond",o="second",l="minute",n="hour",c="day",h="week",d="month",g="quarter",u="year",y="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|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($){var F=["th","st","nd","rd"],_=$%100;return"["+$+(F[(_-20)%10]||F[_]||F[0])+"]"}},k=function($,F,_){var E=String($);return!E||E.length>=F?$:""+Array(F+1-E.length).join(_)+$},S={s:k,z:function($){var F=-$.utcOffset(),_=Math.abs(F),E=Math.floor(_/60),M=_%60;return(F<=0?"+":"-")+k(E,2,"0")+":"+k(M,2,"0")},m:function $(F,_){if(F.date()<_.date())return-$(_,F);var E=12*(_.year()-F.year())+(_.month()-F.month()),M=F.clone().add(E,d),R=_-M<0,N=F.clone().add(E+(R?-1:1),d);return+(-(E+(_-M)/(R?M-N:N-M))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:u,w:h,d:c,D:y,h:n,m:l,s:o,ms:a,Q:g}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",w={};w[T]=b;var L="$isDayjsObject",v=function($){return $ instanceof H||!(!$||!$[L])},W=function $(F,_,E){var M;if(!F)return T;if(typeof F=="string"){var R=F.toLowerCase();w[R]&&(M=R),_&&(w[R]=_,M=R);var N=F.split("-");if(!M&&N.length>1)return $(N[0])}else{var U=F.name;w[U]=F,M=U}return!E&&M&&(T=M),M||!E&&T},P=function($,F){if(v($))return $.clone();var _=typeof F=="object"?F:{};return _.date=$,_.args=arguments,new H(_)},A=S;A.l=W,A.i=v,A.w=function($,F){return P($,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var H=function(){function $(_){this.$L=W(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[L]=!0}var F=$.prototype;return F.parse=function(_){this.$d=function(E){var M=E.date,R=E.utc;if(M===null)return new Date(NaN);if(A.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var N=M.match(m);if(N){var U=N[2]-1||0,Z=(N[7]||"0").substring(0,3);return R?new Date(Date.UTC(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)):new Date(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)}}return new Date(M)}(_),this.init()},F.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},F.$utils=function(){return A},F.isValid=function(){return this.$d.toString()!==f},F.isSame=function(_,E){var M=P(_);return this.startOf(E)<=M&&M<=this.endOf(E)},F.isAfter=function(_,E){return P(_){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},ua=p(function(e="fatal"){let t=ue.fatal;typeof e=="string"?e.toLowerCase()in ue&&(t=ue[e]):typeof e=="number"&&(t=e),z.trace=()=>{},z.debug=()=>{},z.info=()=>{},z.warn=()=>{},z.error=()=>{},z.fatal=()=>{},t<=ue.fatal&&(z.fatal=console.error?console.error.bind(console,Xt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xt("FATAL"))),t<=ue.error&&(z.error=console.error?console.error.bind(console,Xt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xt("ERROR"))),t<=ue.warn&&(z.warn=console.warn?console.warn.bind(console,Xt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xt("WARN"))),t<=ue.info&&(z.info=console.info?console.info.bind(console,Xt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xt("INFO"))),t<=ue.debug&&(z.debug=console.debug?console.debug.bind(console,Xt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("DEBUG"))),t<=ue.trace&&(z.trace=console.debug?console.debug.bind(console,Xt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("TRACE")))},"setLogLevel"),Xt=p(e=>`%c${xg().format("ss.SSS")} : ${e} : `,"format");const di={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:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s;switch(i){case"r":return di.hue2rgb(a,s,e+1/3)*255;case"g":return di.hue2rgb(a,s,e)*255;case"b":return di.hue2rgb(a,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),a=Math.min(e,t,r),o=(s+a)/2;if(i==="l")return o*100;if(s===a)return 0;const l=s-a,n=o>.5?l/(2-s-a):l/(s+a);if(i==="s")return n*100;switch(s){case e:return((t-r)/l+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},kg={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},nt={channel:di,lang:bg,unit:kg},xe={};for(let e=0;e<=255;e++)xe[e]=nt.unit.dec2hex(e);const Ot={ALL:0,RGB:1,HSL:2};class Sg{constructor(){this.type=Ot.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ot.ALL}is(t){return this.type===t}}class Tg{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Sg}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ot.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=nt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=nt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=nt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=nt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=nt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=nt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ot.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ot.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ot.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ot.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ot.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ot.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ui=new Tg({r:0,g:0,b:0,a:0},"transparent"),Je={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Je.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,a=s%4===0,o=s>4,l=o?1:17,n=o?8:4,c=a?0:-1,h=o?255:15;return Ui.set({r:(i>>n*(c+3)&h)*l,g:(i>>n*(c+2)&h)*l,b:(i>>n*(c+1)&h)*l,a:a?(i&h)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}${xe[Math.round(s*255)]}`:`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}`}},$e={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:e=>{const t=e.match($e.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return nt.channel.clamp.h(parseFloat(r)*.9);case"rad":return nt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return nt.channel.clamp.h(parseFloat(r)*360)}}return nt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match($e.re);if(!r)return;const[,i,s,a,o,l]=r;return Ui.set({h:$e._hue2deg(i),s:nt.channel.clamp.s(parseFloat(s)),l:nt.channel.clamp.l(parseFloat(a)),a:o?nt.channel.clamp.a(l?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%, ${s})`:`hsl(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%)`}},Ir={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:e=>{e=e.toLowerCase();const t=Ir.colors[e];if(t)return Je.parse(t)},stringify:e=>{const t=Je.stringify(e);for(const r in Ir.colors)if(Ir.colors[r]===t)return r}},Mr={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:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Mr.re);if(!r)return;const[,i,s,a,o,l,n,c,h]=r;return Ui.set({r:nt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:nt.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:nt.channel.clamp.b(n?parseFloat(l)*2.55:parseFloat(l)),a:c?nt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)}, ${nt.lang.round(s)})`:`rgb(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)})`}},oe={format:{keyword:Ir,hex:Je,rgb:Mr,rgba:Mr,hsl:$e,hsla:$e},parse:e=>{if(typeof e!="string")return e;const t=Je.parse(e)||Mr.parse(e)||$e.parse(e)||Ir.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ot.HSL)||e.data.r===void 0?$e.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Mr.stringify(e):Je.stringify(e)},ml=(e,t)=>{const r=oe.parse(e);for(const i in t)r[i]=nt.channel.clamp[i](t[i]);return oe.stringify(r)},Se=(e,t,r=0,i=1)=>{if(typeof e!="number")return ml(e,{a:t});const s=Ui.set({r:nt.channel.clamp.r(e),g:nt.channel.clamp.g(t),b:nt.channel.clamp.b(r),a:nt.channel.clamp.a(i)});return oe.stringify(s)},wg=e=>{const{r:t,g:r,b:i}=oe.parse(e),s=.2126*nt.channel.toLinear(t)+.7152*nt.channel.toLinear(r)+.0722*nt.channel.toLinear(i);return nt.lang.round(s)},Bg=e=>wg(e)>=.5,re=e=>!Bg(e),yl=(e,t,r)=>{const i=oe.parse(e),s=i[t],a=nt.channel.clamp[t](s+r);return s!==a&&(i[t]=a),oe.stringify(i)},I=(e,t)=>yl(e,"l",t),D=(e,t)=>yl(e,"l",-t),x=(e,t)=>{const r=oe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return ml(e,i)},_g=(e,t,r=50)=>{const{r:i,g:s,b:a,a:o}=oe.parse(e),{r:l,g:n,b:c,a:h}=oe.parse(t),d=r/100,g=d*2-1,u=o-h,f=((g*u===-1?g:(g+u)/(1+g*u))+1)/2,m=1-f,C=i*f+l*m,b=s*f+n*m,k=a*f+c*m,S=o*d+h*(1-d);return Se(C,b,k,S)},B=(e,t=100)=>{const r=oe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,_g(r,e,t)};var ks=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ks(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([a,o])=>{if(typeof o=="object"){if(o===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[a]===void 0&&(s[a]=Array.isArray(o)?[]:{}),typeof s[a]=="object"&&(s[a]=ks(s[a],o,{depth:r-1}))}else typeof s[a]!="object"&&(Object.hasOwn(e,a)?s[a]=o:Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ft=ks,ne="#ffffff",he="#f2f2f2",at=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),er,vg=(er=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,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft,O;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||D(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10)):(this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let lt=0;lt{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(er,"Theme"),er),Lg=p(e=>{const t=new vg;return t.calculate(e),t},"getThemeVariables"),rr,Fg=(rr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Se(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=D("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=D(this.sectionBkgColor,10),this.taskBorderColor=Se(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Se(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||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(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=I(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=I(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=B(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=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(rr,"Theme"),rr),Mg=p(e=>{const t=new Fg;return t.calculate(e),t},"getThemeVariables"),ir,Ag=(ir=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=at(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=Se(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ir,"Theme"),ir),Eg=p(e=>{const t=new Ag;return t.calculate(e),t},"getThemeVariables"),sr,$g=(sr=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=I("#cde498",10),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.actorBorder=D(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(sr,"Theme"),sr),Og=p(e=>{const t=new $g;return t.calculate(e),t},"getThemeVariables"),ar,Ig=(ar=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=I(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(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||I(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 t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.contrast,55),this.border2=this.contrast,this.actorBorder=I(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 O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ar,"Theme"),ar),Dg=p(e=>{const t=new Ig;return t.calculate(e),t},"getThemeVariables"),or,Pg=(or=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=at(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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||x(t,{h:30}),this.cScale4=this.cScale4||x(t,{h:60}),this.cScale5=this.cScale5||x(t,{h:90}),this.cScale6=this.cScale6||x(t,{h:120}),this.cScale7=this.cScale7||x(t,{h:150}),this.cScale8=this.cScale8||x(t,{h:210,l:150}),this.cScale9=this.cScale9||x(t,{h:270}),this.cScale10=this.cScale10||x(t,{h:300}),this.cScale11=this.cScale11||x(t,{h:330}),this.darkMode)for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(or,"Theme"),or),Rg=p(e=>{const t=new Pg;return t.calculate(e),t},"getThemeVariables"),lr,qg=(lr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(lr,"Theme"),lr),Wg=p(e=>{const t=new qg;return t.calculate(e),t},"getThemeVariables"),nr,zg=(nr=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=at("#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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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 m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(nr,"Theme"),nr),Ng=p(e=>{const t=new zg;return t.calculate(e),t},"getThemeVariables"),hr,Hg=(hr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(hr,"Theme"),hr),Yg=p(e=>{const t=new Hg;return t.calculate(e),t},"getThemeVariables"),cr,jg=(cr=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=at(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,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,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 m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(cr,"Theme"),cr),Ug=p(e=>{const t=new jg;return t.calculate(e),t},"getThemeVariables"),dr,Xg=(dr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(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,i,s,a,o,l,n,c,h,d,g;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(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?D(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||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(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||I(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 u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(dr,"Theme"),dr),Gg=p(e=>{const t=new Xg;return t.calculate(e),t},"getThemeVariables"),fe={base:{getThemeVariables:Lg},dark:{getThemeVariables:Mg},default:{getThemeVariables:Eg},forest:{getThemeVariables:Og},neutral:{getThemeVariables:Dg},neo:{getThemeVariables:Rg},"neo-dark":{getThemeVariables:Wg},redux:{getThemeVariables:Ng},"redux-dark":{getThemeVariables:Yg},"redux-color":{getThemeVariables:Ug},"redux-dark-color":{getThemeVariables:Gg}},At={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},Cl={...At,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:fe.default.getThemeVariables(),sequence:{...At.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...At.gantt,tickInterval:void 0,useWidth:void 0},c4:{...At.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...At.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...At.pie,useWidth:984},xyChart:{...At.xyChart,useWidth:void 0},requirement:{...At.requirement,useWidth:void 0},packet:{...At.packet},eventmodeling:{...At.eventmodeling},treeView:{...At.treeView,useWidth:void 0},radar:{...At.radar},railroad:{...At.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:{...At.ishikawa},sankey:{...At.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:{...At.venn},cynefin:{...At.cynefin}},xl=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...xl(e[i],"")]:[...r,t+i],[]),"keyify"),Vg=new Set(xl(Cl,"")),bl=Cl,Zg={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qg=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(z.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ki=p(e=>{if(z.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ki(t));return}for(const t of Object.keys(e)){if(z.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Vg.has(t)||e[t]==null){z.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=Zg[t];i?Qg(e[t],i):(z.debug("sanitizing object",t),ki(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(z.debug("sanitizing css option",t),e[t]=kl(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}z.debug("After sanitization",e)}},"sanitizeDirective"),kl=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ht=Ft({},mr),Si,Pe=[],Dr=Ft({},mr),Vr=p((e,t)=>{let r=Ft({},e),i={};for(const s of t)wl(s),i=Ft(i,s);if(r=Ft(r,i),i.theme&&i.theme in fe){const s=Ft({},Si),a=Ft(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in fe&&(r.themeVariables=fe[r.theme].getThemeVariables(a))}return Dr=r,ip(Dr),Dr},"updateCurrentConfig"),Kg=p(e=>(Ht=Ft({},mr),Ht=Ft(Ht,e),e.theme&&fe[e.theme]&&(Ht.themeVariables=fe[e.theme].getThemeVariables(e.themeVariables)),Vr(Ht,Pe),Ht),"setSiteConfig"),Jg=p(e=>{Si=Ft({},e)},"saveConfigFromInitialize"),tp=p(e=>(Ht=Ft(Ht,e),Vr(Ht,Pe),Ht),"updateSiteConfig"),Sl=p(()=>Ft({},Ht),"getSiteConfig"),Tl=p(e=>(Vr(Dr,[e]),Tt()),"setConfig"),Tt=p(()=>Ft({},Dr),"getConfig"),wl=p(e=>{e&&(["secure",...Ht.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(z.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&wl(e[t])}))},"sanitize"),ep=p(e=>{var t;ki(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Pe.push(e),Vr(Ht,Pe)},"addDirective"),Ti=p((e=Ht)=>{Pe=[],Vr(e,Pe)},"reset"),rp={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."},no={},Bl=p(e=>{no[e]||(z.warn(rp[e]),no[e]=!0)},"issueWarning"),ip=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bl("LAZY_LOAD_DEPRECATED")},"checkConfig"),$1=p(()=>{let e={};Si&&(e=Ft(e,Si));for(const t of Pe)e=Ft(e,t);return e},"getUserDefinedConfig"),zt=p(e=>{var t,r;return((t=e.flowchart)==null?void 0:t.htmlLabels)!=null&&Bl("FLOWCHART_HTML_LABELS_DEPRECATED"),ce(e.htmlLabels??((r=e.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),_l=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Pr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sp=/\s*%%.*\n/gm,ur,vl=(ur=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(ur,"UnknownDiagramError"),ur),Re={},ga=p(function(e,t){e=e.replace(_l,"").replace(Pr,"").replace(sp,` `);for(const[r,{detector:i}]of Object.entries(Re))if(i(e,t))return r;throw new vl(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ss=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Ll(t,r,i)},"registerLazyLoadedDiagrams"),Ll=p((e,t,r)=>{Re[e]&&z.warn(`Detector with key ${e} already exists. Overwriting.`),Re[e]={detector:t,loader:r},z.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),ap=p(e=>Re[e].loader,"getDiagramLoader"),Zr=//gi,op=p(e=>e?Al(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),lp=(()=>{let e=!1;return()=>{e||(Fl(),e=!0)}})();function Fl(){const e="data-temp-href-target";fr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),fr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Fl,"setupDompurifyHooks");var Ml=p(e=>(lp(),fr.sanitize(e)),"removeScript"),ho=p((e,t)=>{if(zt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Ml(e):r!=="loose"&&(e=Al(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=dp(e))}return e},"sanitizeMore"),ee=p((e,t)=>e&&(t.dompurifyConfig?e=fr.sanitize(ho(e,t),t.dompurifyConfig).toString():e=fr.sanitize(ho(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),np=p((e,t)=>typeof e=="string"?ee(e,t):e.flat().map(r=>ee(r,t)),"sanitizeTextOrArray"),hp=p(e=>Zr.test(e),"hasBreaks"),cp=p(e=>e.split(Zr),"splitBreaks"),dp=p(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),Al=p(e=>e.replace(Zr,"#br#"),"breakToPlaceholder"),up=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),gp=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),pp=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),co=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),fp=p((e,t)=>{const r=Ts(e,"~"),i=Ts(t,"~");return r===1&&i===1},"shouldCombineSets"),mp=p(e=>{const t=Ts(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),a=i.lastIndexOf("~");for(;s!==-1&&a!==-1&&s!==a;)i[s]="<",i[a]=">",s=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),uo=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ws=/\$\$(.*?)\$\$/g,zr=p(e=>{var t;return(((t=e.match(ws))==null?void 0:t.length)??0)>0},"hasKatex"),O1=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await El(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i==null||i.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),yp=p(async(e,t)=>{if(!zr(e))return e;if(!(uo()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ws,"MathML is unsupported in this environment.");{const{default:r}=await ht(async()=>{const{default:s}=await import("../../chunks/katex-C5jXJg4s.js");return{default:s}},[]),i=t.forceLegacyMathML||!uo()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Zr).map(s=>zr(s)?`
${s}
`:`
${s}
`).join("").replace(ws,(s,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),El=p(async(e,t)=>ee(await yp(e,t),t),"renderKatexSanitized"),Qr={getRows:op,sanitizeText:ee,sanitizeTextOrArray:np,hasBreaks:hp,splitBreaks:cp,lineBreakRegex:Zr,removeScript:Ml,getUrl:up,evaluate:ce,getMax:gp,getMin:pp},Cp=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),xp=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),$l=p(function(e,t,r,i){const s=xp(t,r,i);Cp(e,s)},"configureSvgSize"),bp=p(function(e,t,r,i){const s=t.node().getBBox(),a=s.width,o=s.height;z.info(`SVG bounds: ${a}x${o}`,s);let l=0,n=0;z.info(`Graph bounds: ${l}x${n}`,e),l=a+r*2,n=o+r*2,z.info(`Calculated bounds: ${l}x${n}`),$l(t,n,l,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ui={};function Bs(e){return[...e.cssRules].map(t=>t.cssText).join(` `)}p(Bs,"cssStyleSheetToString");var kp=p((e,t,r,i)=>{let s="";return e in ui&&ui[e]?s=ui[e]({...r,svgId:i}):z.warn(`No theme found for ${e}`),`& { font-family: ${r.fontFamily}; @@ -298,8 +298,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="

An error L0,20`)},"requirement_arrow"),R0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),q0=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),W0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),z0={extension:x0,composition:b0,aggregation:k0,dependency:S0,lollipop:T0,point:w0,circle:B0,cross:_0,barb:v0,barbNeo:L0,only_one:F0,zero_or_one:M0,one_or_more:A0,zero_or_more:E0,only_one_neo:$0,zero_or_one_neo:O0,one_or_more_neo:I0,zero_or_more_neo:D0,requirement_arrow:P0,requirement_contains:q0,requirement_arrow_neo:R0,requirement_contains_neo:W0},N0=C0,H0={common:Qr,getConfig:Tt,insertCluster:RC,insertEdge:y0,insertEdgeLabel:c0,insertMarkers:N0,insertNode:su,interpolateToCurve:Da,labelHelper:it,log:z,positionEdgeLabel:d0},Xr={},nu=p(e=>{for(const t of e)Xr[t.name]=t},"registerLayoutLoaders"),Y0=p(()=>{nu([{name:"dagre",loader:p(async()=>await ht(()=>import("./dagre-VZM6K2ZE-CoK1hzcv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-D1dh_Nns.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-GA0ao5B_.js"),__vite__mapDeps([9,10,5,6,7])),"loader")}])},"registerDefaultLayoutLoaders");Y0();var s2=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Xr))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const g=d.domId||d.id;d.domId=`${e.diagramId}-${g}`}const i=Xr[e.layoutAlgorithm],s=await i.loader(),{theme:a,themeVariables:o}=e.config,{useGradient:l,gradientStart:n,gradientStop:c}=o,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),l){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,H0,{algorithm:i.algorithm},r)},"render"),a2=p((e="",{fallback:t="dagre"}={})=>{if(e in Xr)return e;if(t in Xr)return z.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),io="comm",hu="rule",cu="decl",j0="@media",U0="@import",X0="@supports",G0="@namespace",oa="@keyframes",du="@layer",V0="@scope",Z0=Math.abs,Wr=String.fromCharCode;function uu(e){return e.trim()}function la(e,t,r){return e.replace(t,r)}function tr(e,t){return e.charCodeAt(t)|0}function xr(e,t,r){return e.slice(t,r)}function ae(e){return e.length}function gu(e){return e.length}function hi(e,t){return t.push(e),e}var ss=1,br=1,pu=0,Gt=0,_t=0,Tr="";function so(e,t,r,i,s,a,o,l){return{value:e,root:t,parent:r,type:i,props:s,children:a,line:ss,column:br,length:o,return:"",siblings:l}}function Q0(){return _t}function K0(){return _t=Gt>0?tr(Tr,--Gt):0,br--,_t===10&&(br=1,ss--),_t}function te(){return _t=Gt2||Gr(_t)>3?"":" "}function rx(e,t){for(;--t&&te()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return as(e,xi()+(t<6&&ke()==32&&te()==32))}function na(e){for(;te();)switch(_t){case e:return Gt;case 34:case 39:e!==34&&e!==39&&na(_t);break;case 40:e===41&&na(e);break;case 92:te();break}return Gt}function ix(e,t){for(;te()&&e+_t!==57;)if(e+_t===84&&ke()===47)break;return"/*"+as(t,Gt-1)+"*"+Wr(e===47?e:te())}function sx(e){for(;!Gr(ke());)te();return as(e,Gt)}function ax(e){return tx(bi("",null,null,null,[""],e=J0(e),0,[0],e))}function bi(e,t,r,i,s,a,o,l,n){for(var c=0,h=0,d=o,g=0,u=0,y=0,f=1,m=1,C=1,b=0,k=0,S="",T=s,w=a,L=i,v=S;m;)switch(y=k,k=te()){case 40:y!=108&&tr(v,d-1)==58?(b++,v+="("):v+=xs(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=xs(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Wr(k);break}v+=ex(y);break;case 92:v+=rx(xi()-1,7);continue;case 47:switch(ke()){case 42:case 47:hi(ox(ix(te(),xi()),t,r,n),n),(Gr(y||1)==5||Gr(ke()||1)==5)&&ae(v)&&xr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*f:l[c++]=ae(v)*C;case 125*f:case 59:case 0:if(b>0&&k){v+=Wr(k);break}switch(k){case 0:case 125:m=0;case 59+h:C==-1&&(v=la(v,/\f/g,"")),u>0&&(ae(v)-d||f===0)&&hi(u>32?hl(v+";",i,r,d-1,n):hl(la(v," ","")+";",i,r,d-2,n),n);break;case 59:v+=";";default:if(hi(L=nl(v,t,r,c,h,s,l,S,T=[],w=[],d,a),a),k===123)if(h===0)bi(v,t,L,L,T,a,d,l,w);else{switch(g){case 99:if(tr(v,3)===110)break;case 108:if(tr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?bi(e,L,L,i&&hi(nl(e,L,L,0,0,s,l,S,s,T=[],d,w),w),s,w,d,l,i?T:w):bi(v,L,L,L,[""],w,0,l,w)}}c=h=u=0,f=C=1,S=v="",d=o;break;case 58:d=1+ae(v),u=y;default:if(f<1){if(k==123)--f;else if(k==125&&f++==0&&K0()==125)continue}switch(v+=Wr(k),k*f){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;l[c++]=(ae(v)-1)*C,C=1;break;case 64:ke()===45&&(v+=xs(te())),g=ke(),h=d=ae(S=v+=sx(xi())),k++;break;case 45:y===45&&ae(v)==2&&(f=0)}}return a}function nl(e,t,r,i,s,a,o,l,n,c,h,d){for(var g=s-1,u=s===0?a:[""],y=gu(u),f=0,m=0,C=0;f0?u[b]+" "+k:la(k,/&\f/g,u[b])))&&(n[C++]=S);return so(e,t,r,s===0?hu:l,n,c,h,d)}function ox(e,t,r,i){return so(e,t,r,io,Wr(Q0()),xr(e,2,-2),0,i)}function hl(e,t,r,i,s){return so(e,t,r,cu,xr(e,0,i),xr(e,i+1,-1),i,s)}function ha(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./c4Diagram-5PPSVZJV-Bra67sdL.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:fu,diagram:e}},"loader"),dx={id:fu,detector:hx,loader:cx},ux=dx,mu="flowchart",gx=p((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),px=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-CvT_V9C-.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:mu,diagram:e}},"loader"),fx={id:mu,detector:gx,loader:px},mx=fx,yu="flowchart-v2",yx=p((e,t)=>{var r,i,s;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((s=t==null?void 0:t.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-CvT_V9C-.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:yu,diagram:e}},"loader"),xx={id:yu,detector:yx,loader:Cx},bx=xx,Cu="swimlane",kx=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Sx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./swimlanesDiagram-ULZ7WXOC-D8bBal3H.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,5,6,16,12,7,17]));return{id:Cu,diagram:e}},"loader"),Tx={id:Cu,detector:kx,loader:Sx},wx=Tx,xu="er",Bx=p(e=>/^\s*erDiagram/.test(e),"detector"),_x=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./erDiagram-JOGREHBK-llttpfV5.js");return{diagram:t}},__vite__mapDeps([19,15,5,6,16,17,7]));return{id:xu,diagram:e}},"loader"),vx={id:xu,detector:Bx,loader:_x},Lx=vx,bu="gitGraph",Fx=p(e=>/^\s*gitGraph/.test(e),"detector"),Mx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./gitGraphDiagram-DS77QQ5N-D9mrrxwi.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:bu,diagram:e}},"loader"),Ax={id:bu,detector:Fx,loader:Mx},Ex=Ax,ku="gantt",$x=p(e=>/^\s*gantt/.test(e),"detector"),Ox=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ganttDiagram-PKOTCBZU-CuYQpRVn.js");return{diagram:t}},__vite__mapDeps([24,5,6,25,26,27,7]));return{id:ku,diagram:e}},"loader"),Ix={id:ku,detector:$x,loader:Ox},Dx=Ix,Su="info",Px=p(e=>/^\s*info/.test(e),"detector"),Rx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./infoDiagram-6WML65LV-BdqavOdZ.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:Su,diagram:e}},"loader"),qx={id:Su,detector:Px,loader:Rx},Tu="pie",Wx=p(e=>/^\s*pie/.test(e),"detector"),zx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pieDiagram-7S7Q4E2Y-DnQbiAd6.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:Tu,diagram:e}},"loader"),Nx={id:Tu,detector:Wx,loader:zx},wu="quadrantChart",Hx=p(e=>/^\s*quadrantChart/.test(e),"detector"),Yx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./quadrantDiagram-CIZ2JOQS-BHagSQYD.js");return{diagram:t}},__vite__mapDeps([32,5,6,25,26,27,7]));return{id:wu,diagram:e}},"loader"),jx={id:wu,detector:Hx,loader:Yx},Ux=jx,Bu="xychart",Xx=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Gx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./xychartDiagram-ELKLHX3M-DfWAA2AU.js");return{diagram:t}},__vite__mapDeps([33,5,6,26,31,25,27,7]));return{id:Bu,diagram:e}},"loader"),Vx={id:Bu,detector:Xx,loader:Gx},Zx=Vx,_u="requirement",Qx=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Kx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./requirementDiagram-LRYGKXZP-JYMpFkh0.js");return{diagram:t}},__vite__mapDeps([34,15,5,6,16,7]));return{id:_u,diagram:e}},"loader"),Jx={id:_u,detector:Qx,loader:Kx},tb=Jx,vu="sequence",eb=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sequenceDiagram-SI44F4Z6-Bqv2AfOc.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:vu,diagram:e}},"loader"),ib={id:vu,detector:eb,loader:rb},sb=ib,Lu="class",ab=p((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-JCYQIIEL-B8-0NVyL.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,5,6,16,12,7]));return{id:Lu,diagram:e}},"loader"),lb={id:Lu,detector:ab,loader:ob},nb=lb,Fu="classDiagram",hb=p((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-v2-OCEON4UE-B8-0NVyL.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,5,6,16,12,7]));return{id:Fu,diagram:e}},"loader"),db={id:Fu,detector:hb,loader:cb},ub=db,Mu="state",gb=p((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),pb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-OKZ733FA-7KBZw4rp.js");return{diagram:t}},__vite__mapDeps([39,40,15,5,6,16,12,7,2,4,3]));return{id:Mu,diagram:e}},"loader"),fb={id:Mu,detector:gb,loader:pb},mb=fb,Au="stateDiagram",yb=p((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-v2-UEYNNEHI-DY-saesF.js");return{diagram:t}},__vite__mapDeps([41,40,15,5,6,16,12,7]));return{id:Au,diagram:e}},"loader"),xb={id:Au,detector:yb,loader:Cb},bb=xb,Eu="journey",kb=p(e=>/^\s*journey/.test(e),"detector"),Sb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./journeyDiagram-NVQOT4AX-DItBOT4l.js");return{diagram:t}},__vite__mapDeps([42,14,12,5,6,30,7]));return{id:Eu,diagram:e}},"loader"),Tb={id:Eu,detector:kb,loader:Sb},wb=Tb,Bb=p((e,t,r)=>{z.debug(`rendering svg for syntax error -`);const i=Qp(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),$l(i,100,512,!0),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),$u={draw:Bb},_b=$u,vb={db:{},renderer:$u,parser:{parse:p(()=>{},"parse")}},Lb=vb,Ou="flowchart-elk",Fb=p((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Mb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-CvT_V9C-.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:Ou,diagram:e}},"loader"),Ab={id:Ou,detector:Fb,loader:Mb},Eb=Ab,Iu="timeline",$b=p(e=>/^\s*timeline/.test(e),"detector"),Ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./timeline-definition-Z64GVDOM-Dz8AxK7r.js");return{diagram:t}},__vite__mapDeps([43,5,6,30,7]));return{id:Iu,diagram:e}},"loader"),Ib={id:Iu,detector:$b,loader:Ob},Db=Ib,Du="mindmap",Pb=p(e=>/^\s*mindmap/.test(e),"detector"),Rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./mindmap-definition-FAOFIHXS-CgfY0Ls2.js");return{diagram:t}},__vite__mapDeps([44,15,5,6,16,7]));return{id:Du,diagram:e}},"loader"),qb={id:Du,detector:Pb,loader:Rb},Wb=qb,Pu="kanban",zb=p(e=>/^\s*kanban/.test(e),"detector"),Nb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./kanban-definition-27J2QSJJ-DwDU3r_E.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:Pu,diagram:e}},"loader"),Hb={id:Pu,detector:zb,loader:Nb},Yb=Hb,Ru="sankey",jb=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Ub=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sankeyDiagram-W5VNT64P-BF_iEz9u.js");return{diagram:t}},__vite__mapDeps([46,5,6,31,26,7]));return{id:Ru,diagram:e}},"loader"),Xb={id:Ru,detector:jb,loader:Ub},Gb=Xb,qu="packet",Vb=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),Zb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-LBJQPF4R-Du7527yu.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:qu,diagram:e}},"loader"),Qb={id:qu,detector:Vb,loader:Zb},Wu="radar",Kb=p(e=>/^\s*radar-beta/.test(e),"detector"),Jb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-UB23O5K3-BSO8qbf3.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:Wu,diagram:e}},"loader"),tk={id:Wu,detector:Kb,loader:Jb},zu="block",ek=p(e=>/^\s*block(-beta)?/.test(e),"detector"),rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./blockDiagram-VBNYF7ZC-DdQPoes9.js");return{diagram:t}},__vite__mapDeps([49,14,5,6,2,17,7]));return{id:zu,diagram:e}},"loader"),ik={id:zu,detector:ek,loader:rk},sk=ik,Nu="treeView",ak=p(e=>/^\s*treeView-beta/.test(e),"detector"),ok=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-7IWD3JNH-SC1XlXnp.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:Nu,diagram:e}},"loader"),lk={id:Nu,detector:ak,loader:ok},nk=lk,Hu="architecture",hk=p(e=>/^\s*architecture/.test(e),"detector"),ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./architectureDiagram-T3A2C74G-Bqx-XTbw.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Hu,diagram:e}},"loader"),dk={id:Hu,detector:hk,loader:ck},uk=dk,Yu="eventmodeling",gk=p(e=>/^\s*eventmodeling/.test(e),"detector"),pk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-B4RE2ZJO-60-I7wkZ.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Yu,diagram:e}},"loader"),fk={id:Yu,detector:gk,loader:pk},mk=fk,ju="ishikawa",yk=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ishikawaDiagram-WSZJBQD7-C-ri3OTd.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:ju,diagram:e}},"loader"),xk={id:ju,detector:yk,loader:Ck},Uu="venn",bk=p(e=>/^\s*venn-beta/.test(e),"detector"),kk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./vennDiagram-T6HMQDX7-qZKAtDe0.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Uu,diagram:e}},"loader"),Sk={id:Uu,detector:bk,loader:kk},Tk=Sk,Xu="treemap",wk=p(e=>/^\s*treemap/.test(e),"detector"),Bk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-Q27KOJAE-s-EXVUXN.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Xu,diagram:e}},"loader"),_k={id:Xu,detector:wk,loader:Bk},Gu="wardley",vk=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Lk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./wardleyDiagram-T6FBY63Y-DvjwaJgh.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:Gu,diagram:e}},"loader"),Fk={id:Gu,detector:vk,loader:Lk},Mk=Fk,Vu="cynefin",Ak=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Ek=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./cynefinDiagram-MW4NZA55-B1L5kWTo.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Vu,diagram:e}},"loader"),$k={id:Vu,detector:Ak,loader:Ek},Zu="railroad",Ok=p(e=>/^\s*railroad-beta/i.test(e),"detector"),Ik=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./railroadDiagram-AXF67PYL-Biow3FMP.js");return{diagram:t}},__vite__mapDeps([58,59,22,5,6,23,7]));return{id:Zu,diagram:e}},"loader"),Dk={id:Zu,detector:Ok,loader:Ik},Qu="railroadEbnf",Pk=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ebnfDiagram-BXEA7PRR-D1IH6bGb.js");return{diagram:t}},__vite__mapDeps([60,59,22,5,6,23,7]));return{id:Qu,diagram:e}},"loader"),qk={id:Qu,detector:Pk,loader:Rk},Ku="railroadAbnf",Wk=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),zk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./abnfDiagram-N423BO3Z-BCBAEFx3.js");return{diagram:t}},__vite__mapDeps([61,59,22,5,6,23,7]));return{id:Ku,diagram:e}},"loader"),Nk={id:Ku,detector:Wk,loader:zk},Ju="railroadPeg",Hk=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Yk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pegDiagram-VL7TDLO6-Reiw3hvB.js");return{diagram:t}},__vite__mapDeps([62,59,22,5,6,23,7]));return{id:Ju,diagram:e}},"loader"),jk={id:Ju,detector:Hk,loader:Yk},cl=!1,os=p(()=>{cl||(cl=!0,Bi("error",Lb,e=>e.toLowerCase().trim()==="error"),Bi("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ss(Eb,Wb,uk),Ss(ux,Yb,ub,nb,Lx,Dx,qx,Nx,tb,sb,wx,bx,mx,Db,Ex,bb,mb,wb,Ux,Gb,Qb,Zx,sk,mk,nk,tk,xk,_k,Dk,qk,Nk,jk,Tk,Mk,$k))},"addDiagrams"),Uk=p(async()=>{z.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Re).map(async([r,{detector:i,loader:s}])=>{if(s)try{_s(r)}catch{try{const{diagram:a,id:o}=await s();Bi(o,a,i)}catch(a){throw z.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Re[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){z.error(`Failed to load ${t.length} external diagrams`);for(const r of t)z.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Xk="graphics-document document";function tg(e,t){e.attr("role",Xk),t!==""&&e.attr("aria-roledescription",t)}p(tg,"setA11yDiagramInfo");function eg(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}p(eg,"addSVGa11yTitleDescription");var De,ca=(De=class{constructor(t,r,i,s,a){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=a}static async fromText(t,r={}){var c,h;const i=Tt(),s=ga(t,i);t=oy(t)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),q0=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),W0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),z0={extension:x0,composition:b0,aggregation:k0,dependency:S0,lollipop:T0,point:w0,circle:B0,cross:_0,barb:v0,barbNeo:L0,only_one:F0,zero_or_one:M0,one_or_more:A0,zero_or_more:E0,only_one_neo:$0,zero_or_one_neo:O0,one_or_more_neo:I0,zero_or_more_neo:D0,requirement_arrow:P0,requirement_contains:q0,requirement_arrow_neo:R0,requirement_contains_neo:W0},N0=C0,H0={common:Qr,getConfig:Tt,insertCluster:RC,insertEdge:y0,insertEdgeLabel:c0,insertMarkers:N0,insertNode:su,interpolateToCurve:Da,labelHelper:it,log:z,positionEdgeLabel:d0},Xr={},nu=p(e=>{for(const t of e)Xr[t.name]=t},"registerLayoutLoaders"),Y0=p(()=>{nu([{name:"dagre",loader:p(async()=>await ht(()=>import("./dagre-VZM6K2ZE-Bh80CoKM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-CR3Yx4nf.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-BwttPwJa.js"),__vite__mapDeps([9,10,5,6,7])),"loader")}])},"registerDefaultLayoutLoaders");Y0();var s2=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Xr))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const g=d.domId||d.id;d.domId=`${e.diagramId}-${g}`}const i=Xr[e.layoutAlgorithm],s=await i.loader(),{theme:a,themeVariables:o}=e.config,{useGradient:l,gradientStart:n,gradientStop:c}=o,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),l){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,H0,{algorithm:i.algorithm},r)},"render"),a2=p((e="",{fallback:t="dagre"}={})=>{if(e in Xr)return e;if(t in Xr)return z.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),io="comm",hu="rule",cu="decl",j0="@media",U0="@import",X0="@supports",G0="@namespace",oa="@keyframes",du="@layer",V0="@scope",Z0=Math.abs,Wr=String.fromCharCode;function uu(e){return e.trim()}function la(e,t,r){return e.replace(t,r)}function tr(e,t){return e.charCodeAt(t)|0}function xr(e,t,r){return e.slice(t,r)}function ae(e){return e.length}function gu(e){return e.length}function hi(e,t){return t.push(e),e}var ss=1,br=1,pu=0,Gt=0,_t=0,Tr="";function so(e,t,r,i,s,a,o,l){return{value:e,root:t,parent:r,type:i,props:s,children:a,line:ss,column:br,length:o,return:"",siblings:l}}function Q0(){return _t}function K0(){return _t=Gt>0?tr(Tr,--Gt):0,br--,_t===10&&(br=1,ss--),_t}function te(){return _t=Gt2||Gr(_t)>3?"":" "}function rx(e,t){for(;--t&&te()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return as(e,xi()+(t<6&&ke()==32&&te()==32))}function na(e){for(;te();)switch(_t){case e:return Gt;case 34:case 39:e!==34&&e!==39&&na(_t);break;case 40:e===41&&na(e);break;case 92:te();break}return Gt}function ix(e,t){for(;te()&&e+_t!==57;)if(e+_t===84&&ke()===47)break;return"/*"+as(t,Gt-1)+"*"+Wr(e===47?e:te())}function sx(e){for(;!Gr(ke());)te();return as(e,Gt)}function ax(e){return tx(bi("",null,null,null,[""],e=J0(e),0,[0],e))}function bi(e,t,r,i,s,a,o,l,n){for(var c=0,h=0,d=o,g=0,u=0,y=0,f=1,m=1,C=1,b=0,k=0,S="",T=s,w=a,L=i,v=S;m;)switch(y=k,k=te()){case 40:y!=108&&tr(v,d-1)==58?(b++,v+="("):v+=xs(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=xs(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Wr(k);break}v+=ex(y);break;case 92:v+=rx(xi()-1,7);continue;case 47:switch(ke()){case 42:case 47:hi(ox(ix(te(),xi()),t,r,n),n),(Gr(y||1)==5||Gr(ke()||1)==5)&&ae(v)&&xr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*f:l[c++]=ae(v)*C;case 125*f:case 59:case 0:if(b>0&&k){v+=Wr(k);break}switch(k){case 0:case 125:m=0;case 59+h:C==-1&&(v=la(v,/\f/g,"")),u>0&&(ae(v)-d||f===0)&&hi(u>32?hl(v+";",i,r,d-1,n):hl(la(v," ","")+";",i,r,d-2,n),n);break;case 59:v+=";";default:if(hi(L=nl(v,t,r,c,h,s,l,S,T=[],w=[],d,a),a),k===123)if(h===0)bi(v,t,L,L,T,a,d,l,w);else{switch(g){case 99:if(tr(v,3)===110)break;case 108:if(tr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?bi(e,L,L,i&&hi(nl(e,L,L,0,0,s,l,S,s,T=[],d,w),w),s,w,d,l,i?T:w):bi(v,L,L,L,[""],w,0,l,w)}}c=h=u=0,f=C=1,S=v="",d=o;break;case 58:d=1+ae(v),u=y;default:if(f<1){if(k==123)--f;else if(k==125&&f++==0&&K0()==125)continue}switch(v+=Wr(k),k*f){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;l[c++]=(ae(v)-1)*C,C=1;break;case 64:ke()===45&&(v+=xs(te())),g=ke(),h=d=ae(S=v+=sx(xi())),k++;break;case 45:y===45&&ae(v)==2&&(f=0)}}return a}function nl(e,t,r,i,s,a,o,l,n,c,h,d){for(var g=s-1,u=s===0?a:[""],y=gu(u),f=0,m=0,C=0;f0?u[b]+" "+k:la(k,/&\f/g,u[b])))&&(n[C++]=S);return so(e,t,r,s===0?hu:l,n,c,h,d)}function ox(e,t,r,i){return so(e,t,r,io,Wr(Q0()),xr(e,2,-2),0,i)}function hl(e,t,r,i,s){return so(e,t,r,cu,xr(e,0,i),xr(e,i+1,-1),i,s)}function ha(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./c4Diagram-5PPSVZJV-B9klRQ1P.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:fu,diagram:e}},"loader"),dx={id:fu,detector:hx,loader:cx},ux=dx,mu="flowchart",gx=p((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),px=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DmwC0ruo.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:mu,diagram:e}},"loader"),fx={id:mu,detector:gx,loader:px},mx=fx,yu="flowchart-v2",yx=p((e,t)=>{var r,i,s;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((s=t==null?void 0:t.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DmwC0ruo.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:yu,diagram:e}},"loader"),xx={id:yu,detector:yx,loader:Cx},bx=xx,Cu="swimlane",kx=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Sx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./swimlanesDiagram-ULZ7WXOC-DpcZasdm.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,5,6,16,12,7,17]));return{id:Cu,diagram:e}},"loader"),Tx={id:Cu,detector:kx,loader:Sx},wx=Tx,xu="er",Bx=p(e=>/^\s*erDiagram/.test(e),"detector"),_x=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./erDiagram-JOGREHBK-Ccaixrdp.js");return{diagram:t}},__vite__mapDeps([19,15,5,6,16,17,7]));return{id:xu,diagram:e}},"loader"),vx={id:xu,detector:Bx,loader:_x},Lx=vx,bu="gitGraph",Fx=p(e=>/^\s*gitGraph/.test(e),"detector"),Mx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./gitGraphDiagram-DS77QQ5N-B7nKkelP.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:bu,diagram:e}},"loader"),Ax={id:bu,detector:Fx,loader:Mx},Ex=Ax,ku="gantt",$x=p(e=>/^\s*gantt/.test(e),"detector"),Ox=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ganttDiagram-PKOTCBZU-CDLstIj6.js");return{diagram:t}},__vite__mapDeps([24,5,6,25,26,27,7]));return{id:ku,diagram:e}},"loader"),Ix={id:ku,detector:$x,loader:Ox},Dx=Ix,Su="info",Px=p(e=>/^\s*info/.test(e),"detector"),Rx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./infoDiagram-6WML65LV-B7-q34pi.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:Su,diagram:e}},"loader"),qx={id:Su,detector:Px,loader:Rx},Tu="pie",Wx=p(e=>/^\s*pie/.test(e),"detector"),zx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pieDiagram-7S7Q4E2Y-9it0uedZ.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:Tu,diagram:e}},"loader"),Nx={id:Tu,detector:Wx,loader:zx},wu="quadrantChart",Hx=p(e=>/^\s*quadrantChart/.test(e),"detector"),Yx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./quadrantDiagram-CIZ2JOQS-CTiy7YiT.js");return{diagram:t}},__vite__mapDeps([32,5,6,25,26,27,7]));return{id:wu,diagram:e}},"loader"),jx={id:wu,detector:Hx,loader:Yx},Ux=jx,Bu="xychart",Xx=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Gx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./xychartDiagram-ELKLHX3M-CSukDV3q.js");return{diagram:t}},__vite__mapDeps([33,5,6,26,31,25,27,7]));return{id:Bu,diagram:e}},"loader"),Vx={id:Bu,detector:Xx,loader:Gx},Zx=Vx,_u="requirement",Qx=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Kx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./requirementDiagram-LRYGKXZP-BEni_WUb.js");return{diagram:t}},__vite__mapDeps([34,15,5,6,16,7]));return{id:_u,diagram:e}},"loader"),Jx={id:_u,detector:Qx,loader:Kx},tb=Jx,vu="sequence",eb=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sequenceDiagram-SI44F4Z6-ClGkLfJ7.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:vu,diagram:e}},"loader"),ib={id:vu,detector:eb,loader:rb},sb=ib,Lu="class",ab=p((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-JCYQIIEL-B86LdNwl.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,5,6,16,12,7]));return{id:Lu,diagram:e}},"loader"),lb={id:Lu,detector:ab,loader:ob},nb=lb,Fu="classDiagram",hb=p((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-v2-OCEON4UE-B86LdNwl.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,5,6,16,12,7]));return{id:Fu,diagram:e}},"loader"),db={id:Fu,detector:hb,loader:cb},ub=db,Mu="state",gb=p((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),pb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-OKZ733FA-BrlX_tes.js");return{diagram:t}},__vite__mapDeps([39,40,15,5,6,16,12,7,2,4,3]));return{id:Mu,diagram:e}},"loader"),fb={id:Mu,detector:gb,loader:pb},mb=fb,Au="stateDiagram",yb=p((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-v2-UEYNNEHI-BUH5KdnU.js");return{diagram:t}},__vite__mapDeps([41,40,15,5,6,16,12,7]));return{id:Au,diagram:e}},"loader"),xb={id:Au,detector:yb,loader:Cb},bb=xb,Eu="journey",kb=p(e=>/^\s*journey/.test(e),"detector"),Sb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./journeyDiagram-NVQOT4AX-CEEbz2Rm.js");return{diagram:t}},__vite__mapDeps([42,14,12,5,6,30,7]));return{id:Eu,diagram:e}},"loader"),Tb={id:Eu,detector:kb,loader:Sb},wb=Tb,Bb=p((e,t,r)=>{z.debug(`rendering svg for syntax error +`);const i=Qp(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),$l(i,100,512,!0),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),$u={draw:Bb},_b=$u,vb={db:{},renderer:$u,parser:{parse:p(()=>{},"parse")}},Lb=vb,Ou="flowchart-elk",Fb=p((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Mb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DmwC0ruo.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:Ou,diagram:e}},"loader"),Ab={id:Ou,detector:Fb,loader:Mb},Eb=Ab,Iu="timeline",$b=p(e=>/^\s*timeline/.test(e),"detector"),Ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./timeline-definition-Z64GVDOM-Dq9PHz3C.js");return{diagram:t}},__vite__mapDeps([43,5,6,30,7]));return{id:Iu,diagram:e}},"loader"),Ib={id:Iu,detector:$b,loader:Ob},Db=Ib,Du="mindmap",Pb=p(e=>/^\s*mindmap/.test(e),"detector"),Rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./mindmap-definition-FAOFIHXS-N5zHU5MK.js");return{diagram:t}},__vite__mapDeps([44,15,5,6,16,7]));return{id:Du,diagram:e}},"loader"),qb={id:Du,detector:Pb,loader:Rb},Wb=qb,Pu="kanban",zb=p(e=>/^\s*kanban/.test(e),"detector"),Nb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./kanban-definition-27J2QSJJ-4S3DxCBE.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:Pu,diagram:e}},"loader"),Hb={id:Pu,detector:zb,loader:Nb},Yb=Hb,Ru="sankey",jb=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Ub=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sankeyDiagram-W5VNT64P-CmNhKWbi.js");return{diagram:t}},__vite__mapDeps([46,5,6,31,26,7]));return{id:Ru,diagram:e}},"loader"),Xb={id:Ru,detector:jb,loader:Ub},Gb=Xb,qu="packet",Vb=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),Zb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-LBJQPF4R-B24oG5BD.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:qu,diagram:e}},"loader"),Qb={id:qu,detector:Vb,loader:Zb},Wu="radar",Kb=p(e=>/^\s*radar-beta/.test(e),"detector"),Jb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-UB23O5K3-C0u56O7S.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:Wu,diagram:e}},"loader"),tk={id:Wu,detector:Kb,loader:Jb},zu="block",ek=p(e=>/^\s*block(-beta)?/.test(e),"detector"),rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./blockDiagram-VBNYF7ZC-wh52Ecel.js");return{diagram:t}},__vite__mapDeps([49,14,5,6,2,17,7]));return{id:zu,diagram:e}},"loader"),ik={id:zu,detector:ek,loader:rk},sk=ik,Nu="treeView",ak=p(e=>/^\s*treeView-beta/.test(e),"detector"),ok=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-7IWD3JNH-CHjc3YK7.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:Nu,diagram:e}},"loader"),lk={id:Nu,detector:ak,loader:ok},nk=lk,Hu="architecture",hk=p(e=>/^\s*architecture/.test(e),"detector"),ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./architectureDiagram-T3A2C74G-BC0iLzBL.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Hu,diagram:e}},"loader"),dk={id:Hu,detector:hk,loader:ck},uk=dk,Yu="eventmodeling",gk=p(e=>/^\s*eventmodeling/.test(e),"detector"),pk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-B4RE2ZJO-Crk5VMXY.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Yu,diagram:e}},"loader"),fk={id:Yu,detector:gk,loader:pk},mk=fk,ju="ishikawa",yk=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ishikawaDiagram-WSZJBQD7-DWxeOhyJ.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:ju,diagram:e}},"loader"),xk={id:ju,detector:yk,loader:Ck},Uu="venn",bk=p(e=>/^\s*venn-beta/.test(e),"detector"),kk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./vennDiagram-T6HMQDX7-CYHQcSxC.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Uu,diagram:e}},"loader"),Sk={id:Uu,detector:bk,loader:kk},Tk=Sk,Xu="treemap",wk=p(e=>/^\s*treemap/.test(e),"detector"),Bk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-Q27KOJAE-CHt3iGyV.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Xu,diagram:e}},"loader"),_k={id:Xu,detector:wk,loader:Bk},Gu="wardley",vk=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Lk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./wardleyDiagram-T6FBY63Y-Dkoo2yzf.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:Gu,diagram:e}},"loader"),Fk={id:Gu,detector:vk,loader:Lk},Mk=Fk,Vu="cynefin",Ak=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Ek=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./cynefinDiagram-MW4NZA55-h-hlAvXc.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Vu,diagram:e}},"loader"),$k={id:Vu,detector:Ak,loader:Ek},Zu="railroad",Ok=p(e=>/^\s*railroad-beta/i.test(e),"detector"),Ik=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./railroadDiagram-AXF67PYL-PGVg3Gs4.js");return{diagram:t}},__vite__mapDeps([58,59,22,5,6,23,7]));return{id:Zu,diagram:e}},"loader"),Dk={id:Zu,detector:Ok,loader:Ik},Qu="railroadEbnf",Pk=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ebnfDiagram-BXEA7PRR-288CQcDu.js");return{diagram:t}},__vite__mapDeps([60,59,22,5,6,23,7]));return{id:Qu,diagram:e}},"loader"),qk={id:Qu,detector:Pk,loader:Rk},Ku="railroadAbnf",Wk=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),zk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./abnfDiagram-N423BO3Z-DmJtql8p.js");return{diagram:t}},__vite__mapDeps([61,59,22,5,6,23,7]));return{id:Ku,diagram:e}},"loader"),Nk={id:Ku,detector:Wk,loader:zk},Ju="railroadPeg",Hk=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Yk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pegDiagram-VL7TDLO6-BOK0qG_k.js");return{diagram:t}},__vite__mapDeps([62,59,22,5,6,23,7]));return{id:Ju,diagram:e}},"loader"),jk={id:Ju,detector:Hk,loader:Yk},cl=!1,os=p(()=>{cl||(cl=!0,Bi("error",Lb,e=>e.toLowerCase().trim()==="error"),Bi("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ss(Eb,Wb,uk),Ss(ux,Yb,ub,nb,Lx,Dx,qx,Nx,tb,sb,wx,bx,mx,Db,Ex,bb,mb,wb,Ux,Gb,Qb,Zx,sk,mk,nk,tk,xk,_k,Dk,qk,Nk,jk,Tk,Mk,$k))},"addDiagrams"),Uk=p(async()=>{z.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Re).map(async([r,{detector:i,loader:s}])=>{if(s)try{_s(r)}catch{try{const{diagram:a,id:o}=await s();Bi(o,a,i)}catch(a){throw z.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Re[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){z.error(`Failed to load ${t.length} external diagrams`);for(const r of t)z.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Xk="graphics-document document";function tg(e,t){e.attr("role",Xk),t!==""&&e.attr("aria-roledescription",t)}p(tg,"setA11yDiagramInfo");function eg(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}p(eg,"addSVGa11yTitleDescription");var De,ca=(De=class{constructor(t,r,i,s,a){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=a}static async fromText(t,r={}){var c,h;const i=Tt(),s=ga(t,i);t=oy(t)+` `;try{_s(s)}catch{const d=ap(s);if(!d)throw new vl(`Diagram ${s} not found.`);const{id:g,diagram:u}=await d();Bi(g,u)}const{db:a,parser:o,renderer:l,init:n}=_s(s);return o.parser&&(o.parser.yy=a),(c=a.clear)==null||c.call(a),n==null||n(i),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await o.parse(t),new De(s,t,a,o,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(De,"Diagram"),De),dl=[],Gk=p(()=>{dl.forEach(e=>{e()}),dl=[]},"attachFunctions"),Vk=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function rg(e){const t=e.match(_l);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` `).map(o=>o.startsWith(r)?o.slice(r.length):o).join(` `):t[2];let s=am(i,{schema:sm})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const a={};return s.displayMode&&(a.displayMode=s.displayMode.toString()),s.title&&(a.title=s.title.toString()),s.config&&(a.config=s.config),{text:e.slice(t[0].length),metadata:a}}p(rg,"extractFrontMatter");var Zk=p(e=>e.replace(/\r\n?/g,` diff --git a/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CgfY0Ls2.js b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-N5zHU5MK.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CgfY0Ls2.js rename to veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-N5zHU5MK.js index 15255db76..78b0a893d 100644 --- a/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CgfY0Ls2.js +++ b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-N5zHU5MK.js @@ -1,4 +1,4 @@ -import{g as oe}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as ce}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as h,at as R,a4 as le,aK as he,X as de,O as W,Y as U,aN as H,aa as ge,ak as ue,ap as pe,H as fe}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,o){return crypto.randomUUID?crypto.randomUUID():ke(t)}function ke(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var J=function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],b=[1,26],L=[1,24],D=[1,25],k=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};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:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:b,7:L,10:23,11:D},t(k,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(k,[2,18]),t(k,[2,19]),t(k,[2,20]),t(k,[2,21]),t(k,[2,23]),t(k,[2,24]),t(k,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(k,[2,15]),t(k,[2,16]),t(k,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(k,[2,25]),t(k,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,K,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var q="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?q="Parse error on line "+(F+1)+`: +import{g as oe}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as ce}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as h,at as R,a4 as le,aK as he,X as de,O as W,Y as U,aN as H,aa as ge,ak as ue,ap as pe,H as fe}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,o){return crypto.randomUUID?crypto.randomUUID():ke(t)}function ke(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var J=function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],b=[1,26],L=[1,24],D=[1,25],k=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};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:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:b,7:L,10:23,11:D},t(k,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(k,[2,18]),t(k,[2,19]),t(k,[2,20]),t(k,[2,21]),t(k,[2,23]),t(k,[2,24]),t(k,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(k,[2,15]),t(k,[2,16]),t(k,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(k,[2,25]),t(k,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,K,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var q="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?q="Parse error on line "+(F+1)+`: `+m.showPosition()+` Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":q="Parse error on line "+(F+1)+": Unexpected "+(S==Z?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(q,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+S);switch(N[0]){case 1:a.push(S),u.push(m.yytext),r.push(m.yylloc),a.push(N[1]),S=null,Q=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[N[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},re&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),K=this.performAction.apply(w,[g,Q,F,C.yy,N[1],u,r].concat(se)),typeof K<"u")return K;v&&(a=a.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),a.push(this.productions_[N[1]][0]),u.push(w.$),r.push(w._$),te=M[a[a.length-2]][a[a.length-1]],a.push(te);break;case 3:return!0}}return!0},"parse")},ne=function(){var O={EOF:1,parseError:h(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,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:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-Reiw3hvB.js b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-BOK0qG_k.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-Reiw3hvB.js rename to veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-BOK0qG_k.js index c92f0c21f..ce199729e 100644 --- a/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-Reiw3hvB.js +++ b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-BOK0qG_k.js @@ -1 +1 @@ -import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-D_idPgQl.js";import{p}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a as t,at as o}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../chunks/purify.es-BnINGy_Y.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; +import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-BuYPTb-v.js";import{p}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as t,at as o}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../chunks/purify.es-BnINGy_Y.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-DnQbiAd6.js b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-9it0uedZ.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-DnQbiAd6.js rename to veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-9it0uedZ.js index ca65b480f..5816c558a 100644 --- a/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-DnQbiAd6.js +++ b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-9it0uedZ.js @@ -1,4 +1,4 @@ -import{p as rt}from"./chunk-JWPE2WC7-CWI15yjG.js";import{D as T,b1 as B,f as nt,V as it,aQ as ot,W as st,aR as lt,$ as ct,aT as ut,a as d,at as G,Y as gt,r as dt,aP as pt,aC as ht,B as ft,s as mt,O as vt}from"./mermaid.core-DnksLuoJ.js";import{p as xt}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import{d as Z}from"../../chunks/arc-CXEGKubz.js";import{o as St}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function yt(t,n){return nt?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,W=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=W*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:W};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},P=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{P=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);P.has(t)||(P.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>P,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),q={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Rt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,q)},"parse")},Wt=d(t=>` +import{p as rt}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{D as T,b1 as B,f as nt,V as it,aQ as ot,W as st,aR as lt,$ as ct,aT as ut,a as d,at as G,Y as gt,r as dt,aP as pt,aC as ht,B as ft,s as mt,O as vt}from"./mermaid.core-Byx96n1y.js";import{p as xt}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import{d as Z}from"../../chunks/arc-BmSNZeim.js";import{o as St}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function yt(t,n){return nt?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,W=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=W*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:W};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},P=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{P=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);P.has(t)||(P.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>P,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),q={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Rt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,q)},"parse")},Wt=d(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; diff --git a/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-BHagSQYD.js b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CTiy7YiT.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-BHagSQYD.js rename to veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CTiy7YiT.js index 3f8328633..8bec144d5 100644 --- a/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-BHagSQYD.js +++ b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CTiy7YiT.js @@ -1,4 +1,4 @@ -import{aQ as Ae,V as ke,$ as ae,aT as Fe,W as Pe,aR as ve,a as o,Y as wt,at as At,B as Ce,s as Le,O as V,aN as Ee,a8 as De}from"./mermaid.core-DnksLuoJ.js";import{aB as Vt}from"../../app/index-DZf0wXGZ.js";import{l as ie}from"../../chunks/linear-CeDfK4RZ.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";import"../../chunks/defaultLocale-CrowFXzY.js";var zt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[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],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],Q=[1,32],U=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Qt=[1,68],Ut=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`: +import{aQ as Ae,V as ke,$ as ae,aT as Fe,W as Pe,aR as ve,a as o,Y as wt,at as At,B as Ce,s as Le,O as V,aN as Ee,a8 as De}from"./mermaid.core-Byx96n1y.js";import{aB as Vt}from"../../app/index-y89rQfXU.js";import{l as ie}from"../../chunks/linear-FRN7TzCz.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";import"../../chunks/defaultLocale-CrowFXzY.js";var zt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[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],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],Q=[1,32],U=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Qt=[1,68],Ut=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`: `+D.showPosition()+` Expecting `+St.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Dt="Parse error on line "+(qt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Dt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Lt,expected:St})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+B);switch(W[0]){case 1:g.push(B),A.push(D.yytext),e.push(D.yylloc),g.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,qt=D.yylineno,Lt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],lt.$=A[A.length-M],lt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Jt,qt,K.yy,W[1],A,e].concat(be)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[W[1]][0]),A.push(lt.$),e.push(lt._$),ee=pt[g[g.length-2]][g[g.length-1]],g.push(ee);break;case 3:return!0}}return!0},"parse")},me=function(){var j={EOF:1,parseError:o(function(l,g){if(this.yy.parser)this.yy.parser.parseError(l,g);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-Biow3FMP.js b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-PGVg3Gs4.js similarity index 84% rename from veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-Biow3FMP.js rename to veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-PGVg3Gs4.js index f4cb8923e..6a920928d 100644 --- a/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-Biow3FMP.js +++ b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-PGVg3Gs4.js @@ -1 +1 @@ -import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-D_idPgQl.js";import{p as m}from"./chunk-JWPE2WC7-CWI15yjG.js";import{a as n,at as i}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../chunks/purify.es-BnINGy_Y.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; +import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-BuYPTb-v.js";import{p as m}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{a as n,at as i}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../chunks/purify.es-BnINGy_Y.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-JYMpFkh0.js b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BEni_WUb.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-JYMpFkh0.js rename to veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BEni_WUb.js index d4a2bfbf7..84b4de2a2 100644 --- a/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-JYMpFkh0.js +++ b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BEni_WUb.js @@ -1,4 +1,4 @@ -import{g as ze}from"./chunk-XXDRQBXY-DWj8dVYC.js";import{s as Xe}from"./chunk-KBJHAD2P-CNEAUy5I.js";import{a as d,X as Be,aR as Je,W as Ze,aQ as et,V as tt,aT as st,$ as it,Y as Ne,at as qe,s as rt,_ as nt,a4 as at,aK as lt,b9 as ct}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ce=function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[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],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[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],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[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],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(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:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{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]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[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]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{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]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{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]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[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:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`: +import{g as ze}from"./chunk-XXDRQBXY-DF1LpnDY.js";import{s as Xe}from"./chunk-KBJHAD2P-BwJsQpfI.js";import{a as d,X as Be,aR as Je,W as Ze,aQ as et,V as tt,aT as st,$ as it,Y as Ne,at as qe,s as rt,_ as nt,a4 as at,aK as lt,b9 as ct}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ce=function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[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],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[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],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[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],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(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:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{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]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[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]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{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]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{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]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[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:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`: `+S.showPosition()+` Expecting `+_e.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ke="Parse error on line "+(ge+1)+": Unexpected "+(I==Pe?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ke,{text:S.match,token:this.terminals_[I]||I,line:S.yylineno,loc:Ie,expected:_e})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+I);switch(q[0]){case 1:l.push(I),R.push(S.yytext),t.push(S.yylloc),l.push(q[1]),I=null,$e=S.yyleng,a=S.yytext,ge=S.yylineno,Ie=S.yylloc;break;case 2:if(F=this.productions_[q[1]][1],J.$=R[R.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(J,[a,$e,ge,G.yy,q[1],R,t].concat(We)),typeof Te<"u")return Te;F&&(l=l.slice(0,-1*F*2),R=R.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[q[1]][0]),R.push(J.$),t.push(J._$),Ye=de[l[l.length-2]][l[l.length-1]],l.push(Ye);break;case 3:return!0}}return!0},"parse")},He=function(){var $={EOF:1,parseError:d(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:d(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:d(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:d(function(i){var n=i.length,l=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 s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var R=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:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(i){this.unput(this.match.slice(i))},"less"),pastInput:d(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:d(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:d(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BF_iEz9u.js b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CmNhKWbi.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BF_iEz9u.js rename to veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CmNhKWbi.js index 2398a5ab3..df0d05ad9 100644 --- a/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BF_iEz9u.js +++ b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CmNhKWbi.js @@ -1,4 +1,4 @@ -import{aT as xt,$ as _t,aQ as vt,V as bt,aR as St,W as wt,a as d,Y as lt,N as Lt,aW as Et,s as At,x as Tt}from"./mermaid.core-DnksLuoJ.js";import{aB as Q}from"../../app/index-DZf0wXGZ.js";import{o as Mt}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,n){return q(t.source,n.source)||t.index-n.index}function ht(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:X(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:X(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:X(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:X(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;rc.length)-1)),D(f);for(let c=0;c0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Qt(){return Yt(Ht)}function Xt(t){return[t.source.x1,t.y0]}function qt(t){return[t.target.x0,t.y1]}function Kt(){return Qt().source(Xt).target(qt)}var at=function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +import{aT as xt,$ as _t,aQ as vt,V as bt,aR as St,W as wt,a as d,Y as lt,N as Lt,aW as Et,s as At,x as Tt}from"./mermaid.core-Byx96n1y.js";import{aB as Q}from"../../app/index-y89rQfXU.js";import{o as Mt}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,n){return q(t.source,n.source)||t.index-n.index}function ht(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:X(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:X(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:X(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:X(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;rc.length)-1)),D(f);for(let c=0;c0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Qt(){return Yt(Ht)}function Xt(t){return[t.source.x1,t.y0]}function qt(t){return[t.target.x0,t.y1]}function Kt(){return Qt().source(Xt).target(qt)}var at=function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: `+S.showPosition()+` Expecting `+k.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:k})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),g.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:g[g.length-(e||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(e||1)].first_column,last_column:g[g.length-1].last_column},V&&(f._$.range=[g[g.length-(e||1)].range[0],g[g.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,g].concat(D)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),g=g.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),g.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},y=function(){var m={EOF:1,parseError:d(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:d(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:d(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===x.length?this.yylloc.first_column:0)+x[x.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(o){this.unput(this.match.slice(o))},"less"),pastInput:d(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Bqv2AfOc.js b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-ClGkLfJ7.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Bqv2AfOc.js rename to veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-ClGkLfJ7.js index 16b06fea2..f5715a6ec 100644 --- a/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Bqv2AfOc.js +++ b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-ClGkLfJ7.js @@ -1,4 +1,4 @@ -import{I as er}from"./chunk-2Q5K7J3B-naaeokok.js";import{a as x,aS as rr,Y as j,at as it,aO as Me,B as ar,j as sr,x as m,aR as De,aQ as ir,aT as nr,W as or,V as cr,$ as lr,as as hr,J as dr,s as Tr,aN as Yt,b9 as Z,ac as Q,n as kt,aC as Be,Z as pr,X as Ft,a9 as Er,aL as Ve}from"./mermaid.core-DnksLuoJ.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-CJwzhEYx.js";import{aB as Wt}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var ee=function(){var e=x(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],P=[1,32],S=[1,33],w=[1,34],M=[1,35],V=[1,36],Y=[1,37],z=[1,38],K=[1,39],X=[1,40],$=[1,42],tt=[1,43],U=[1,44],nt=[1,45],et=[1,46],W=[1,47],C=[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],wt=[1,74],Dt=[1,80],A=[1,81],D=[1,82],rt=[1,83],at=[1,84],F=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],Nt=[4,5,17,51,53,54],vt=[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],Se=[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],Gt=[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],we=[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],Xt=[5,52],H=[70,71,72,73],ct=[1,151],Jt={trace:x(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:x(function(N,v,k,y,G,c,mt){var d=c.length-1;switch(G){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([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:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:z,53:K,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:W},{23:56,73:W},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[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:wt},{23:75,55:76,73:wt},{23:77,73:W},{69:78,72:[1,79],78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:W},{23:111,73:W},{23:112,73:W},{23:113,73:W},e([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],Ae),e(C,[2,6]),e(C,[2,16]),e(Nt,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(Se,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Ae,{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:W},{69:146,78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(H,[2,79]),e(H,[2,80]),e(H,[2,81]),e(H,[2,82]),e(H,[2,83]),e(H,[2,84]),e(H,[2,85]),e(H,[2,86]),e(H,[2,87]),e(H,[2,88]),e(H,[2,89]),e(H,[2,90]),e(H,[2,91]),e(H,[2,92]),e(H,[2,93]),e(H,[2,94]),e(H,[2,95]),e(H,[2,96]),e(H,[2,97]),e(H,[2,98]),e(H,[2,99]),e(H,[2,100]),e(H,[2,101]),e(H,[2,102]),e(H,[2,103]),e(H,[2,104]),{23:147,73:W},{23:149,60:148,73:W},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:z,53:K,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,161],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,162],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,163],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,47],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,50:[1,165],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,45],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,49:[1,167],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,43],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,48:[1,170],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,171],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:W},{23:178,73:W},{23:179,73:W},{58:180,104:ct},{23:181,72:[1,182],73:W},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(Nt,[2,11]),{13:186,51:z,53:K,54:X},e(Nt,[2,13]),e(Nt,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:W},{5:[2,58]},{5:[2,59]},{23:200,73:W},e(Nt,[2,12]),e(Se,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{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:x(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:x(function(N){var v=this,k=[0],y=[],G=[null],c=[],mt=this.table,d="",Mt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Zt)&&(gt.yy[Zt]=this.yy[Zt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Qt=J.yylloc;c.push(Qt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,G.length=G.length-ot,c.length=c.length-ot}x(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}x(Pe,"lex");for(var st,xt,lt,$t,Lt={},Bt,Tt,ke,Vt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((st===null||typeof st>"u")&&(st=Pe()),lt=mt[xt]&&mt[xt][st]),typeof lt>"u"||!lt.length||!lt[0]){var jt="";Vt=[];for(Bt in mt[xt])this.terminals_[Bt]&&Bt>Qe&&Vt.push("'"+this.terminals_[Bt]+"'");J.showPosition?jt="Parse error on line "+(Mt+1)+`: +import{I as er}from"./chunk-2Q5K7J3B-Df19aPp9.js";import{a as x,aS as rr,Y as j,at as it,aO as Me,B as ar,j as sr,x as m,aR as De,aQ as ir,aT as nr,W as or,V as cr,$ as lr,as as hr,J as dr,s as Tr,aN as Yt,b9 as Z,ac as Q,n as kt,aC as Be,Z as pr,X as Ft,a9 as Er,aL as Ve}from"./mermaid.core-Byx96n1y.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-w7u93fzV.js";import{aB as Wt}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var ee=function(){var e=x(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],P=[1,32],S=[1,33],w=[1,34],M=[1,35],V=[1,36],Y=[1,37],z=[1,38],K=[1,39],X=[1,40],$=[1,42],tt=[1,43],U=[1,44],nt=[1,45],et=[1,46],W=[1,47],C=[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],wt=[1,74],Dt=[1,80],A=[1,81],D=[1,82],rt=[1,83],at=[1,84],F=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],Nt=[4,5,17,51,53,54],vt=[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],Se=[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],Gt=[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],we=[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],Xt=[5,52],H=[70,71,72,73],ct=[1,151],Jt={trace:x(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:x(function(N,v,k,y,G,c,mt){var d=c.length-1;switch(G){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([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:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:z,53:K,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:W},{23:56,73:W},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[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:wt},{23:75,55:76,73:wt},{23:77,73:W},{69:78,72:[1,79],78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:W},{23:111,73:W},{23:112,73:W},{23:113,73:W},e([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],Ae),e(C,[2,6]),e(C,[2,16]),e(Nt,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(Se,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Ae,{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:W},{69:146,78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(H,[2,79]),e(H,[2,80]),e(H,[2,81]),e(H,[2,82]),e(H,[2,83]),e(H,[2,84]),e(H,[2,85]),e(H,[2,86]),e(H,[2,87]),e(H,[2,88]),e(H,[2,89]),e(H,[2,90]),e(H,[2,91]),e(H,[2,92]),e(H,[2,93]),e(H,[2,94]),e(H,[2,95]),e(H,[2,96]),e(H,[2,97]),e(H,[2,98]),e(H,[2,99]),e(H,[2,100]),e(H,[2,101]),e(H,[2,102]),e(H,[2,103]),e(H,[2,104]),{23:147,73:W},{23:149,60:148,73:W},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:z,53:K,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,161],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,162],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,163],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,47],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,50:[1,165],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,45],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,49:[1,167],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,43],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,48:[1,170],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,171],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:W},{23:178,73:W},{23:179,73:W},{58:180,104:ct},{23:181,72:[1,182],73:W},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(Nt,[2,11]),{13:186,51:z,53:K,54:X},e(Nt,[2,13]),e(Nt,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:W},{5:[2,58]},{5:[2,59]},{23:200,73:W},e(Nt,[2,12]),e(Se,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{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:x(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:x(function(N){var v=this,k=[0],y=[],G=[null],c=[],mt=this.table,d="",Mt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Zt)&&(gt.yy[Zt]=this.yy[Zt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Qt=J.yylloc;c.push(Qt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,G.length=G.length-ot,c.length=c.length-ot}x(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}x(Pe,"lex");for(var st,xt,lt,$t,Lt={},Bt,Tt,ke,Vt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((st===null||typeof st>"u")&&(st=Pe()),lt=mt[xt]&&mt[xt][st]),typeof lt>"u"||!lt.length||!lt[0]){var jt="";Vt=[];for(Bt in mt[xt])this.terminals_[Bt]&&Bt>Qe&&Vt.push("'"+this.terminals_[Bt]+"'");J.showPosition?jt="Parse error on line "+(Mt+1)+`: `+J.showPosition()+` Expecting `+Vt.join(", ")+", got '"+(this.terminals_[st]||st)+"'":jt="Parse error on line "+(Mt+1)+": Unexpected "+(st==me?"end of input":"'"+(this.terminals_[st]||st)+"'"),this.parseError(jt,{text:J.match,token:this.terminals_[st]||st,line:J.yylineno,loc:Qt,expected:Vt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+st);switch(lt[0]){case 1:k.push(st),G.push(J.yytext),c.push(J.yylloc),k.push(lt[1]),st=null,Ne=J.yyleng,d=J.yytext,Mt=J.yylineno,Qt=J.yylloc;break;case 2:if(Tt=this.productions_[lt[1]][1],Lt.$=G[G.length-Tt],Lt._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},je&&(Lt._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),$t=this.performAction.apply(Lt,[d,Ne,Mt,gt.yy,lt[1],G,c].concat($e)),typeof $t<"u")return $t;Tt&&(k=k.slice(0,-1*Tt*2),G=G.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),k.push(this.productions_[lt[1]][0]),G.push(Lt.$),c.push(Lt._$),ke=mt[k[k.length-2]][k[k.length-1]],k.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=function(){var ut={EOF:1,parseError:x(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:x(function(N,v){return this.yy=v||this.yy||{},this._input=N,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:x(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var v=N.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),N},"input"),unput:x(function(N){var v=N.length,k=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=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 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:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[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:x(function(){return this._more=!0,this},"more"),reject:x(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:x(function(N){this.unput(this.match.slice(N))},"less"),pastInput:x(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var N=this.pastInput(),v=new Array(N.length+1).join("-");return N+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-XOPLWqcN.js b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C7Roe_yn.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-XOPLWqcN.js rename to veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C7Roe_yn.js index f5fe5050d..b87a09ec5 100644 --- a/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-XOPLWqcN.js +++ b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C7Roe_yn.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=1;function a(){if(!(typeof globalThis>"u"))return globalThis}n(a,"getCaptureGlobal");function m(){var o;return!!((o=a())!=null&&o.mermaidCaptureSizes)}n(m,"shouldCaptureSizes");function d(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}n(d,"capturedFromLocation");function s(o,r){const e=a();if(!e)return;const t=r.node(),i=(t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t,p=(i==null?void 0:i.id)??"(unknown)";e.mermaidCapturedSizes??(e.mermaidCapturedSizes=[]);const u={svgId:p,sizes:o};e.mermaidCapturedSizes.push(u),e.mermaidLastCapturedSizes=u}n(s,"emitCapturedSizes");function l(o,r){const e=[];for(const t of r.nodes)t.isGroup||e.push({id:t.id,width:t.width??0,height:t.height??0});e.length!==0&&s({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:d()},nodes:e},o)}n(l,"captureNodeSizes");export{l as captureNodeSizes,m as shouldCaptureSizes}; +import{a as n}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=1;function a(){if(!(typeof globalThis>"u"))return globalThis}n(a,"getCaptureGlobal");function m(){var o;return!!((o=a())!=null&&o.mermaidCaptureSizes)}n(m,"shouldCaptureSizes");function d(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}n(d,"capturedFromLocation");function s(o,r){const e=a();if(!e)return;const t=r.node(),i=(t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t,p=(i==null?void 0:i.id)??"(unknown)";e.mermaidCapturedSizes??(e.mermaidCapturedSizes=[]);const u={svgId:p,sizes:o};e.mermaidCapturedSizes.push(u),e.mermaidLastCapturedSizes=u}n(s,"emitCapturedSizes");function l(o,r){const e=[];for(const t of r.nodes)t.isGroup||e.push({id:t.id,width:t.width??0,height:t.height??0});e.length!==0&&s({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:d()},nodes:e},o)}n(l,"captureNodeSizes");export{l as captureNodeSizes,m as shouldCaptureSizes}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-7KBZw4rp.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BrlX_tes.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-7KBZw4rp.js rename to veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BrlX_tes.js index f071dc393..6027d732a 100644 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-7KBZw4rp.js +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BrlX_tes.js @@ -1 +1 @@ -import{b as R,s as W,S as N}from"./chunk-5RXB4S5H-gjMuKq5U.js";import{a as f,Y as t,at as S,B as P,x as z,aq as U,G as _,a9 as C,b9 as F}from"./mermaid.core-DnksLuoJ.js";import{aB as H}from"../../app/index-DZf0wXGZ.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-DWj8dVYC.js";import"./chunk-KBJHAD2P-CNEAUy5I.js";import"./chunk-2GRJ4B5K-CJwzhEYx.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/map-8WAJQ6ap.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
");p=p.replace(/\n/g,"
");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; +import{b as R,s as W,S as N}from"./chunk-5RXB4S5H-CziPj31s.js";import{a as f,Y as t,at as S,B as P,x as z,aq as U,G as _,a9 as C,b9 as F}from"./mermaid.core-Byx96n1y.js";import{aB as H}from"../../app/index-y89rQfXU.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-DF1LpnDY.js";import"./chunk-KBJHAD2P-BwJsQpfI.js";import"./chunk-2GRJ4B5K-w7u93fzV.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/map-8WAJQ6ap.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
");p=p.replace(/\n/g,"
");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-BUH5KdnU.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-BUH5KdnU.js new file mode 100644 index 000000000..001e32e66 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-BUH5KdnU.js @@ -0,0 +1 @@ +import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-CziPj31s.js";import{a as i}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"./chunk-XXDRQBXY-DF1LpnDY.js";import"./chunk-KBJHAD2P-BwJsQpfI.js";import"./chunk-2GRJ4B5K-w7u93fzV.js";import"../../chunks/purify.es-BnINGy_Y.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js deleted file mode 100644 index 89259c6c5..000000000 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DY-saesF.js +++ /dev/null @@ -1 +0,0 @@ -import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-gjMuKq5U.js";import{a as i}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"./chunk-XXDRQBXY-DWj8dVYC.js";import"./chunk-KBJHAD2P-CNEAUy5I.js";import"./chunk-2GRJ4B5K-CJwzhEYx.js";import"../../chunks/purify.es-BnINGy_Y.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D1dh_Nns.js b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-CR3Yx4nf.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D1dh_Nns.js rename to veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-CR3Yx4nf.js index 2af2f42e8..97e3f6d2b 100644 --- a/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D1dh_Nns.js +++ b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-CR3Yx4nf.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-XOPLWqcN.js","assets/visualizations/mermaid/mermaid.core-DnksLuoJ.js","assets/app/index-DZf0wXGZ.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); -import{_ as Rr}from"../../app/index-DZf0wXGZ.js";import{c as Nr}from"./chunk-RYQCIY6F-DfwPULTh.js";import{aw as Or,v as Pr,t as Br,u as kr,at as Qe,Y as _r,ag as Fr,ad as Dr,aG as Hr,ae as Xr,af as Yr,X as Gr,a6 as $r,P as zr,b9 as _e,b2 as Ve,a as d,av as Po}from"./mermaid.core-DnksLuoJ.js";import{G as Vr}from"../../chunks/graph-Dqkl27Ch.js";import"../../chunks/map-8WAJQ6ap.js";import"../../chunks/purify.es-BnINGy_Y.js";async function Xo(t,e){const n=new Vr({multigraph:!0,compound:!0}),o=[...e.edges],s=_r(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),a=r.insert("g").attr("class","edges edgePath"),c=r.insert("g").attr("class","edgeLabels"),f=r.insert("g").attr("class","nodes"),g=new Map,p=t.node()!=null;await Promise.all(e.nodes.map(async M=>{var u;if(M.isGroup)n.setNode(M.id,{...M});else{if(p){const h=await Fr(f,M,{config:s,dir:M.dir}),l=((u=h.node())==null?void 0:u.getBBox())??{width:0,height:0};g.set(M.id,h),M.width=l.width,M.height=l.height}n.setNode(M.id,{...M})}}));for(const M of o)n.setEdge(M.start,M.end,{...M},M.id),e.edges.some(h=>h.id===M.id)||e.edges.push(M);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:M}=await Rr(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-XOPLWqcN.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));M(t,e)}return{graph:n,groups:{clusters:i,edgePaths:a,edgeLabels:c,nodes:f,rootGroups:r},nodeElements:g}}d(Xo,"createGraphWithElements");var Bo=5,je=1e-5,Ue=1e-6;function tn(t){const e=[];for(let n=0;n=1-Ue||M<=Ue||M>=1-Ue?null:{point:{x:t.x+p*s,y:t.y+p*r},tA:p,tB:M}}d(Yo,"segmentIntersection");function wn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(wn,"isHorizontalSeg");function Go(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d($o,"getArcSweepFlag");var jr=.001;function zo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Po[e.arrowTypeStart];if(o){const r=t[0],i=t[1],a=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(a),n[0].y=r.y+o*Math.sin(a)}const s=e.arrowTypeEnd&&Po[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],a=t[r-1],c=Math.atan2(a.y-i.y,a.x-i.x);n[r-1].x=a.x-s*Math.cos(c),n[r-1].y=a.y-s*Math.sin(c)}return n}d(zo,"applyMarkerOffsets");function Vo(t,e,n,o,s){const r=t.point.x,i=t.point.y,a={x:r-e*t.r,y:i-n*t.r},c={x:r+e*t.r,y:i+n*t.r},f=[`L${Oe(a)}`];return s==="arc"?f.push(`A${le(t.r)},${le(t.r)} 0 0 ${o} ${Oe(c)}`):f.push(`M${Oe(c)}`),f}d(Vo,"emitJump");function An(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,a=n.y-e.y,c=Math.hypot(s,r),f=Math.hypot(i,a);if(c0){const v=An(s[f-1],s[f],s[f+1]??s[f],Bo);v&&(l=v.cutLen)}let x=p,C=null;r&&fv.t-L.t);for(const v of b)v.r=Math.min(v.r,v.d-l,x-v.d);for(let v=0;vL){const y=L/2;b[v].r=Math.min(b[v].r,y),b[v+1].r=Math.min(b[v+1].r,y)}}for(const v of b)v.r=2?o:null}catch{return null}}d(Ko,"decodeDataPoints");function qo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const f of e)s.set(f.id,f);const r=[],i=new Map;for(const f of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(f.id):f.id,p=o.querySelector(`path[data-id="${g}"]`);if(!p)continue;i.set(f.id,p);const u=Ko(p.getAttribute("data-points"))??f.points;r.push({...f,points:u})}const a=Go(r);if(a.length===0)return;const c=new Map;for(const f of a){const g=c.get(f.jumpEdgeId)??[];g.push(f),c.set(f.jumpEdgeId,g)}for(const f of r){const g=c.get(f.id);if(!g||g.length===0)continue;const p=s.get(f.id),M=p==null?void 0:p.curve;if(M!==void 0&&!Wo(M))continue;const u=i.get(f.id);if(!u)continue;if(M===void 0){const v=u.getAttribute("d")??"";if(!Uo(v))continue}const h=u.getAttribute("style")??"",l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(h),x=l?Number.parseFloat(l[1]):null,C=l?Number.parseFloat(l[2]):null,b=jo(f,g,n);if(u.setAttribute("d",b),x!==null&&C!==null&&typeof u.getTotalLength=="function"){const v=u.getTotalLength(),L=Math.max(0,v-x-C),y=`0 ${x} ${L} ${C}`,I=h.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${y};`).replace(/;\s*;+/g,";");u.setAttribute("style",I)}}}d(qo,"applyLineJumpsToSvg");async function Jo(t,e){var s,r;for(const i of t.nodes)i.isGroup?await Dr(e.clusters,i):Hr(i);const n=new Map;for(const i of t.nodes)i!=null&&i.id&&n.set(i.id,i);for(const i of t.edges){const a=i.start?n.get(i.start)??{}:{},c=i.end?n.get(i.end)??{}:{},f=Xr(e.edgePaths,{...i},{},t.type,a,c,t.diagramId);i.label&&await Yr(e.rootGroups,i),i.label&&Zo(i,f)}const o=(r=(s=t.config)==null?void 0:s.swimlane)==null?void 0:r.lineHops;if(o!==!1){const i=o==="gap"?"gap":"arc",a=t.edges.filter(c=>Array.isArray(c.points)&&c.points.length>=2).map(c=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));qo(e.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}}d(Jo,"adjustLayout");function Zo(t,e){const n=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),o=Gr(),{subGraphTitleTotalMargin:s}=$r({flowchart:o.flowchart??{}});if(t.label){const r=zr.get(t.id);let i=t.x,a=t.y;if(n){const c=_e.calcLabelPosition(n);Qe.debug("Moving label "+t.label+" from (",i,",",a,") to (",c.x,",",c.y,") abc88"),e&&(i=c.x,a=c.y)}r.attr("transform",`translate(${i}, ${a+s/2})`)}if(t!=null&&t.startLabelLeft){const r=Ve.get(t.id).startLeft;let i=t==null?void 0:t.x,a=t==null?void 0:t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.startLabelRight){const r=Ve.get(t.id).startRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelLeft){const r=Ve.get(t.id).endLeft;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelRight){const r=Ve.get(t.id).endRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}}d(Zo,"positionEdgeLabel");var vn="__swimlane_default__",Ur=21,ko=20;function Rn(t){return Math.max(t.padding??ko,ko)}d(Rn,"topLaneHorizontalPadding");function Qo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,a=Math.min(r,n+s/2),c=Math.min(Ur,Math.max(0,a-i)),f=i+c;if(f<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:f}}d(Qo,"assignTopLaneTitleRect");function ts(t){const e=t.direction,n=t.nodes??(t.nodes=[]);for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===vn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:vn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=vn}d(ts,"prepareLayoutForSwimlanes");function es(t){const e=new Map;for(const c of t.nodes??[])e.set(c.id,c);const n=[];for(const c of t.edges??[]){const f=typeof c.start=="string"?c.start:void 0,g=typeof c.end=="string"?c.end:void 0;!f||!g||c.labelNodeId||n.push({id:c.id,src:f,dst:g,ref:c})}const o=t.nodes??[],s=o.filter(c=>c.isGroup),r=o.filter(c=>!c.isGroup);return{nodes:[...[...s].reverse(),...r].map(c=>c.id),edges:n,layout:t,nodeById:e}}d(es,"toGraphView");function ns(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=(o==null?void 0:o.layerGap)??100,a=(o==null?void 0:o.nodeGap)??40;let c=0;for(const M of e.layers){let u=0;for(const h of M){const l=r.get(h);if(!l){u++;continue}l.layer=c,l.order=u;const x=n.x[h]??u*a,C=n.y[h]??c*i;l.x=x,l.y=C,u++}c++}const f=s.nodes??[],g=new Map,p=[];for(const M of f){if(!(M!=null&&M.isGroup))continue;M.parentId||p.push(M);const u=f.filter(b=>b.parentId===M.id);let h=1/0,l=-1/0,x=1/0,C=-1/0;for(const b of u){const v=b.x??n.x[b.id],L=b.y??n.y[b.id],y=b.width??0,I=b.height??0;v!=null&&L!=null&&(h=Math.min(h,v-y/2),l=Math.max(l,v+y/2),x=Math.min(x,L-I/2),C=Math.max(C,L+I/2))}if(h===1/0||x===1/0)M.x=M.x??0,M.y=M.y??0,M.width=M.width??0,M.height=M.height??0;else{const b=M.padding??20,v=M.parentId?b:2*Rn(M),L=b,y=Math.max(0,l-h)+v,I=Math.max(0,C-x)+L,E=(h+l)/2,A=(x+C)/2;M.x=E,M.y=A,M.width=y,M.height=I,g.set(M.id,{minX:h,maxX:l,minY:x,maxY:C})}}if(p.length>0&&g.size>0){let M=1/0,u=-1/0,h=0;for(const l of p){const x=l.padding??20;x>h&&(h=x);const C=g.get(l.id);C&&(M=Math.min(M,C.minY),u=Math.max(u,C.maxY))}if(M!==1/0&&u!==-1/0){const l=Math.max(0,u-M),C=Math.max(h,36),b=l+2*C,v=(M+u)/2;for(const B of p)B.y=v,B.height=b,B.swimlaneContentTop=M;const L=[...p].sort((B,O)=>{const k=B.x??0,H=O.x??0;return k-H}),y=[],I=[],E=[];for(const B of L){const O=g.get(B.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*Rn(B),H=(O.minX+O.maxX)/2;y.push(B.id),I.push(H),E.push(k)}const A=y.length;if(A>0){const B=new Map;if(A===1)B.set(y[0],E[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Pe(e,n,o,s)}:void 0}d(co,"measuredNodeRect");function ao(t){if(t.isGroup)return;const e=co(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(ao,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)n}d(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}d(Ot,"isVerticalSegment");function Wt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(Wt,"overlapLength");function de(t,e,n=Yt){return t.horizontal&&e.horizontal&&yt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&>(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(de,"sameAxisSegmentOverlapLength");function Be(t,e=Yt){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(xt,"dedupeConsecutivePoints");function lo(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(lo,"classifyThreeSegmentRoute");function dn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ss,"rectContainsRect");function en(t,e){return t.lefte.left&&t.tope.top}d(en,"rectsOverlap");function Nn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Nn,"inflateRect");function Pe(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Pe,"rectFromCenterSize");function te(t){var e;return(e=co(t))==null?void 0:e.rect}d(te,"rectOfNodeBounds");function Le(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}}}d(Le,"portForRectSide");function uo(t,e,n,o,s,r=Yt){const i=e==="left"||e==="right",a=o==="left"||o==="right";if(i&&a){if(e==="right"&&o==="left"&&t.xn.x){if(yt(t,n,r))return[t,n];const p=(t.x+n.x)/2;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}if(e===o){if(yt(t,n,r))return;const p=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}return}if(!i&&!a){if(e===o){if(gt(t,n,r))return;const M=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:M},{x:n.x,y:M},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(gt(t,n,r))return[t,n];const p=(t.y+n.y)/2;return[t,{x:t.x,y:p},{x:n.x,y:p},n]}if(i&&!a){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&p?[t,{x:n.x,y:t.y},n]:void 0}const c=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return c&&f?[t,{x:t.x,y:n.y},n]:void 0}d(uo,"buildOrthogonalPortPath");function ho(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ho,"buildSameSideTrackPath");function un(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=ao(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(un,"collectRealNodeBounds");function Me(t){const e=[],n=[];for(const o of t){const s=ao(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(Me,"collectNodeRectEntries");function rs(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,a=o.height??0;n.push({nodeId:o.id,...Pe(s,r,i,a)})}return n}d(rs,"collectLayoutNodeRects");function go(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)h||MC)return!1;const b=Math.abs(l-g.a.x)s:r&&a&&yt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}d(is,"sameAxisSegmentsOverlap");function nn(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const a=i.points;if(!(!a||a.length<2))for(let c=0;cM+s&&hl+s&&po+Yt&&t=2?e[e.length-2]:void 0,c=(i?gt(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(c)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}d(on,"orthogonalizePolyline");function ue(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=as(e);if(e=o.points,!o.changed)break}return e}d(ue,"simplifyPolyline");var it=.001,Kr=.5,_o=4;function yo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=ls(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(Pn,"clipEndpoint");function fs(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Pn(s,o.srcRect,!0)),o.dstRect&&(s=Pn(s,o.dstRect,!1)),s=ue(on(s)),s=po(s,o.srcRect,o.dstRect),o.edge.points=ue(on(s))}}d(fs,"clipEdgeEndpointsToNodeBoundaries");function Bn(t,e,n,o=!1){if(yt(t,e,it)){if(e.yn.bottom+it)return e;if(o){if(t.xn.right+it)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(gt(t,e,it)){if(e.xn.right+it)return e;if(o){if(t.yn.bottom+it)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Bn,"snapEndpointToBoundary");function sn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(ds,"intersectRanges");function _n(t,e){return e==="left"||e==="right"?rn(t.top,t.bottom):rn(t.left,t.right)}d(_n,"clearanceRangeForSide");function cn(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(yt(t,e,it)&&o){if(Math.abs(t.x-n.left)0?ds(r):void 0}d(us,"straightClearanceRange");function Fn(t,e,n,o,s){const r=us(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,a=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(a-i)({...a}));for(let a=e;a>=0&&a=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)o.bottom+it;case"left":return yt(e,n,it)&&n.xo.right+it}}d(Xn,"leavesOutward");function Yn(t,e,n){if(t.length<3)return t;if(n){const r=Hn(t[0],t[1],e);return r&&Xn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Hn(t[o-1],t[o],e);return s&&Xn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Yn,"collapseOwnBorderStub");function ms(t,e,n){let o=t;if(e){const r=sn(o,0,1);if(r){const i=Bn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Yn(o,e,!0)}if(n){const r=o.length-1,i=sn(o,r,-1);if(i){const a=Bn(i,o[r],n,!0);a!==o[r]&&(o=[...o.slice(0,r),a])}o=Yn(o,n,!1)}const s=po(o,e,n);return s!==o||o.length===2?s:(e&&(o=Dn(o,e,!0)),n&&(o=Dn(o,n,!1)),o)}d(ms,"snapAndCollapseEndpoints");function Gn(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;const s=xt(o.points,it),r=ms(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Gn,"prepareEdgeEndpointsForRenderer");function xo(t){return new Map(t.map(e=>[e.id,e]))}d(xo,"buildNodeMap");function ys(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}d(ys,"resolveTopLevelGroupId");function $n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}d($n,"groupDepth");function bo(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,a=r.y;if(typeof i!="number"||typeof a!="number")continue;const c=r.width??0,f=r.height??0;e=Math.min(e,i-c/2),n=Math.max(n,i+c/2),o=Math.min(o,a-f/2),s=Math.max(s,a+f/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(bo,"boundsForChildren");function ps(t,e){const n=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)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ps,"applyGroupBounds");function xs(t){const e=xo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>$n(s,e)-$n(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=bo(s);r&&ps(o,r)}}d(xs,"recomputeNestedGroupBounds");function an(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);let r=1/0,i=-1/0;for(const c of s){const f=c[e];typeof f=="number"&&(r=Math.min(r,f),i=Math.max(i,f))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const a=d(c=>r+i-c,"mirror");for(const c of n){const f=c[e];typeof f=="number"&&(c[e]=a(f));const g=c.groupTitleRect;g&&(c.groupTitleRect=e==="x"?{...g,left:a(g.right),right:a(g.left)}:{...g,top:a(g.bottom),bottom:a(g.top)})}for(const c of o)for(const f of c.points??[])f[e]=a(f[e]);return!0}d(an,"mirrorAxis");function bs(t){return(t.nodes??[]).some(n=>!n.isGroup)?an(t,"y"):!0}d(bs,"applyBtDirectionTransform");function Ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/p):1;for(const P of s){const G=P.x??0,tt=((P.y??0)-i)*M+a,ft=G-r;P.x=tt,P.y=ft}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,ft=(G.y-i)*M+a,Mt=j-r;G.x=ft,G.y=Mt}xs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&an(t,"x"),!0;const h=xo(n),l=new Map;for(const P of n){if(P.isGroup)continue;const G=ys(P,h);if(!G)continue;const j=l.get(G)??[];j.push(P),l.set(G,j)}let x=0;for(const P of u){const G=P.padding??0;G>x&&(x=G)}const C=[];let b=1/0,v=-1/0;for(const P of u){const G=l.get(P.id)??[],j=bo(G);j&&(b=Math.min(b,j.minX),v=Math.max(v,j.maxX),C.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const L=Math.max(0,v-b),y=Math.max(x,10),I=L+2*y,E=a+I,O=(b+v)/2-I/2-a,k=O+E/2,H=Math.max(x,a);C.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PM.cy?C.bottom:C.top,H=M.cx+b;if(H<=C.left+ae||H>=C.right-ae)continue;v={x:H,y:k},L={x:H,y:a.y},y={x:a.x,y:a.y}}else{const k=u.cx>M.cx?C.right:C.left,H=M.cy+b;if(H<=C.top+ae||H>=C.bottom-ae)continue;v={x:k,y:H},L={x:a.x,y:H},y={x:a.x,y:a.y}}const I=ce(v,L,ae),E=ce(L,y,ae);if(I&&E||!I&&Pt(v,L,o,[g],1)||!E&&Pt(L,y,o,[p],1))continue;const A=!I&&nn(v,L,t,s,{epsilon:ae,skipDegenerateOther:!0}),B=!E&&nn(L,y,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(A||B)){I?x=[L,y]:E?x=[v,L]:x=[v,L,y];break}}x&&(s.points=x)}}d(Is,"portSwapToLShape");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values());for(const a of t){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<4)continue;const f=xt(c,.001);if(f.length<4)continue;const g=f.length-1,p=f[g],M=f[g-1],u=f[g-2],h=p.x-M.x,l=p.y-M.y,x=Math.hypot(h,l);if(x>=10||x<.001)continue;const C=M.x-u.x,b=M.y-u.y;if(Math.hypot(C,b)<.001)continue;const L=Nt(M,p,.001),y=Ot(M,p,.001),I=Nt(u,M,.001),E=Ot(u,M,.001);if(!(L&&E||y&&I))continue;const A=a.end,B=a.start,O=A?e.get(A):void 0;if(!O)continue;const k=O.x??0,H=O.y??0,P=te(O);if(!P)continue;let G,j;if(E){const J=b<0;G={x:k,y:u.y},j={x:k,y:J?P.bottom:P.top}}else{const J=C>0;G={x:u.x,y:H},j={x:J?P.right:P.left,y:H}}if(Pt(G,j,r,A?[A]:[],-2)||Pt(G,j,i,[],-2))continue;if(B){const J=e.get(B),rt=J?te(J):void 0;if(rt&&fo(G,rt,2))continue}const tt=d((J,rt)=>`${J.x.toFixed(3)},${J.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let J=0;J{for(const ut of t){if(ut===a||ut.isLayoutOnly)continue;const pt=ut.points;if(!(!pt||pt.length<2))for(let St=0;St=0){const J=f[g-3],rt=[B,A].filter(ut=>!!ut);if(Pt(J,G,r,rt,-2)||Mt(J,G))continue}const Ft=[...f.slice(0,g-2),G,j];a.points=Ft;const nt=a.labelNodeId;if(nt){const J=e.get(nt);if(J){const rt=J.width??0,ut=J.height??0;if(rt>0&&ut>0){let pt,St,wt=-1;for(let Kt=0;Kt=rt+2||me&&se>=ut+2)&&se>wt&&(wt=se,pt=(qt.x+Jt.x)/2,St=(qt.y+Jt.y)/2)}pt!==void 0&&St!==void 0&&(J.x=pt,J.y=St)}}}}}d(Ss,"collapseShortTerminalStub");var et=.001,Xt=8,at=Be,Ln=d((t,e)=>gt(t,e,et)||yt(t,e,et),"orthogonallyAligned");function Cs(t,e){const s=d((u,h)=>{const l=u.x??0,x=u.y??0,C=h.x-l,b=h.y-x;let v=(u.width??0)/2,L=(u.height??0)/2;return Math.abs(b)*v>Math.abs(C)*L?(b<0&&(L=-L),{x:l+(b===0?0:L*C/b),y:x+L}):(C<0&&(v=-v),{x:l+v,y:x+(C===0?0:v*b/C)})},"rectIntersect"),r=d((u,h)=>{const l=xt(u.points??[]);if(l.length<2)return;const x=h?u.start:u.end,C=x?e.get(x):void 0,b=C?te(C):void 0;if(!C||!x||!b)return;const v=h?l[0]:l[l.length-1],L=h?l[1]:l[l.length-2],y=s(C,v);let I=v;if(Ln(L,y)&&(I=L),gt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"V",coord:y.x,min:Math.min(y.y,I.y),max:Math.max(y.y,I.y),boundary:y,railEnd:I,rect:b};if(yt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"H",coord:y.y,min:Math.min(y.x,I.x),max:Math.max(y.x,I.x),boundary:y,railEnd:I,rect:b}},"terminalLaneFor"),i=d((u,h)=>Math.max(0,Math.min(u.max,h.max)-Math.max(u.min,h.min)),"projectedOverlapLength"),a=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&>(u.boundary,h.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&yt(u.boundary,h.boundary,1),"sameTerminalFace"),c=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:i(u,h)>=Xt&&Math.abs(u.coord-h.coord)<.5,"exactTerminalLaneConflict"),f=d((u,h)=>{if(u.nodeId!==h.nodeId||u.orientation!==h.orientation||u.orientation!=="H"||u.atStart===h.atStart)return!1;const l=i(u,h);if(l2*x?!1:a(u,h)&&Math.abs(u.coord-h.coord)<16},"nearTerminalLaneConflict"),g=d((u,h)=>{const l=xt(u.edge.points??[]);if(l.length<2)return;const x=u.orientation==="V"?{x:u.boundary.x+h,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+h},C=u.orientation==="V"?{x:u.railEnd.x+h,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+h};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?yt(x,u.boundary,et)&&x.x>=u.rect.left+1&&x.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?gt(x,u.boundary,et)&&x.y>=u.rect.top+1&&x.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const I=l.length>1&&ce(l[1],u.railEnd,et),E=l.slice(I?2:1),A=E[0];return A&&!Ln(A,C)?void 0:[x,C,...E]}const v=l.length>1&&ce(l[l.length-2],u.railEnd,et),L=l.slice(0,v?-2:-1),y=L[L.length-1];if(!(y&&!Ln(y,C)))return[...L,C,x]},"shiftedCandidate"),p=d(u=>{const h=u.edge,l=xt(h.points??[]);if(l.length!==2)return!1;const x=h.start,C=h.end,b=x?e.get(x):void 0,v=C?e.get(C):void 0;if(!b||!v)return!1;const L=b.x??0,y=b.y??0,I=v.x??0,E=v.y??0,[A,B]=l;return yt(A,B,et)&&Math.abs(y-E)<1&&Math.abs(L-I)>1||gt(A,B,et)&&Math.abs(L-I)<1&&Math.abs(y-E)>1},"laneIsStraightCollinearConnector"),M=[-7,7,-2*7,2*7,-3*7,3*7];for(let u=0;u<8;u++){const h=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let l=!1;for(let x=0;x{const A=p(I),B=p(E);return A!==B?Number(A)-Number(B):+!E.atStart-+!I.atStart});for(const I of y){for(const E of M){const A=g(I,E);if(!A)continue;const B=r({...I.edge,points:A},I.atStart);if(!(!B||h.some(O=>O.edge!==I.edge&&(c(B,O)||L&&f(B,O))))){I.edge.points=A,l=!0;break}}if(l)break}}if(!l)return}}d(Cs,"separateSharedRenderedTerminalLanes");function vs(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=d((a,c)=>{const f=a.start,g=a.end,p=at(c);if(p.length!==c.length-1)return!1;const M=[f,g].filter(u=>!!u);for(const u of p)if(Pt(u.a,u.b,o,M,-2)||Pt(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===a||u.isLayoutOnly)continue;const h=u.points;if(!(!h||h.length<2)){for(const l of p)for(const x of at(xt(h)))if(de(l,x,.5)>=Xt||he(l.a,l.b,x.a,x.b,et))return!1}}return!0},"candidateIsSafe"),i=d((a,c)=>{if(c+4>=a.length)return;const f=a[c],g=a[c+1],p=a[c+2],M=a[c+3],u=a[c+4],h=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&>(f,M,et)&>(f,u,et)&>(g,p,et)&&(g.x-f.x)*(M.x-p.x)<0,l=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&yt(f,M,et)&&yt(f,u,et)&&yt(g,p,et)&&(g.y-f.y)*(M.y-p.y)<0;if(h||l)return xt([...a.slice(0,c+1),u,...a.slice(c+5)]);if(c+5>=a.length)return;const x=a[c+5],C=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&Ot(u,x)&>(f,u,et)&>(f,x,et)&>(p,M,et)&&(p.x-g.x)*(u.x-M.x)<0,b=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&&Nt(u,x)&&yt(f,u,et)&&yt(f,x,et)&&yt(p,M,et)&&(p.y-g.y)*(u.y-M.y)<0;if(!(!C&&!b))return xt([...a.slice(0,c+1),x,...a.slice(c+6)])},"withoutDogleg");for(let a=0;a<8;a++){let c=!1;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(let p=0;p<=g.length-5;p++){const M=i(g,p);if(!(!M||!r(f,M))){f.points=M,c=!0;break}}if(c)break}if(!c)return}}d(vs,"collapseRedundantRectangularDoglegs");function zn(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(h=>!h.isLayoutOnly),c=d((h,l,x)=>xt(h===l?x??[]:h.points??[]),"pointsFor"),f=d((h,l)=>{let x=0;for(let C=0;C{const l=at(h);if(l.length!==3)return;const x=l[1];if(!(l[0].horizontal===x.horizontal||l[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);return r.filter(C=>{if(x.includes(C.id))return!1;const b=C.rect;return l.horizontal?Wt(l.a.x,l.b.x,b.left,b.right)>=Xt&&l.a.y>=b.top-2&&l.a.y<=b.bottom+2:Wt(l.a.y,l.b.y,b.top,b.bottom)>=Xt&&l.a.x>=b.left-2&&l.a.x<=b.right+2})},"blockingRectsFor"),M=d((h,l,x)=>{const C=h.map(v=>({...v}));if(l.horizontal)C[l.index].y=x,C[l.index+1].y=x;else if(l.vertical)C[l.index].x=x,C[l.index+1].x=x;else return;const b=ue(xt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),u=d((h,l,x)=>{const C=[h.start,h.end].filter(v=>!!v),b=at(l);if(b.length!==l.length-1)return!1;for(const v of b)if(Pt(v.a,v.b,r,C,-2)||Pt(v.a,v.b,i,[],-2))return!1;for(const v of a)if(v!==h){for(const L of b)for(const y of at(c(v)))if(de(L,y,.5)>=Xt)return!1}return f(h,l)<=x},"candidateIsSafe");for(let h=0;h<8;h++){const l=f();let x=!1;for(const C of a){const b=c(C),v=g(b);if(!v)continue;const L=p(C,v.segment);if(L.length===0)continue;const y=v.horizontal?[Math.min(...L.map(I=>I.rect.top))-20,Math.max(...L.map(I=>I.rect.bottom))+20]:[Math.min(...L.map(I=>I.rect.left))-20,Math.max(...L.map(I=>I.rect.right))+20];for(const I of y){const E=M(b,v.segment,I);if(!(!E||!u(C,E,l))){C.points=E,x=!0;break}}if(x)break}if(!x)return}}d(zn,"liftObstacleHuggingSameSideRails");function Vn(t,e){const o=d(c=>{const f=c.groupTitleRect;if(!(!f||typeof f.left!="number"||typeof f.right!="number"||typeof f.top!="number"||typeof f.bottom!="number"||!Number.isFinite(f.left)||!Number.isFinite(f.right)||!Number.isFinite(f.top)||!Number.isFinite(f.bottom)||f.right<=f.left||f.bottom<=f.top))return{left:f.left,right:f.right,top:f.top,bottom:f.bottom}},"validTitleRect"),s=d(c=>{if(!c.isGroup||c.parentId)return;const f=c.direction,g=typeof f=="string"?f.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const p=o(c),M=c.y,u=c.height;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(l<=0||h{if(!c.horizontal)return!1;const g=c.a.y;return g<=f.top+et||g>=f.bottom-et?!1:Wt(c.a.x,c.b.x,f.left,f.right)>=Xt},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(c=>!!c);if(i.length===0)return;let a=0;for(const c of t){if(c.isLayoutOnly)continue;const f=xt(c.points??[]);for(const g of at(f))for(const p of i)r(g,p.rect)&&(a=Math.max(a,p.rect.bottom-g.a.y+4))}if(!(a<=et))for(const c of i){const f=c.node.y,g=c.node.height;typeof f!="number"||typeof g!="number"||!Number.isFinite(f)||!Number.isFinite(g)||g<=0||(c.node.y=f-a/2,c.node.height=g+a,c.node.groupTitleRect={...c.rect,top:c.rect.top-a,bottom:c.rect.bottom-a})}}d(Vn,"liftTopLaneTitleBandsAboveRails");function jn(t,e){const o=d(f=>{const g=f.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId||f.direction!=="LR")return;const p=o(f),M=f.x,u=f.width;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(h<=0||l{if(!f.vertical)return!1;const p=f.a.x;return p<=g.left+et||p>=g.right-et?!1:Wt(f.a.y,f.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),i=d((f,g)=>{if(!f.horizontal)return!1;const p=f.a.y;return p<=g.top+et||p>=g.bottom-et?!1:Wt(f.a.x,f.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let c=0;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(const p of at(g))for(const M of a)if(r(p,M.rect))c=Math.max(c,M.rect.right-p.a.x+4);else if(i(p,M.rect)){const u=Math.min(p.a.x,p.b.x);c=Math.max(c,M.rect.right-u+4)}}if(!(c<=et))for(const f of a){const g=f.node.x,p=f.node.width;typeof g!="number"||typeof p!="number"||!Number.isFinite(g)||!Number.isFinite(p)||p<=0||(f.node.x=g-c/2,f.node.width=p+c,f.node.groupTitleRect={...f.rect,left:f.rect.left-c,right:f.rect.right-c})}}d(jn,"shiftLeftLaneTitleBandsLeftOfRails");function Ls(t,e){const{realNodeRects:o}=Me(e.values()),s=t.filter(h=>!h.isLayoutOnly),r=d((h,l=new Map)=>xt(l.get(h)??h.points??[]),"replacementPointsFor"),i=d((h=new Map)=>{let l=0;for(let x=0;xs.reduce((l,x)=>l+oe(r(x,h)),0),"totalBends"),c=d(h=>{const l=r(h);if(l.length<4)return;const x=l[l.length-2],C=l[l.length-1];if(!(!Nt(x,C,et)&&!Ot(x,C,et)))return{tailStart:x,terminal:C}},"terminalTailFor"),f=d((h,l)=>{const x=r(h);if(x.length<3)return;const C=x[0],b=x[1];let v;if(Nt(C,b,et))v={x:b.x,y:l.tailStart.y};else if(Ot(C,b,et))v={x:l.tailStart.x,y:b.y};else return;const L=ue(xt([C,b,v,l.tailStart,l.terminal]));return at(L).length===L.length-1?L:void 0},"candidateWithDestinationTail"),g=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);for(const C of at(l))if(Pt(C.a,C.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),p=d((h,l,x)=>{for(const C of s)if(C!==h){for(const b of at(l))for(const v of at(r(C,x)))if(de(b,v,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),M=d((h,l,x)=>!g(h,l)&&!p(h,l,x),"candidateIsSafe"),u=d(()=>{const h=new Map;for(const l of s){const x=l.end;if(!x||!e.has(x)||r(l).length<4)continue;const b=h.get(x)??[];b.push(l),h.set(x,b)}return h},"edgesByDestination");for(let h=0;h<4;h++){const l=i();if(l===0)return;const x=a();let C,b=l,v=x;for(const L of u().values())for(let y=0;y=l||G>b||G===b&&j>=v||(C=P,b=G,v=j)}if(!C)return;for(const[L,y]of C)L.points=y}}d(Ls,"swapDestinationTerminalTailsToReduceCrossings");function Es(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(L=>!L.isLayoutOnly),c=d((L,y=new Map)=>xt(y.get(L)??L.points??[]),"replacementPointsFor"),f=d((L=new Map)=>{let y=0;for(let I=0;Ia.reduce((y,I)=>y+oe(c(I,L)),0),"totalBends"),p=d(L=>{const y=L.start,I=L.end,E=y?e.get(y):void 0,A=I?e.get(I):void 0,B=E?te(E):void 0,O=A?te(A):void 0;return B&&O?{src:B,dst:O}:void 0},"endpointRectsFor"),M=d((L,y,I)=>{if(I.index<=0||I.index+1>=y.length-1)return;const E=p(L);if(E){if(I.vertical){const A=I.a.x,B=Math.min(E.src.left,E.dst.left),O=Math.max(E.src.right,E.dst.right),k=AO+et?"right":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"vertical",side:k,coord:A,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const A=I.a.y,B=Math.min(E.src.top,E.dst.top),O=Math.max(E.src.bottom,E.dst.bottom),k=AO+et?"bottom":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"horizontal",side:k,coord:A,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const L=[];for(const y of a){const I=c(y);for(const E of at(I)){const A=M(y,I,E);A&&L.push(A)}}return L},"collectExternalRails"),h=d((L,y)=>L.edge!==y.edge&&L.axis===y.axis&&L.side===y.side&&Wt(L.min,L.max,y.min,y.max)>=Xt,"railsInteract"),l=d(L=>{const y=[],I=new Set;for(const E of L){if(I.has(E))continue;const A=[E],B=[];for(I.add(E);A.length>0;){const O=A.pop();B.push(O);for(const k of L)!I.has(k)&&h(O,k)&&(I.add(k),A.push(k))}B.length>1&&y.push(B)}return y},"connectedComponents"),x=d(L=>{const y=[];for(const I of L)y.some(E=>Math.abs(E-I.coord){const y=L.map(A=>A.coord),I=x(L),E=[];if(L.length<=6){const A=new Array(I.length).fill(!1),B=[],O=d(()=>{if(B.length===L.length){B.some((k,H)=>Math.abs(k-y[H])>=et)&&E.push([...B]);return}for(const[k,H]of I.entries())A[k]||(A[k]=!0,B.push(H),O(),B.pop(),A[k]=!1)},"visit");return O(),E}for(let A=0;A{const I=new Map;for(const[A,B]of L.entries()){const O=y[A],k=I.get(B.edge)??B.points.map(H=>({x:H.x,y:H.y}));B.axis==="vertical"?(k[B.segmentIndex].x=O,k[B.segmentIndex+1].x=O):(k[B.segmentIndex].y=O,k[B.segmentIndex+1].y=O),I.set(B.edge,k)}const E=new Map;for(const[A,B]of I){const O=ue(xt(B));if(at(O).length!==O.length-1)return;E.set(A,O)}return E},"replacementsForAssignment"),v=d(L=>{for(const[y,I]of L){const E=[y.start,y.end].filter(A=>!!A);for(const A of at(I))if(Pt(A.a,A.b,r,E,-2)||Pt(A.a,A.b,i,[],-2))return!1}for(let y=0;y=Xt)return!1}}return!0},"candidateIsSafe");for(let L=0;L<4;L++){const y=f();if(y===0)return;let I,E=y,A=g(),B=Number.POSITIVE_INFINITY;for(const O of l(u()))for(const k of C(O)){const H=b(O,k);if(!H||!v(H))continue;const P=f(H);if(P>=y)continue;const G=g(H),j=O.reduce((tt,ft,Mt)=>tt+Math.abs(k[Mt]-ft.coord),0);P>E||P===E&&(G>A||G===A&&j>=B)||(I=H,E=P,A=G,B=j)}if(!I)return;for(const[O,k]of I)O.points=k}}d(Es,"reassignCrossingExternalRailChannels");function Ts(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,h,l)=>xt(u===h?l??[]:u.points??[]),"pointsFor"),a=d(u=>at(u).reduce((h,l)=>{const x=l.a.x-l.b.x,C=l.a.y-l.b.y;return h+Math.hypot(x,C)},0),"pathLength"),c=d((u,h)=>{let l=0;for(let x=0;x{if(u.horizontal){const l=u.a.y;return(Math.abs(l-h.top)<1||Math.abs(l-h.bottom)<1)&&Wt(u.a.x,u.b.x,h.left,h.right)>=Xt}if(u.vertical){const l=u.a.x;return(Math.abs(l-h.left)<1||Math.abs(l-h.right)<1)&&Wt(u.a.y,u.b.y,h.top,h.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const h=[u.start,u.end].filter(x=>!!x),l=[];for(const x of h){const C=e.get(x),b=C?te(C):void 0;b&&l.push(b)}return l},"endpointRectsFor"),p=d((u,h)=>{if(h+3>=u.length)return[];const l=u[h],x=u[h+1],C=u[h+2],b=u[h+3],v=Nt(l,x,et)&&Ot(x,C,et)&&Nt(C,b,et),L=Ot(l,x,et)&&Nt(x,C,et)&&Ot(C,b,et);if(!v&&!L)return[];if(!(v?Math.sign(x.x-l.x)!==Math.sign(b.x-C.x):Math.sign(x.y-l.y)!==Math.sign(b.y-C.y)))return[];const I=gt(l,b,et)||yt(l,b,et)?[]:[{x:l.x,y:b.y},{x:b.x,y:l.y}],E=I.length===0?[[...u.slice(0,h+1),...u.slice(h+3)]]:I.map(B=>[...u.slice(0,h+1),B,...u.slice(h+3)]),A=new Set;return E.map(B=>ue(xt(B))).filter(B=>{if(at(B).length!==B.length-1||!B.some(k=>ce(k,b,et)))return!1;const O=B.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return A.has(O)?!1:(A.add(O),!0)})},"shortcutCandidatesAt"),M=d((u,h,l)=>{const x=[u.start,u.end].filter(b=>!!b),C=g(u);for(const b of at(h))if(Pt(b.a,b.b,o,x,-2)||Pt(b.a,b.b,s,[],-2)||C.some(v=>f(b,v)))return!1;for(const b of r)if(b!==u){for(const v of at(h))for(const L of at(i(b)))if(de(v,L,.5)>=Xt)return!1}return c(u,h)<=l},"candidateIsSafe");for(let u=0;u<8;u++){const h=c();let l,x,C=h,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const L of r){const y=i(L),I=oe(y,et),E=a(y);for(let A=0;A<=y.length-4;A++)for(const B of p(y,A)){const O=oe(B,et),k=a(B);if(!(OC||P===C&&(O>b||O===b&&k>=v)||(l=L,x=B,C=P,b=O,v=k)}}if(!l||!x)return;l.points=x}}d(Ts,"shortcutRedundantOrthogonalJogs");function ws(t,e){const i=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const _=R.x??0,F=R.y??0,V=te(R);V&&i.push({id:String(R.id??""),cx:_,cy:F,rect:V})}if(i.length===0)return;const a=new Map(i.map(R=>[R.id,R])),c=i.map(R=>({id:R.id,rect:R.rect})),f=["top","bottom","left","right"],g={top:Math.min(...i.map(R=>R.rect.top))-20,bottom:Math.max(...i.map(R=>R.rect.bottom))+20,left:Math.min(...i.map(R=>R.rect.left))-20,right:Math.max(...i.map(R=>R.rect.right))+20},p=t.filter(R=>!R.isLayoutOnly),M=new Map(p.map((R,_)=>[R,_])),u=d(R=>{const _=R==="left"||R==="top"?-1:1,F=[];for(let V=0;V<=2;V++)F.push(g[R]+_*20*V);return F},"outwardTracksForSide"),h=d((R,_=new Map)=>xt(_.get(R)??R.points??[]),"replacementPointsFor"),l=d((R,_)=>{let F=0;for(const V of R)for(const K of _)he(V.a,V.b,K.a,K.b,et)&&F++;return F},"crossingCountBetweenSegments"),x=d((R,_)=>l(at(R),at(_)),"crossingCountBetweenPaths"),C=d((R=new Map)=>{let _=0;const F=[],V=new Set,K=[],Z=d(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y0&&(_+=T,F.push({first:q,second:w,count:T}),Z(q),Z(w))}}return K.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),{count:_,pairs:F,edgeSet:V,edges:K}},"crossingSnapshot"),b=d((R,_)=>{const F=new Set(_.keys());if(F.size===0)return R.count;let V=0;for(const Z of R.pairs)(F.has(Z.first)||F.has(Z.second))&&(V+=Z.count);let K=0;for(let Z=0;Z{const _=new Map;for(const K of R.pairs){const Z=_.get(K.first)??new Set;Z.add(K.second),_.set(K.first,Z);const Y=_.get(K.second)??new Set;Y.add(K.first),_.set(K.second,Y)}const F=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const Z=[K],Y=[];for(V.add(K);Z.length>0;){const q=Z.pop();Y.push(q);for(const m of _.get(q)??[])V.has(m)||(V.add(m),Z.push(m))}Y.sort((q,m)=>(M.get(q)??0)-(M.get(m)??0)),Y.length>1&&F.push(Y)}return F},"crossingComponents"),L=d(R=>[R.start,R.end].filter(_=>!!_),"endpointIdsFor"),y=d(R=>{const _=[];for(const F of v(R)){const V=new Set(F),K=new Set(F.flatMap(Y=>L(Y))),Z=[...F];for(const Y of p)V.has(Y)||L(Y).some(q=>K.has(q))&&Z.push(Y);Z.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),_.push(Z)}return _},"pairSearchGroups"),I=d((R,_,F)=>b(R,new Map([[_,F]])),"crossingCountWithSingleReplacement"),E=d(R=>{const _=new Map;for(const F of R.pairs)_.set(F.first,(_.get(F.first)??0)+F.count),_.set(F.second,(_.get(F.second)??0)+F.count);return _},"currentCrossingsByEdge"),A=d(R=>R.slice(1).reduce((_,F,V)=>{const K=R[V];return _+Math.abs(F.x-K.x)+Math.abs(F.y-K.y)},0),"pathLength"),B=d((R=new Map)=>p.reduce((_,F)=>_+oe(h(F,R)),0),"totalBends"),O=d((R=new Map)=>p.reduce((_,F)=>_+A(h(F,R)),0),"totalLength"),k=d((R,_,F=new Map)=>{const V=at(_);for(const K of p)if(K!==R){for(const Z of V)for(const Y of at(h(K,F)))if(de(Z,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),H=d((R,_)=>{const F=[R.start,R.end].filter(V=>!!V);for(const V of at(_))if(Pt(V.a,V.b,c,F,-2))return!0;return!1},"pathHitsNode"),P=d((R,_)=>{const F=ue(xt(_));at(F).length===F.length-1&&R.push(F)},"pushOrthogonalCandidate"),G=d(R=>R==="left"||R==="right","sideIsHorizontal"),j=d((R,_,F)=>{switch(_){case"left":return Math.min(R.x,F.x)-20;case"right":return Math.max(R.x,F.x)+20;case"top":return Math.min(R.y,F.y)-20;case"bottom":return Math.max(R.y,F.y)+20}},"localTrackForSameSide"),tt=d((R,_,F,V)=>{const K=F==="left"||F==="top"?-1:1,Z=[j(_,F,V),g[F]];for(const Y of Z)for(let q=0;q<=2;q++)P(R,ho(_,F,V,Y+K*20*q))},"addSameSideCandidates"),ft=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:Z,y:_.y},{x:Z,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),Mt=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:_.x,y:Z},{x:Y,y:Z},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Ht=d((R,_,F,V,K)=>{const Z=[...u("top"),...u("bottom")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:Y,y:_.y},{x:Y,y:m},{x:q,y:m},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),Ft=d((R,_,F,V,K)=>{const Z=[...u("left"),...u("right")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:_.x,y:Y},{x:m,y:Y},{x:m,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=d(R=>{const _=new Set;return R.map(F=>xt(F)).filter(F=>{const V=F.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return _.has(V)||F.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),J=d((R,_,F,V)=>{const K=[],Z=uo(R,_,F,V,20,et);Z&&P(K,Z),_===V&&tt(K,R,_,F);const Y=G(_),q=G(V);return Y&&!q?ft(K,R,_,F,V):!Y&&q?Mt(K,R,_,F,V):Y?Ht(K,R,_,F,V):Ft(K,R,_,F,V),nt(K)},"buildCandidatesForSides"),rt=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="top"||Y==="bottom"?u(Y):Z;for(const S of K){P(R,[_,F,{x:S,y:F.y},{x:S,y:q.y},q]);for(const w of m)P(R,[_,F,{x:S,y:F.y},{x:S,y:w},{x:q.x,y:w},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="left"||Y==="right"?u(Y):K;for(const S of Z){P(R,[_,F,{x:F.x,y:S},{x:q.x,y:S},q]);for(const w of m)P(R,[_,F,{x:F.x,y:S},{x:w,y:S},{x:w,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=d(R=>{const _=R.start,F=R.end,V=F?a.get(F):void 0;if(!_||!V)return[];const K=xt(R.points??[]);if(K.length<4)return[];const Z=K[0],Y=K[1],q=[];return Ot(Z,Y,et)?rt(q,Z,Y,V):Nt(Z,Y,et)&&ut(q,Z,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=d(R=>{const _=R.start,F=R.end,V=_?a.get(_):void 0,K=F?a.get(F):void 0;if(!V||!K)return[];const Z=[];for(const Y of f){const q=Le(V,Y);for(const m of f)Z.push(...J(q,Y,Le(K,m),m))}return Z.push(...pt(R)),Z},"candidatePathsFor"),wt=d(()=>new Map(p.map(R=>[R,at(h(R))])),"currentSegmentsByEdge"),Kt=d((R,_,F)=>{const V=new Set;for(const K of p){if(K===R)continue;const Z=F.get(K)??at(h(K));_.some(Y=>Z.some(q=>de(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=d((R,_,F,V)=>{const K=new Set;return St(R).map(Y=>ue(xt(Y))).filter(Y=>{if(H(R,Y))return!1;const q=Y.map(m=>`${m.x.toFixed(3)},${m.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let m=0;for(const S of p)S!==R&&(m+=l(q,F.get(S)??at(h(S))));return{candidate:Y,candidateSegments:q,crossings:_.count-(V.get(R)??0)+m,bends:oe(Y,et),totalBends:oe(Y),length:A(Y)}}).filter(({crossings:Y})=>Y<=_.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,F),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Jt=d((R,_,F,V,K,Z)=>{let Y=0;for(const m of R.pairs)(m.first===_||m.second===_||m.first===V||m.second===V)&&(Y+=m.count);let q=l(F.segments,K.segments);for(const m of p){if(m===_||m===V)continue;const S=Z.get(m)??at(h(m));q+=l(F.segments,S)+l(K.segments,S)}return R.count-Y+q},"pairCrossingCount"),se=d((R,_)=>{for(const F of R.sharedTrackConflicts)if(F!==_)return!1;return!0},"conflictsOnlyWith"),Ee=d((R,_)=>R.segments.some(F=>_.segments.some(V=>de(F,V,.5)>=Xt)),"candidatesShareTrack"),me=d((R,_,F,V)=>se(_,F.edge)&&se(V,R.edge)&&!Ee(_,V),"pairCandidatesAreCompatible"),Te=d((R,_,F,V,K)=>{const Z=Jt(R.current,_.edge,F,V.edge,K,R.baseSegments);if(!(Z>=R.current.count))return{replacements:new Map([[_.edge,F.path],[V.edge,K.path]]),crossings:Z,bends:R.currentBends-(R.baseBendsByEdge.get(_.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+F.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(_.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+F.length+K.length}},"scorePairReplacement"),mn=d((R,_)=>R.crossings<_.crossings||R.crossings===_.crossings&&(R.bends<_.bends||R.bends===_.bends&&R.length<_.length),"pairScoreIsBetter"),yn=d((R,_,F,V)=>{let K=V;for(const Z of _.candidates)for(const Y of F.candidates){if(!me(_,Z,F,Y))continue;const q=Te(R,_,Z,F,Y);q&&mn(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),pn=d(R=>{const _=B(),F=O(),V=wt(),K=E(R),Z=new Map(p.map(T=>[T,oe(h(T))])),Y=new Map(p.map(T=>[T,A(h(T))])),q=new Map,m=y(R);for(const T of m)for(const N of T){if(q.has(N))continue;const D=qt(N,R,V,K);D.length>0&&q.set(N,{edge:N,candidates:D})}let S={replacements:new Map,crossings:R.count,bends:_,length:F};const w={current:R,currentBends:_,currentLength:F,baseBendsByEdge:Z,baseLengthByEdge:Y,baseSegments:V};for(const T of m){const N=new Set(T.filter(W=>R.edgeSet.has(W))),D=T.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W0?S.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const _=C(),F=_.count;if(F===0)return;let V,K,Z=F,Y=Number.POSITIVE_INFINITY;for(const m of _.edges){const S=oe(h(m),et);for(const w of St(m)){const T=H(m,w),N=!T&&k(m,w),D=I(_,m,w),W=oe(w,et);T||N||!(DZ||D===Z&&W>=Y||(V=m,K=w,Z=D,Y=W)}}if(V&&K){V.points=K;continue}const q=pn(_);if(!q)return;for(const[m,S]of q)m.points=S}}d(ws,"resolveRenderedOrthogonalCrossings");var be=.001,Zr=8;function As(t,e){const{nodeInfoById:n,realNodeRects:o}=un(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(l=>l.rect.top))-r,bottom:Math.max(...o.map(l=>l.rect.bottom))+r,left:Math.min(...o.map(l=>l.rect.left))-r,right:Math.max(...o.map(l=>l.rect.right))+r},a=d((l,x,C,b)=>{const v=[],L=uo(l,x,C,b,r,be);return L&&v.push(L),x===b&&v.push(ho(l,x,C,i[x])),v},"buildOrthogonalPathCandidates"),c=d((l,x)=>{for(let C=0;C{let b=0;const v=Be(l,be),L=x.start,y=x.end;for(const I of t){if(I===x||I.isLayoutOnly)continue;const E=I.start,A=I.end;if(!C&&L&&y&&(E===L||E===y||A===L||A===y))continue;const B=I.points;if(!(!B||B.length<2))for(const O of v)for(const k of Be(B,be)){if(mo(O.a,O.b,k.a,k.b,be,be)){b++;continue}de(O,k,be)>=Zr&&b++}}return b},"pathConflictCount"),g=4,p=d((l,x)=>{const C=Math.abs(l.y-x.rect.top),b=Math.abs(l.y-x.rect.bottom),v=Math.abs(l.x-x.rect.left),L=Math.abs(l.x-x.rect.right);let y="top",I=C;return b{const b=M.get(l)??[];b.push({side:x,edgeId:C}),M.set(l,b)},"addFaceClaim");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points??[];if(x.length<1)continue;const C=l.id??"",b=l.start,v=l.end;if(b){const L=n.get(b);L&&u(b,p(x[0],L),C)}if(v){const L=n.get(v);L&&u(v,p(x[x.length-1],L),C)}}const h=d((l,x,C)=>{var b;return((b=M.get(l))==null?void 0:b.some(v=>v.edgeId!==C&&v.side===x))??!1},"faceIsClaimed");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points;if(!x||x.length<2)continue;const C=oe(x,be);if(C0){const Mt=f(tt,l,!0);if(Mt>O||Mt===O&&ft>=k)continue;O=Mt,k=ft,B=tt;continue}f(tt,l)>A||ftG.edgeId!==I));const P=M.get(v);P&&M.set(v,P.filter(G=>G.edgeId!==I)),u(b,p(B[0],L),I),u(v,p(B[B.length-1],y),I)}}}d(As,"simplifyDetouredEdges");var Qt=.001,Fo=10,Ke=7;function Un(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,a=r.y-s.y;if(!(Math.abs(i)+Math.abs(a)r&&en(t,Rs(r)))}d(Wn,"labelOverlapsOwnMarker");function Je(t,e){const n=[];for(const h of t){if(h.isLayoutOnly)continue;const l=h.points;if(!(!l||l.length<2))for(let x=0;x{const x=Nn(l,r);for(const{nodeId:C,rect:b}of o)if(C!==h&&en(x,b))return!0;return!1},"labelOverlapsForeignNode"),f=d((h,l)=>{const x=Nn(l,r);for(const C of n)if(C.edgeId!==h&&dn(C.p1,C.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),g=d((h,l,x)=>c(h,x)||f(l,x),"labelOverlapsAnything"),p=[],M=d(h=>{for(const{id:l,rect:x}of s)if(ss(x,h))return l},"findContainingLane"),u=d((h,l)=>p.some(x=>x.labelId!==h&&en(l,x.rect)),"overlapsPlacedLabel");for(const h of t){if(h.isLayoutOnly)continue;const l=h.labelNodeId;if(!l)continue;const x=e.get(l);if(!x)continue;const C=h.points;if(!C||C.length<2)continue;const b=x.width??0,v=x.height??0;if(b<=0||v<=0)continue;const L=[];for(let nt=0;nt=Qt&&pt>=Qt||L.push({idx:nt,length:ut+pt,orientation:ut>=Qt?"horizontal":"vertical",midX:(J.x+rt.x)/2,midY:(J.y+rt.y)/2})}if(L.length===0)continue;const y=L.length>=3?L.filter(nt=>nt.idx>0&&nt.idx0?y:L,E=b>=v?"horizontal":"vertical",A=d(nt=>[...nt].sort((J,rt)=>{const ut=J.orientation===E,pt=rt.orientation===E;if(ut!==pt)return ut?-1:1;const St=J.length>=(J.orientation==="horizontal"?b:v)+2,wt=rt.length>=(rt.orientation==="horizontal"?b:v)+2;return St!==wt?St?-1:1:rt.length-J.length}),"rankSegments"),B=L[0],O=L[L.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((nt,J)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*J,midY:rt.y+(ut.y-rt.y)*J}},"anchorAtT"),P=d((nt,J,rt)=>Math.min(rt,Math.max(J,nt)),"clamp"),G=d((nt,J)=>nt.midX>=J.left-Qt&&nt.midX<=J.right+Qt&&nt.midY>=J.top-Qt&&nt.midY<=J.bottom+Qt,"pointInsideRectInclusive"),j=d(nt=>{const J=Pe(nt.midX,nt.midY,b,v),rt=M(J);if(rt)return{laneId:rt,anchor:nt,rect:J};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const pt=ut.rect.left+b/2+i,St=ut.rect.right-b/2-i,wt=ut.rect.top+v/2+i,Kt=ut.rect.bottom-v/2-i;if(pt>St||wt>Kt)return;const qt={midX:P(nt.midX,pt,St),midY:P(nt.midY,wt,Kt)},Jt=Pe(qt.midX,qt.midY,b,v);return G(nt,Jt)?{laneId:ut.id,anchor:qt,rect:Jt}:void 0},"placementForAnchor"),tt=d((nt,J,rt)=>nt.orientation==="horizontal"?Math.abs(J.midX-rt.x):Math.abs(J.midY-rt.y),"distanceAlongSegment"),ft=d((nt,J)=>{const ut=(nt.orientation==="horizontal"?b/2:v/2)+a;if(nt===B){const pt=C[nt.idx];if(tt(nt,J,pt)+Qt{const J=A(nt);for(const rt of J)for(const ut of k){const pt=H(rt,ut);if(!ft(rt,pt))continue;const St=j(pt);if(St&&!Wn(St.rect,C)&&!u(l,St.rect)&&!g(l,h.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Ht=d((nt,J,rt=!1)=>{const ut=A(nt);for(const pt of ut){const St={midX:pt.midX,midY:pt.midY};if(J&&!ft(pt,St))continue;const wt=j(St);if(wt&&!Wn(wt.rect,C)&&!u(l,wt.rect)&&!c(l,wt.rect)&&(rt||!f(h.id,wt.rect)))return{laneId:wt.laneId,anchor:wt.anchor}}},"findLaneContainingFallback"),Ft=Mt(I)??(I.lengthrt.labelId===l);J>=0?p[J]={labelId:l,rect:nt}:p.push({labelId:l,rect:nt})}}}d(Je,"anchorLabelsToPolyline");var En=1e-6,Qr=8,Do=Qr/2,ti=3;function Kn(t,e){return t{const g=Kn(a,c);let p=0;const M=d(u=>{if(!u)return;const h=s.get(u);if(!h)return;const l=f==="x"?h.w/2:h.h/2;l>p&&(p=l)},"consider");M(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const h=u.start,l=u.end;!h||!l||Kn(h,l)===g&&M(u.labelNodeId)}return p>0?p+ti:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const a=i.points;if(!lo(a,En))continue;const c=go(i,n,En);if(!c)continue;const{srcId:f,dstId:g,srcInfo:p,dstInfo:M,collinearX:u,collinearY:h}=c;if(u===h)continue;let l,x;if(u){const y=M.cy>p.cy;l={x:p.cx,y:y?p.rect.bottom:p.rect.top},x={x:M.cx,y:y?M.rect.top:M.rect.bottom}}else{const y=M.cx>p.cx;l={x:y?p.rect.right:p.rect.left,y:p.cy},x={x:y?M.rect.left:M.rect.right,y:M.cy}}if(Pt(l,x,o,[f,g],1))continue;const b=r(i,f,g,u?"x":"y"),v=b>Do?b:Do,L=[0,v,-v];for(const y of L){const I={...l},E={...x};if(u){if(I.x+=y,E.x+=y,I.x<=p.rect.left||I.x>=p.rect.right||E.x<=M.rect.left||E.x>=M.rect.right)continue}else if(I.y+=y,E.y+=y,I.y<=p.rect.top||I.y>=p.rect.bottom||E.y<=M.rect.top||E.y>=M.rect.bottom)continue;if(!Pt(I,E,o,[f,g],1)&&!nn(I,E,t,i,{epsilon:En})){i.points=[I,E];break}}}}d(Ns,"straightenCollinearSiblingDetours");function qn(t,e){const{realNodeRects:c,labelNodeRects:f}=Me(e.values()),g=d((y,I)=>Be(I,.001).map(E=>({...E,edge:y,interior:E.index>=1&&E.index<=I.length-3})),"segmentsFor"),p=d(()=>{const y=[];for(const I of t){if(I.isLayoutOnly)continue;const E=I.points;!E||E.length<2||y.push(...g(I,xt(E)))}return y},"allSegments"),M=d((y,I)=>y.horizontal&&I.horizontal?Wt(y.a.x,y.b.x,I.a.x,I.b.x)>=8&&Math.abs(y.a.y-I.a.y)<7:y.vertical&&I.vertical?Wt(y.a.y,y.b.y,I.a.y,I.b.y)>=8&&Math.abs(y.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((y,I)=>{const E=y.start,A=y.end,B=g(y,I);if(B.length!==I.length-1)return!1;const O=[E,A].filter(H=>!!H),k=y.labelNodeId?[y.labelNodeId]:[];for(const H of B)if(Pt(H.a,H.b,c,O,-2)||Pt(H.a,H.b,f,k,-2))return!1;for(const H of t){if(H===y||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of B)for(const j of g(H,xt(P)))if(M(G,j)||he(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),h=d((y,I)=>{const E=xt(y.edge.points??[]);if(E.length<4||y.index>=E.length-1)return;const A=E.map(B=>({...B}));if(y.horizontal)A[y.index].y+=I,A[y.index+1].y+=I;else if(y.vertical)A[y.index].x+=I,A[y.index+1].x+=I;else return;return g(y.edge,A).length===A.length-1?A:void 0},"shiftedCandidate"),l=d((y,I)=>({x:y.x??(I.left+I.right)/2,y:y.y??(I.top+I.bottom)/2}),"nodeCenter"),x=d(y=>{const I=y.edge,E=xt(I.points??[]);if(E.length!==4||y.index!==1)return;const A=I.start?e.get(I.start):void 0,B=I.end?e.get(I.end):void 0,O=A?te(A):void 0,k=B?te(B):void 0,H=E.slice(y.index+2);if(!(!A||!B||!O||!k||H.length===0))return{sourceCenter:l(A,O),targetCenter:l(B,k),sourceRect:O,tail:H}},"sourceDetourContextFor"),C=d((y,I,E,A,B,O)=>{const k=A.y>=E.y,H=k?B.bottom:B.top,P=H+(k?20:-20);if(k&&y.b.y<=P+.001||!k&&y.b.y>=P-.001)return;const G=y.a.x+I;return xt([{x:E.x,y:H},{x:E.x,y:P},{x:G,y:P},{x:G,y:y.b.y},...O],.001)},"verticalSourceDetour"),b=d((y,I,E,A,B,O)=>{const k=A.x>=E.x,H=k?B.right:B.left,P=H+(k?20:-20);if(k&&y.b.x<=P+.001||!k&&y.b.x>=P-.001)return;const G=y.a.y+I;return xt([{x:H,y:E.y},{x:P,y:E.y},{x:P,y:G},{x:y.b.x,y:G},...O],.001)},"horizontalSourceDetour"),v=d((y,I)=>{const E=x(y);if(E){if(y.vertical)return C(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(y.horizontal)return b(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),L=[-7,7,-2*7,2*7,-3*7,3*7];for(let y=0;y<12;y++){const I=p();let E=!1;for(let A=0;AP.interior);for(const P of H){for(const G of L){const j=h(P,G);if(j&&u(P.edge,j)){P.edge.points=j,E=!0;break}const tt=v(P,G);if(tt&&u(P.edge,tt)){P.edge.points=tt,E=!0;break}}if(E)break}}if(!E)return}}d(qn,"nudgeSharedInteriorSubpaths");function Os(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=s*a-r*i;if(Math.abs(c)<1e-10)return!1;const f=n.x-t.x,g=n.y-t.y,p=(f*a-g*i)/c,M=(f*r-g*s)/c,u=.01;return p>u&&p<1-u&&M>u&&M<1-u}d(Os,"segmentsIntersect");function Ps(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=rs(e),r=[];for(const a of n){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<2)continue;const f=a.start,g=a.end,p=a.labelNodeId,M=a.id??`${f}->${g}`;for(const u of s)if(!(u.nodeId===f||u.nodeId===g)&&!(p&&u.nodeId===p)){for(let h=0;h0){const a=o.filter(f=>f.type==="edge-node-overlap").length,c=o.filter(f=>f.type==="edge-edge-crossing").length;Qe.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${a} edge-node overlap(s), ${c} edge crossing(s)`);for(const f of o)Qe.warn(`[SWIMLANE_VALIDATE] ${f.type}: ${f.detail}`)}return o}d(Ps,"validateSwimlanesLayout");function Bs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Ms(t,e)||e==="BT"&&s.length>0&&!bs(t))return;for(const a of o){if(a.isLayoutOnly)continue;const c=a.points;!c||c.length<2||(a.points=ue(on(c)))}As(o,n),Ns(o,n),Is(o,n);const r=new Map;for(const a of n)r.set(String(a.id),a);Je(o,r),fs(o,r),Ss(o,r),qn(o,r),Cs(o,r),vs(o,r),zn(o,r),Ls(o,r);const i=d(()=>{ws(o,r),Es(o,r),Ts(o,r),Je(o,r),Gn(o,r),zn(o,r),Je(o,r),Gn(o,r)},"finalizeRenderedEdges");i(),qn(o,r),i(),Vn(o,r),jn(o,r),Vn(o,r),jn(o,r)}d(Bs,"postProcessSwimlaneLayout");function Ie(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(Ie,"normalizeGraph");function Mo(t,e){return t.edges.filter(n=>n.dst===e)}d(Mo,"incoming");function ks(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(ks,"buildSuccessorMap");function Io(t){const e=ks(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(Io,"buildSortedSuccessorMap");function So(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(So,"buildInDegreeMap");function Co(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(Co,"sortedZeroInDegreeNodes");function hn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(hn,"buildPredecessorSuccessorMaps");function vo(t,e,n,o){var i,a;let s=0;for(const c of t.nodes)o!=null&&o.skipGroups&&((i=t.nodeById.get(c))!=null&&i.isGroup)||(s=Math.max(s,n[c]??0));const r=Array.from({length:s+1},()=>[]);for(const c of e)o!=null&&o.skipGroups&&((a=t.nodeById.get(c))!=null&&a.isGroup)||r[Math.max(0,n[c]??0)].push(c);return r}d(vo,"buildLayersFromRanks");function De(t){const e=So(t),n=Co(e),o=[],s=Io(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let a=0;for(;a{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),a=o,c=r,f=o;for(;a=s||ap.dst===M.dst?p.id.localeCompare(M.id):p.dst.localeCompare(M.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const p of n.get(g)??[]){const M=p.dst;o[M]===0?r(M):o[M]===1&&s.push(p)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,p)=>g.localeCompare(p));for(const g of i)o[g]===0&&r(g);const a=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),c=e.edges.map(g=>a.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:c,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(_s,"removeCycles_DFS");function Fs(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const a=n(r)??r;return e.set(o,a),a},"resolve");for(const o of t.nodes)n(o);return e}d(Fs,"buildTopLaneMap");function ge(t){const e=Fs(t);return n=>e.get(n)??null}d(ge,"createTopLaneResolver");function gn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(gn,"buildTopLaneOrder");function Eo(t,e){const n=gn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(Eo,"resolveTopLaneOrder");var ei={EPSILON:1e-6},ln={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Ho={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Ds(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=hn(n);for(const y of r.values())y.sort((I,E)=>I.localeCompare(E));const i=De(n)??[...n.nodes].sort((y,I)=>y.localeCompare(I)),a=new Map;for(const[y,I]of i.entries())a.set(I,y);const c=new Map,f=new Map;for(const y of n.nodes)f.set(y,[]);for(const y of i){const I=(r.get(y)??[]).filter(E=>c.has(E));if(I.length>0){const E=Hs(y,I,{laneOf:o,rankHint:s,topoIndex:a});c.set(y,E),f.get(E).push(y)}else c.has(y)||c.set(y,null)}for(const y of n.nodes)c.has(y)||c.set(y,null);const g=new Set;for(const y of n.nodes)(c.get(y)??null)===null&&g.add(y);const p=[...g].sort((y,I)=>{const E=a.get(y)??0,A=a.get(I)??0;return E===A?y.localeCompare(I):E-A}),M=Xs(n),u=new Map;for(const[y,I]of M.entries())u.set(y,[...I].sort((E,A)=>E.localeCompare(A)));const h=Ys(u),l=Gs(u),x=new Map;for(const y of n.nodes)x.set(y,[]);for(const y of l)for(const I of y.nodes){const E=x.get(I);E?E.push(y.id):x.set(I,[y.id])}const C=[],b=[],v=new Set,L=d(y=>{if(!v.has(y)){v.add(y),C.push(y);for(const I of f.get(y)??[])L(I);b.push(y)}},"walk");for(const y of p)L(y);for(const y of i)L(y);return{parent:c,children:f,roots:p,componentOf:h,blocks:l,nodeBlocks:x,adjacency:u,preorder:C,postorder:b,topologicalOrder:i}}d(Ds,"buildDrivingTree");function Hs(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{var l,x;const a=n.laneOf(r),c=n.laneOf(i),f=a!=null&&a===o,g=c!=null&&c===o;if(f!==g)return f?-1:1;const p=(l=n.rankHint)==null?void 0:l[r],M=(x=n.rankHint)==null?void 0:x[i];if(p!=null&&M!=null&&p!==M)return M-p;const u=n.topoIndex.get(r)??0,h=n.topoIndex.get(i)??0;return u!==h?u-h:r.localeCompare(i)})[0]}d(Hs,"chooseParent");function Xs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Xs,"buildAdjacency");function Ys(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Ys,"assignComponents");function Gs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((a,c)=>{e.set(a,++r),n.set(a,r);for(const f of t.get(a)??[])f!==c&&(e.has(f)?(e.get(f)??0)<(e.get(a)??0)&&(o.push([a,f]),n.set(a,Math.min(n.get(a)??r,e.get(f)??r))):(o.push([a,f]),i(f,a),n.set(a,Math.min(n.get(a)??r,n.get(f)??r)),(n.get(f)??0)>=(e.get(a)??0)&&s.push($s(a,f,o,s.length))))},"visit");for(const a of t.keys())e.has(a)||i(a,null);return s}d(Gs,"computeBlocks");function $s(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d($s,"popBlock");function zs(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,v]of o.entries())s.set(v,b);const r=o.length,i=new Array(r).fill(-1),a=new Array(r).fill(0),c=[],f=new Set;for(const b of o){const v=n.parent.get(b)??null,L=s.get(b);L!=null&&v==null&&(i[L]=-1,a[L]=0,f.has(b)||(f.add(b),c.push(b)))}for(;c.length>0;){const b=c.shift(),v=s.get(b);if(v==null)continue;const L=n.children.get(b)??[];for(const y of L){if(f.has(y))continue;const I=s.get(y);I!=null&&(i[I]=v,a[I]=a[v]+1,f.add(y),c.push(y))}}for(const b of o){if(f.has(b))continue;const v=s.get(b);v!=null&&(i[v]=-1,a[v]=0,f.add(b))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),p=Array.from({length:g},()=>new Array(r).fill(-1));for(let b=0;b{if(b===-1||v===-1)return-1;a[b]>y&1&&(b=p[y][b],b===-1))return-1;if(b===v)return b;for(let y=g-1;y>=0;y--){const I=p[y][b],E=p[y][v];I===-1||E===-1||I!==E&&(b=I,v=E)}return p[0][b]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const b of t.edges){let v=b.src,L=b.dst,y=e[v],I=e[L];if(y==null||I==null||(y>I&&([v,L]=[L,v],[y,I]=[I,y]),y==null||I==null||y===I))continue;const E=s.get(v),A=s.get(L);if(E==null||A==null)continue;const B=M(E,A);if(B===-1)continue;const O=u[B];for(let k=y;k{if(v.size!==0)for(const[L,y]of v)b.set(L,(b.get(L)??0)+y)},"mergeInto"),x=new Set,C=d(b=>{const v=s.get(b);x.add(b);const L=v==null?void 0:u[v],y=L?new Map(L):new Map,I=n.children.get(b)??[];for(const E of I){const A=C(E),B=e[b];if(B!=null){let O=h.get(b);O||(O=new Map,h.set(b,O));let k=A.get(B)??0;const H=e[E];H!=null&&H>B&&(k+=1),O.set(E,k)}l(y,A)}return y},"dfs");for(const b of n.roots)x.has(b)||C(b);for(const b of o)x.has(b)||C(b);return h}d(zs,"computeSubtreeCrossCounts");function Vs(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const a=[...e.get(r)??[]];a.sort(To(n));for(const c of a){s(c);const f=o.get(c);f!=null&&(i=Math.min(i,f))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Vs,"annotateMinimumLayers");function To(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(To,"compareByRankThenId");function js(t,e,n,o){let s=0;for(const c of e){const f=n[c]??0;f>s&&(s=f)}const r=Array.from({length:s+1},()=>[]),i=new Set,a=d(c=>{if(i.has(c))return;i.add(c);const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c);for(const g of o(c))a(g)},"emit");for(const c of t)a(c);for(const c of e)if(!i.has(c)){const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c),i.add(c)}return r}d(js,"emitNodesInTreeOrder");function Us(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Us,"deduplicateLayers");function Ws(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,a=[],c=[],f=n.get(s);for(const g of r){const p=o.get(g)??i;p>i?a.push({child:g,min:p}):c.push(g)}return a.sort((g,p)=>g.min===p.min?g.child.localeCompare(p.child):g.min-p.min),c.sort((g,p)=>{const M=(f==null?void 0:f.get(g))??0,u=(f==null?void 0:f.get(p))??0;if(M!==u)return M-u;const h=o.get(g)??i,l=o.get(p)??i;return h!==l?h-l:g.localeCompare(p)}),[...a.map(g=>g.child),...c]}}d(Ws,"createChildOrderer");function fn(t,e,n){const o=Ds(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const p of t.nodes)s.has(p)||s.set(p,[]);const i=zs(t,e,o),a=[...r].sort(To(e)),c=Vs(a,s,e),f=Ws(s,e,i,c);let g=js(a,t.nodes,e,f);return g=Us(g),g}d(fn,"buildMultitreeLayerOrder");function Ks(t,e,n){const o=new Set(t),s=new Set(e),r=ke(e),i=[];for(const a of n)o.has(a.src)&&s.has(a.dst)&&i.push(r.get(a.dst));return Lo(i)}d(Ks,"countCrossingsBetweenAdjacent");function Jn(t,e,n){const o=[];for(const r of e){const i=n[r.src],a=n[r.dst];if(i==null||a==null||i===a)continue;let c=r.src,f=r.dst,g=i,p=a;i>a&&(c=r.dst,f=r.src,g=a,p=i);for(let M=g;M(n[M]??0)-(n[p]??0));for(const p of g){const M=n[p]??0;if(M===0)continue;let u=0;for(const C of o.get(p)??[])u=Math.max(u,(n[C]??0)+1);if(u>=M)continue;const h=M;n[p]=u;const l=fn(t,n,s),x=Jn(l,t.edges,n);x(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(l=>l.src===s);if(i.length===0)continue;let a=!1,c=0;for(const l of i){const x=n(l.dst);x==null||x===r?a=!0:c++}if(c===0||a)continue;let f=0,g=!1;for(const l of t.edges){if(l.dst!==s)continue;const x=n(l.src);x&&(x===r?g=!0:f++)}if(f>0||!g)continue;const p=e[s]??0,M=p+c;let u=0;for(const l of t.edges)l.dst===s&&(u=Math.max(u,(e[l.src]??0)+1));const h=Math.max(p,u,M);h!==p&&(e[s]=h)}}d(Js,"adjustCrossLaneSources");function Zs(t,e){const n=Ie(t),o=De(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=ge(n);let i=Object.create(null);for(const c of o){const f=Mo(n,c),g=e!=null&&e.ignoreCrossLaneEdges?f.filter(p=>{const M=r(p.src),u=r(c);return!M||!u?!0:M===u}):f;if(g.length===0)i[c]=0;else if(s&&g.length===1){const p=g[0].src,M=r(p),u=r(c);M!==u?i[c]=i[p]??0:i[c]=(i[p]??0)+1}else{let p=-1/0;for(const M of g)p=Math.max(p,(i[M.src]??0)+1);i[c]=p===-1/0?0:p}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(i=qs(n,i)),e!=null&&e.ignoreCrossLaneEdges&&Js(n,i),{layers:fn(n,i,r),rankOf:i,dummy:new Set}}d(Zs,"assignLayers_LongestPath");function Qs(t,e){const n=Ie(t),s={...Zs(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=ge(n),{preds:i,succs:a}=hn(n,h=>{if(e!=null&&e.ignoreCrossLaneEdges){const l=r(h.src),x=r(h.dst);if(l&&x&&l!==x)return!1}return!0}),c=De(n)??[...n.nodes],f=[...c].reverse(),g=d((h,l)=>{let x=0;for(const v of i.get(h)??[])x=Math.max(x,(s[v]??0)+1);let C=Number.POSITIVE_INFINITY;const b=a.get(h)??[];return b.length>0&&(C=Math.min(...b.map(v=>(s[v]??0)-1))),Number.isFinite(C)||(C=Math.max(x,l)),Math.min(Math.max(l,x),C)},"clampFeasible"),p=ln.GRAVITY_ITERATIONS,M=d(h=>{let l=!1;for(const x of h){const C=i.get(x)??[],b=a.get(x)??[];if(C.length===0&&b.length===0)continue;const v=C.length>0?C.reduce((E,A)=>E+(s[A]??0)+1,0)/C.length:s[x]??0,L=b.length>0?b.reduce((E,A)=>E+(s[A]??0)-1,0)/b.length:s[x]??0,y=Math.round((v+L)/2),I=g(x,y);I!==s[x]&&(s[x]=I,l=!0)}return l},"relaxOrder");for(let h=0;h0){const x=Math.min(...l.map(C=>(s[C]??0)-1));(s[h]??0)>x&&(s[h]=x)}}return{layers:vo(n,c,s),rankOf:s,dummy:new Set}}d(Qs,"assignLayers_Gravity");function tr(t){const e=So(t),n=Io(t);let o=Co(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const a of n.get(i)??[])e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0&&r.push(a)}o=r.sort((i,a)=>i.localeCompare(a))}return s.length===t.nodes.length?s:null}d(tr,"topoSortByGenerationIfAcyclic");function er(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?tr(n)??[...n.nodes].sort():De(n)??[...n.nodes].sort(),s=ge(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),a=new Map,c=d((g,p)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(g)===r(p)?1:0:1,"edgeWeight");for(const g of o){const p=n.nodeById.get(g);if(p!=null&&p.isGroup)continue;const M=Mo(n,g);let u=0;if(M.length>0)for(const C of M){const b=C.src,v=i[b]??0;u=Math.max(u,v+c(b,g))}const h=r(g),l=a.get(h)??0,x=Math.max(u,l);i[g]=x,a.set(h,x+1)}return{layers:vo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(er,"assignLayers_LaneAwareCompact");function nr(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const a=new Map(n.nodeById),c=d(u=>{const h=`placeholder-${i++}`,l={id:h,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(h,l),r.add(h);s.length<=u;)s.push([]);return s[u].push(h),o[h]=u,h},"addDummyAt"),f=[...n.edges].sort((u,h)=>u.id===h.id?u.src===h.src?u.dst.localeCompare(h.dst):u.src.localeCompare(h.src):u.id.localeCompare(h.id)),g=[];for(const u of f){const h=o[u.src]??0,l=o[u.dst]??0;if(l-h<=1){g.push(u);continue}let x=u.src;for(let b=h+1,v=0;b!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:a};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:M}}d(nr,"makeProperLayering");function Zn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Zn,"median");function Qn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Qn,"barycenter");function or(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(or,"neighborPositionsFor");function sr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(sr,"currentOrderTieBreak");function to(t,e,n){const o=new Set(t),s=new Set(e),r=ke(t),i=ke(e),a=[];for(const f of n)o.has(f.src)&&s.has(f.dst)&&a.push({u:r.get(f.src),v:i.get(f.dst)});a.sort((f,g)=>f.u===g.u?f.v-g.v:f.u-g.u);const c=a.map(f=>f.v);return Lo(c)}d(to,"countCrossingsBetweenAdjacent");function Ze(t,e,n){return[...t].sort((o,s)=>{const r=Zn(e.get(o)??[]),i=Zn(e.get(s)??[]);return r===i?sr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(Ze,"sortByHeuristic");function eo(t,e,n,o,s,r){const i=ke(t),a=ke(e),c=or(e,i,n,o);if(!s||!r||r.length===0)return Ze(e,c,a);const f=new Map;for(const M of e){const u=s(M),h=f.get(u)??[];h.push(M),f.set(u,h)}const g=[];for(const M of r){const u=f.get(M);if(!u||u.length===0)continue;const h=Ze(u,c,a);g.push(...h)}const p=f.get(null);if(p&&p.length>0){const M=Ze(p,c,a);for(const u of M){const h=Qn(c.get(u)??[]);let l=g.length;if(isFinite(h))for(const[x,C]of g.entries()){const b=Qn(c.get(C)??[]);if(hi.has(l.src)&&a.has(l.dst)),g=c?n.filter(l=>a.has(l.src)&&c.has(l.dst)):void 0,p=d(l=>{let x=to(t,l,f);return g&&o&&(x+=to(l,o,g)),x},"crossingScore"),M=s?new Map:null;if(s&&M)for(const l of e)M.set(l,s(l));let u=!0,h=p(r);for(;u;){u=!1;for(let l=0;l+1[...a]),s=e.edges,r=ge(e),i=Eo(e,n==null?void 0:n.laneOrder);for(let a=0;a<3;a++){for(let c=1;c=0;c--)o[c]=eo(o[c+1],o[c],s,"up",r,i),o[c]=no(o[c+1],o[c],s,o[c-1],r)}return{layers:o}}d(rr,"orderLayers");function ir(t,e,n){const o=(n==null?void 0:n.layerGap)??Ho.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??Ho.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,i=(n==null?void 0:n.direction)??"TB",a=i==="LR"||i==="RL",c=t.layers,f=Object.create(null),g=Object.create(null),p=d(O=>e.nodeById.get(O),"getNode"),M=d(O=>{var k;return((k=p(O))==null?void 0:k.width)??0},"getWidth"),u=d(O=>{var k;return((k=p(O))==null?void 0:k.height)??0},"getHeight"),h=ge(e),l=Eo(e,n==null?void 0:n.laneOrder),x=c.map(O=>O.reduce((k,H)=>Math.max(k,u(H)),0)),C=[];if(a)for(let O=0;O+1Math.max(Mt,M(Ht)),0),H=c[O+1].reduce((Mt,Ht)=>Math.max(Mt,M(Ht)),0),P=x[O],G=x[O+1],j=P/2+G/2,tt=(k+H)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of c)for(const k of O)b.add(h(k));const v=b.has(null),L=l.filter(O=>b.has(O)),y=[...v?[null]:[],...L],I=Object.create(null);for(const O of L)I[O]=0;v&&(I.null=0);for(const O of c){const k=Object.create(null),H=[];for(const P of O){const G=h(P);G===null?H.push(P):(k[G]||(k[G]=[])).push(P)}for(const[P,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+M(ft),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(v&&H.length){const P=H.reduce((G,j)=>G+M(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const E=new Map;{const O=y.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,y.length-1))/2;for(let P=0;PM(nt)),Ht=Mt.reduce((nt,J)=>nt+J,0)+s*(tt.length-1);let Ft=ft-Ht/2;for(const[nt,J]of tt.entries()){const rt=Mt[nt];f[J]=Ft+rt/2,g[J]=A+H/2,Ft+=rt+s}}}const G=C[O]??0;A+=H+o+G}const B=new Map;for(const O of e.edges){const k=O.ref.id;B.has(k)||B.set(k,[]),B.get(k).push(O)}for(const[,O]of B){if(O.length===0)continue;const k=O[0].ref,H=k.start,P=k.end;if(H==null||P==null)continue;const G=Math.round(((f[H]??0)+(f[P]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===H||tt===P)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(f[tt]=G)}}return{x:f,y:g}}d(ir,"assignCoordinates");var cr=8;function ar(t){let e=2166136261;for(let n=0;n>>0}d(ar,"hashString");function lr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(lr,"mulberry32");function fr(t,e){const n=[...t],o=lr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(fr,"deterministicShuffle");function dr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(dr,"sourceDistance");function oo(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const a=n.get(s),c=n.get(r);a==null||c==null||(o+=i*Math.abs(a-c))}return o}d(oo,"laneArrangementCost");function ur(t){const e=gn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=ge(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,a=typeof r.end=="string"?r.end:void 0;if(!i||!a||!t.nodeById.has(i)||!t.nodeById.has(a))continue;const c=o(i),f=o(a);if(!c||!f||c===f)continue;const g=n.get(c),p=n.get(f);if(g==null||p==null)continue;const[M,u]=g<=p?[c,f]:[f,c],h=`${M}\0${u}`,l=s.get(h);l?l.weight++:s.set(h,{a:M,b:u,weight:1})}return[...s.values()]}d(ur,"buildWeightedLaneEdges");function so(t,e,n){const o=[...t];let s=oo(o,e),r=!0,i=0;const a=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return ar(`${t.join("|")}#${o}#${n}`)}d(gr,"seedForRestart");function mr(t,e={}){const n=gn(t);if(n.length<2)return n;const o=ur(t);if(o.length===0)return n;const s=new Map(n.map((a,c)=>[a,c]));let r=so(n,o,s);const i=Math.max(0,e.restarts??cr);for(let a=0;alt&&c*3>=a?i>0?"bottom":"top":a>lt?r>0?"right":"left":n}d(ro,"chooseOrthogonalSide");function io(t,e){return Math.abs(t.to-e.from)m.isGroup&&!m.parentId);for(const m of f){const S={id:m.id},w=d(T=>{i.set(T.id,S),n.filter(N=>N.parentId===T.id).forEach(w)},"assignLane");w(m)}const g=n.filter(m=>!m.isGroup&&!m.isEdgeLabel).map(m=>{const S=m.width??10,w=m.height??10,T=m.x??0,N=m.y??0,D=ni;return{nodeId:m.id,minX:T-S/2-D,maxX:T+S/2+D,minY:N-w/2-D,maxY:N+w/2+D,visualXHalfExtent:c?w/2+D:S/2+D}}),p=d((m,S,w,T)=>{let N=a.find(D=>D.orientation===m&&Math.abs(D.coord-S)<1);return N||(N={id:`pipe-${m}-${S.toFixed(0)}`,orientation:m,coord:S,spanMin:w,spanMax:T,tracks:[]},a.push(N)),N.spanMin=Math.min(N.spanMin,w),N.spanMax=Math.max(N.spanMax,T),N},"getOrAddPipe"),M=d((m,S)=>{const w=m.width??10,T=m.height??10,N=m.x??0,D=m.y??0;switch(S){case"top":return{x:N,y:D-T/2};case"bottom":return{x:N,y:D+T/2};case"left":return{x:N-w/2,y:D};case"right":return{x:N+w/2,y:D}}},"portForSide"),u=d((m,S,w)=>M(m,ro(m,S,w?"bottom":"top")),"getOrthogonalPort"),h=[],l=[],x=new Set,C=1e3,b=d((m,S,w)=>{if(h.length===0)return 0;const T=Math.abs(S.y-w.y)U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}else if(N){const W=S.x,ot=Math.min(S.y,w.y)-lt,U=Math.max(S.y,w.y)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="horizontal"||z.pipe.coordU||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}return D},"crossingPenalty"),v=s.map((m,S)=>{if(!m.start||!m.end)return{idx:S,crossLane:0,dx:0,dy:0};const w=r.get(m.start),T=r.get(m.end),N=i.get(m.start),D=i.get(m.end),W=N&&D&&N.id!==D.id?1:0,ot=w&&T?Math.abs((T.x??0)-(w.x??0)):0,U=w&&T?Math.abs((T.y??0)-(w.y??0)):0;return{idx:S,crossLane:W,dx:ot,dy:U}}).sort((m,S)=>{if(m.crossLane!==S.crossLane)return S.crossLane-m.crossLane;const w=m.dx+m.dy,T=S.dx+S.dy;return Math.abs(w-T)>1?w-T:m.idx-S.idx}).map(m=>m.idx),L=d((m,S,w,T)=>{const N=Math.min(m.x,S.x),D=Math.max(m.x,S.x),W=Math.min(m.y,S.y),ot=Math.max(m.y,S.y);return!!g.find(z=>w&&z.nodeId===w||T&&z.nodeId===T?!1:Math.abs(m.x-S.x)>lt?z.minYm.y&&z.maxX>N&&z.minXm.x&&z.maxY>W&&z.minYro(m,S,"bottom"),"determineSide"),A=new Map;for(const[m,S]of s.entries()){if(!S.start||!S.end||S.start===S.end||S.points&&S.points.length>0)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const N=(T.x??0)-(w.x??0),D=(T.y??0)-(w.y??0);A.set(m,{edgeIdx:m,srcId:S.start,dstId:S.end,srcSide:E(w,{x:T.x??0,y:T.y??0}),dstSide:E(T,{x:w.x??0,y:w.y??0}),absDx:Math.abs(N),absDy:Math.abs(D),dxSign:Math.sign(N),dySign:Math.sign(D)})}const B=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.absDx===0?1/0:m.absDy/m.absDx:m.absDy===0?1/0:m.absDx/m.absDy,"preferenceStrength"),O=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.dxSign>=0?"right":"left":m.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const m of A.values()){const S=`${m.srcId}:${m.srcSide}`;k.has(S)||k.set(S,[]),k.get(S).push(m)}const H=new Map,P=d((m,S)=>`${m}:${S}`,"loadKey");for(const m of A.values())H.set(P(m.srcId,m.srcSide),(H.get(P(m.srcId,m.srcSide))??0)+1),H.set(P(m.dstId,m.dstSide),(H.get(P(m.dstId,m.dstSide))??0)+1);for(const m of k.values())if(!(m.length<2)){m.sort((S,w)=>{const T=B(S),N=B(w);return Math.abs(T-N)>1e-9?N-T:S.edgeIdx-w.edgeIdx});for(let S=1;S=N||(H.set(P(w.srcId,w.srcSide),N-1),H.set(P(w.srcId,T),D+1),w.srcSide=T)}}const G=d(m=>{const S=m==null?void 0:m.shape;return S==="question"||S==="diamond"},"isDiamondNode"),j=new Map;for(const m of A.values())j.has(m.dstId)||j.set(m.dstId,new Set),j.get(m.dstId).add(m.dstSide);for(const m of A.values()){if(!G(r.get(m.srcId)))continue;const S=j.get(m.srcId);if(!(S!=null&&S.has(m.srcSide)))continue;const w=O(m);if(S.has(w)||(H.get(P(m.srcId,w))??0)>0)continue;const T=H.get(P(m.srcId,m.srcSide))??0;H.set(P(m.srcId,m.srcSide),Math.max(0,T-1)),H.set(P(m.srcId,w),1),m.srcSide=w}for(const m of A.values()){const{edgeIdx:S,srcId:w,dstId:T,srcSide:N,dstSide:D}=m,W=r.get(w),ot=r.get(T),U=`${w}:${N}:src`,z=N==="top"||N==="bottom"?ot.x??0:ot.y??0;y.has(U)||y.set(U,[]),y.get(U).push({edgeIdx:S,oppositeCoord:z});const bt=`${T}:${D}:dst`,dt=D==="top"||D==="bottom"?W.x??0:W.y??0;y.has(bt)||y.set(bt,[]),y.get(bt).push({edgeIdx:S,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[m,S]of y){if(S.length<2)continue;S.sort((At,Gt)=>At.oppositeCoord-Gt.oppositeCoord);const w=m.split(":"),T=w.slice(0,-2).join(":"),N=w[w.length-2],D=w[w.length-1],W=r.get(T);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,z=W.shape,dt=z==="question"||z==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(S.length+1))),Bt=-(st*(S.length-1))/2;for(const[At,Gt]of S.entries()){const ee=Bt+At*st,xn=`${Gt.edgeIdx}:${D}`;tt.set(xn,ee)}}const Mt=d(m=>{var S;return!!((S=s[m])!=null&&S.labelNodeId)},"edgeHasLabelNode"),Ht=d((m,S)=>m?(y.get(`${m}:${S}:src`)??[]).some(({edgeIdx:w})=>Mt(w))||(y.get(`${m}:${S}:dst`)??[]).some(({edgeIdx:w})=>Mt(w)):!1,"faceHasLabelNode"),Ft=d((m,S,w)=>S==="top"||S==="bottom"?{x:m.x+w,y:m.y}:{x:m.x,y:m.y+w},"applyPortOffset"),nt=d((m,S,w)=>{const T=A.get(m),N={x:w.x??0,y:w.y??0},D={x:S.x??0,y:S.y??0},W=(T==null?void 0:T.srcSide)??E(S,N),ot=(T==null?void 0:T.dstSide)??E(w,D);let U=T?M(S,T.srcSide):u(S,N,!0),z=T?M(w,T.dstSide):u(w,D,!1);const bt=tt.get(`${m}:src`),dt=tt.get(`${m}:dst`);return bt!==void 0&&(U=Ft(U,W,bt)),dt!==void 0&&(z=Ft(z,ot,dt)),{pSrcPort:U,pDstPort:z,srcSide:W,dstSide:ot}},"portsForEdge");for(const m of v){const S=s[m];if(l[m]=[],!S.start||!S.end||S.points&&S.points.length>0||S.start===S.end)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const{pSrcPort:N,pDstPort:D,srcSide:W,dstSide:ot}=nt(m,w,T),U={...N},z={...D},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(w.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(w.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=D.y>(T.y??0);z.y=X?D.y+ie:D.y-ie}else{const X=D.x>(T.x??0);z.x=X?D.x+ie:D.x-ie}const ct=d((X,$)=>{for(const Q of g)if(!$.includes(Q.nodeId)&&X.x>Q.minX&&X.xQ.minY&&X.y{if(Tt){const kt=X.y>($.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Ce:ht.minX-Ce,y:kt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:kt}}const Ct=X.x>($.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Ce:ht.minX-Ce,y:Rt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:Ct}},"obstacleDetour");let It=[];const Bt=[S.start,S.end],At=ct(U,Bt);if(At.inside&&At.obstacle){const X=At.obstacle;if(bt){const $=st(N,w,T,X,!0);U.x=$.x,U.y=$.y;const Q=$.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);It=[{x:N.x,y:Q},{x:$.x,y:Q},{x:$.x,y:$.y}]}else{const $=st(N,w,T,X,!1),Q=$.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=$.x,U.y=$.y,It=[{x:Q,y:N.y},{x:Q,y:$.y},{x:$.x,y:$.y}]}}let Gt=[];const ee=ct(z,Bt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const $=st(D,T,w,X,!0);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:D.x,y:$.y}]}else{const $=st(D,T,w,X,!1);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:$.x,y:D.y}]}}if(It.length===0&&Gt.length===0){const X=Ce,$=Math.abs(U.x-z.x)1||Ct>1,kt=I.get(S.start??"")??0,mt=I.get(S.end??"")??0,Vt=Tt>1&&Ht(S.start,W)||Ct>1&&Ht(S.end,ot),re=Tt<=1||kt<=2,Dt=Ct<=1||mt<=2;if(($||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Dt)&&!L(N,D,S.start,S.end)){S.points=[{...N},{...U},{...z},{...D}],x.add(m);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,D.x):Math.min(N.y,D.y),Et=Q?Math.max(N.x,D.x):Math.max(N.y,D.y),Zt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${m}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Et,tracks:[]};h.push({edgeIndex:m,segmentIndex:0,orientation:vt,pipe:Zt,trackIndex:0,from:Lt,to:Et});continue}}const xn=p("vertical",U.x,U.y,U.y);U.x=xn.coord;const Mr=p("vertical",z.x,z.y,z.y);z.x=Mr.coord;let ye=Math.min(U.x,z.x)-50,pe=Math.max(U.x,z.x)+50,we=Math.min(U.y,z.y)-50,Ae=Math.max(U.y,z.y)+50;for(const X of g){const $=Math.min(U.x,z.x),Q=Math.max(U.x,z.x),ht=Math.min(U.y,z.y),Tt=Math.max(U.y,z.y);X.minX$&&X.minYht&&(ye=Math.min(ye,X.minX-qe),pe=Math.max(pe,X.maxX+qe),we=Math.min(we,X.minY-qe),Ae=Math.max(Ae,X.maxY+qe))}for(const X of g){if(X.maxXpe||X.maxYAe)continue;const $=Ce;p("horizontal",X.minY-$,ye,pe),p("horizontal",X.maxY+$,ye,pe);const Q=Ne;p("vertical",X.minX-Q,we,Ae),p("vertical",X.maxX+Q,we,Ae)}p("horizontal",U.y,ye,pe),p("horizontal",z.y,ye,pe);const Ir=a.filter(X=>X.orientation==="horizontal"&&X.coord>=we&&X.coord<=Ae),Sr=a.filter(X=>X.orientation==="vertical"&&X.coord>=ye&&X.coord<=pe),He=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),Xe=He(U.x,U.y),wo=He(z.x,z.y),Ye=new Map,bn=new Map,Mn=new Map,Ge=new Set,Se=[];Ye.set(Xe,0),Mn.set(Xe,"n"),Se.push({key:Xe,f:Math.hypot(z.x-U.x,z.y-U.y),pt:U}),Ge.add(Xe);let $t=[];const xe=d((X,$)=>L(X,$,S.start,S.end),"checkSegmentBlocked"),In={x:z.x,y:U.y},Cr=xe(U,In),vr=xe(In,z),Lr=Cr||vr,Sn={x:U.x,y:z.y},Er=xe(U,Sn),Tr=xe(Sn,z);if(Lr?Er||Tr||(Math.abs(U.x-z.x)0;){Se.sort((mt,Vt)=>mt.f-Vt.f);const X=Se.shift();if(Ge.delete(X.key),X.key===wo){let mt=wo,Vt=z;for($t=[Vt];bn.has(mt);){const re=bn.get(mt);$t.unshift(re),Vt=re,mt=He(re.x,re.y)}break}const $=X.pt.x,Q=X.pt.y,ht=Sr.sort((mt,Vt)=>mt.coord-Vt.coord),Tt=ht.findIndex(mt=>Math.abs(mt.coord-$)<1),Ct=Ir.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];Tt>0&&kt.push({x:ht[Tt-1].coord,y:Q}),Tt>=0&&Tt0&&kt.push({x:$,y:Ct[Rt-1].coord}),Rt>=0&&Rtne.nodeId===S.start||ne.nodeId===S.end?!1:Vt!==re?ne.minYQ&&ne.maxX>Vt&&ne.minX$&&ne.maxY>Dt&&ne.minY10&&Cn<-5||Re<-10&&Cn>5)&&(Et=Math.abs(Cn)*100),(Zt>10&&$e<-5||Zt<-10&&$e>5)&&(Et+=Math.abs($e)*50);let Ao=0;const Ro=Mn.get(X.key)??"n",No=Math.abs($e)>lt?"h":"v";Ro!=="n"&&Ro!==No&&(Ao=50);const wr=Ut+Lt+Et+Ao,ze=(Ye.get(X.key)??1/0)+wr,Oo=Math.abs(z.x-mt.x)+Math.abs(z.y-mt.y);if(ze<(Ye.get(vt)??1/0))if(bn.set(vt,X.pt),Ye.set(vt,ze),Mn.set(vt,No),!Ge.has(vt))Se.push({key:vt,f:ze+Oo,pt:mt}),Ge.add(vt);else{const ne=Se.findIndex(Ar=>Ar.key===vt);ne!==-1&&(Se[ne].f=ze+Oo)}}}if($t.length===0&&($t=[U,{x:U.x,y:z.y},z]),$t.length>4){const X=$t[0],$=$t[$t.length-1];let Q=Math.min(X.x,$.x),ht=Math.max(X.x,$.x),Tt=Math.min(X.y,$.y),Ct=Math.max(X.y,$.y);for(const Dt of $t)Q=Math.min(Q,Dt.x),ht=Math.max(ht,Dt.x),Tt=Math.min(Tt,Dt.y),Ct=Math.max(Ct,Dt.y);const Rt=ht>Math.max(X.x,$.x),kt=QLt.minXjt&&Lt.minY_t);if(Ut.length>0){let Lt=Math.max(X.x,$.x);for(const Et of Ut){const Zt=(Et.minX+Et.maxX)/2;if(Et.visualXHalfExtent===void 0||isNaN(Et.visualXHalfExtent))continue;const Re=Zt+Et.visualXHalfExtent+Dt;Lt=Math.max(Lt,Re)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=g.filter(_t=>_t.minXMath.min(X.y,$.y));if(jt.length>0){let _t=Math.min(X.x,$.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Dt;_t=Math.min(_t,Lt)}Q=_t}}}const mt=d(Dt=>{const jt=$.y>X.y,_t=g.filter(Lt=>{const Et=Math.min(X.x,$.x)Lt.minX,Zt=Math.min(X.y,$.y)Lt.minY;return Et&&Zt});let vt=_t;if(c&&_t.length>0){const Lt=_t.filter(Et=>Et.minXDt);Lt.length>0&&(vt=Lt)}if(vt.length===0)return $.y;const Ut=Ce;if(jt){const Et=Math.max(...vt.map(Zt=>Zt.maxY))+Ut;if(Et<$.y-lt)return Et}else{const Et=Math.min(...vt.map(Zt=>Zt.minY))-Ut;if(Et>$.y+lt)return Et}return $.y},"findBestReturnY"),Vt=d(Dt=>{const jt=mt(Dt),_t={x:Dt,y:X.y},vt={x:Dt,y:jt},Ut={x:$.x,y:jt},Lt=xe(X,_t),Et=xe(_t,vt),Zt=xe(vt,Ut),Re=jt!==$.y?xe(Ut,$):!1;return!Lt&&!Et&&!Zt&&!Re?Math.abs(jt-$.y)=3){const X=zt[zt.length-1],$=zt[zt.length-2],Q=zt[zt.length-3],ht=Math.abs(Q.y-$.y)Math.abs(X.x-Q.x)&&zt.splice(-2,1)}else if(Tt){const Ct=Math.sign($.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs($.y-Q.y)>Math.abs(X.y-Q.y)&&zt.splice(-2,1)}}const fe=[zt[0]];for(let X=1;X$.x,Ct=ht.x>Q.x;if(Tt!==Ct){fe.push(Q);continue}continue}if(Math.abs($.x-Q.x)$.y,Ct=ht.y>Q.y;if(Tt!==Ct){fe.push(Q);continue}continue}fe.push(Q)}fe.push(zt[zt.length-1]);for(let X=0;Xm.from{const N=!T.segments.some(W=>(W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex)&&J(W,m)),D=!w.segments.some(W=>(W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex)&&J(W,S));return N&&D?(m.trackIndex=T.index,S.trackIndex=w.index,w.segments=[...w.segments.filter(W=>W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex),{edgeIndex:S.edgeIndex,segmentIndex:S.segmentIndex,from:S.from,to:S.to}],T.segments=[...T.segments.filter(W=>W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex),{edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=d(m=>{const S=m.tracks.length;return m.tracks[S]={index:S,coord:m.coord,segments:[]},S},"createNewTrack"),pt=d((m,S)=>{const w=m.pipe.tracks[m.trackIndex];w.segments=w.segments.filter(N=>N.edgeIndex!==m.edgeIndex||N.segmentIndex!==m.segmentIndex),m.trackIndex=S,m.pipe.tracks[S].segments.push({edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to})},"moveSegmentToTrack"),St=d((m,S)=>{const w=l[m.edgeIndex];for(const T of w){const N=h[T];N.pipe===m.pipe&&pt(N,S)}},"moveSegmentChainToTrack"),wt=d(m=>{const S=l[m.edgeIndex],w=S.indexOf(h.indexOf(m)),T=[];return w>0&&T.push(h[S[w-1]]),w{if(m.orientation===S.orientation)return!1;const w=m.orientation==="horizontal"?m:S,T=m.orientation==="horizontal"?S:m;return T.pipe.coord>w.from&&T.pipe.coordT.from&&w.pipe.coord{for(const w of m.tracks)if(!w.segments.some(N=>(N.edgeIndex!==S.edgeIndex||N.segmentIndex!==S.segmentIndex)&&J(N,S)))return w.index;return-1},"findAvailableTrack"),Jt=d((m,S)=>{if(m.trackIndex===S.trackIndex)return J(m,S);const w=wt(m),T=wt(S);return w.some(N=>T.some(D=>Kt(N,D)))},"segmentsConflict"),se=d((m,S,w)=>{if(rt(m,S,m.pipe.tracks[m.trackIndex],S.pipe.tracks[S.trackIndex]))return;const T=qt(m.pipe,S);w(S,T!==-1?T:ut(m.pipe))},"resolveTrackConflict"),Ee=d(m=>{let S=0;for(let w=0;w{if(me.has(m))return me.get(m);const S=l[m];if(S.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return me.set(m,ot),ot}const T=h[S[0]].pipe.coord;let N=T;for(let ot=1;otMath.abs(bt-T)?z:bt;break}}const D=Math.abs(N-T),W={dest:N,deviation:D,base:T,delta:N-T};return me.set(m,W),W},"getDestInfo"),mn=d(()=>{let m=0;const S=new Map;for(const[T,N]of s.entries())l[T].length!==0&&N.start&&(S.has(N.start)||S.set(N.start,[]),S.get(N.start).push(T));const w=d(T=>{const N=s[T];if(!N.start||!N.end)return 0;const D=r.get(N.start),W=r.get(N.end);if(!D||!W)return 0;const ot=(W.x??0)-(D.x??0),U=(W.y??0)-(D.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const T of S.values()){T.sort((D,W)=>{const ot=Te(D),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const z=w(D),bt=w(W);if(Math.abs(z-bt)>1)return bt-z;const dt=l[D].length,ct=l[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=l[D][0],It=l[W][0];if(h[st]&&h[It]){const Bt=h[st],At=h[It],Gt=Math.abs(Bt.to-Bt.from),ee=Math.abs(At.to-At.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=T.map(D=>h[l[D][0]]);m+=Ee(N)}return m},"fixSourceHandleCrossings"),yn=d(()=>{let m=0;const S=new Map;for(const[w,T]of s.entries())l[w].length!==0&&T.end&&(S.has(T.end)||S.set(T.end,[]),S.get(T.end).push(w));for(const w of S.values()){w.sort((N,D)=>{const W=d(z=>{const bt=l[z];if(bt.length<2)return 0;const dt=h[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(D);return Math.abs(ot-U)>.1?ot-U:N-D});const T=w.map(N=>h[l[N][l[N].length-1]]);m+=Ee(T)}return m},"fixTargetHandleCrossings"),pn=d(()=>{let m=0;for(const S of a){const w=[];for(const T of S.tracks)for(const N of T.segments){const D=l[N.edgeIndex].find(W=>h[W].segmentIndex===N.segmentIndex);D!==void 0&&w.push(h[D])}w.sort((T,N)=>T.edgeIndex-N.edgeIndex||T.segmentIndex-N.segmentIndex);for(let T=0;T{T.segments.forEach(N=>{S.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:T.index,from:N.from,to:N.to})})}),S.sort((T,N)=>T.from-N.from);const w=[];if(S.length>0){let T=[S[0]],N=S[0].to;for(let D=1;DN.add(st.trackIndex));const D=new Map;T.forEach(st=>{const It=Te(st.edgeIndex);D.set(st.trackIndex,(D.get(st.trackIndex)??0)+It.delta)});const W=[...N].filter(st=>(D.get(st)??0)<-1),ot=[...N].filter(st=>(D.get(st)??0)>1),U=[...N].filter(st=>Math.abs(D.get(st)??0)<=1);W.sort((st,It)=>(D.get(It)??0)-(D.get(st)??0)),ot.sort((st,It)=>(D.get(st)??0)-(D.get(It)??0));const z=d((st,It)=>{T.filter(Bt=>Bt.trackIndex===st).forEach(Bt=>{const At=x.has(Bt.edgeIndex)?m.coord:It;F.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,At)})},"assignCoord");let bt=0;for(const st of W)bt++,z(st,m.coord-bt*Tn);if(U.length===0&&N.size>0){const st=[...N].sort((At,Gt)=>Math.abs(D.get(At)??0)-Math.abs(D.get(Gt)??0))[0],It=W.indexOf(st);It!==-1&&W.splice(It,1);const Bt=ot.indexOf(st);Bt!==-1&&ot.splice(Bt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)z(st,m.coord);else{const It=dt%2===1?1:-1,Bt=Math.ceil(dt/2);z(st,m.coord+It*Bt*Tn*.5)}dt++}let ct=0;for(const st of ot)ct++,z(st,m.coord+ct*Tn)}}for(const[m,S]of s.entries()){const w=l[m]??[];if(w.length===0)continue;const T=[],N=r.get(S.start),D=r.get(S.end),{pSrcPort:W,pDstPort:ot}=nt(m,N,D),U=w.map(dt=>{const ct=h[dt],st=F.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});T.push(W);for(let dt=0;dtlt&&T.push(ve(ct,It)),Gt&&At.orient===ct.orient)if(Math.abs(ct.coord-At.coord)>lt){const ee=ct.orient==="vertical"?(It+At.from)/2:io(ct,At);T.push(ve(ct,ee),ve(At,ee))}else(dt===0||dt===U.length-2)&&T.push(ve(ct,io(ct,At)));else if(Gt)T.push(ve(ct,At.coord));else{const ee=Math.abs(ct.from-It)lt||Math.abs(z.y-ot.y)>lt)&&T.push(ot);const bt=[];T.length>0&&bt.push(T[0]);for(let dt=1;dtlt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}S.points=bt}for(const m of s){const S=m.__originalEdge;S&&m.points&&(S.points=m.points)}t.edges=(t.edges??[]).filter(m=>!m.isLayoutOnly);const V=d((m,S)=>{const w=S.x??0,T=S.y??0,N=S.width??0,D=S.height??0;if(N<=0||D<=0)return m;const W=w-N/2,ot=w+N/2,U=T-D/2,z=T+D/2;if(m.xot||m.yz)return m;const bt=m.x-W,dt=ot-m.x,ct=m.y-U,st=z-m.y,It=Math.min(bt,dt,ct,st);return It===bt?{x:W,y:m.y}:It===dt?{x:ot,y:m.y}:It===ct?{x:m.x,y:U}:{x:m.x,y:z}},"nodeBoundaryClamp");for(const m of t.edges){const S=m.points;if(!S||S.length<2)continue;const w=m.start,T=m.end,N=w?r.get(w):void 0,D=T?r.get(T):void 0;N&&(S[0]=V(S[0],N)),D&&(S[S.length-1]=V(S[S.length-1],D))}return t}d(pr,"routeEdgesOrthogonal");function xr(t){return t.direction??"TB"}d(xr,"getSwimlaneDirection");function br(t){var g,p,M,u,h;const e=es(t),n=((g=t.config.flowchart)==null?void 0:g.nodeSpacing)??40,o=((p=t.config.flowchart)==null?void 0:p.rankSpacing)??100,s=((M=t.config.swimlane)==null?void 0:M.ignoreCrossLaneEdges)??!0,r=((u=t.config.swimlane)==null?void 0:u.optimizeRanksByCrossings)??!0,i=((h=t.config.swimlane)==null?void 0:h.automaticLaneOrdering)??!1,a=xr(t),{ordered:c,coordinates:f}=yr(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:a});ns(e,c,f,{nodeGap:n,layerGap:o});for(const l of t.edges??[])delete l.points;pr(t,a);for(const l of t.edges??[])(!l.curve||l.curve==="basis")&&(l.curve="rounded");return Bs(t,a),Ps(t),a}d(br,"runSwimlaneLayoutCore");async function oi(t,e){const n=e.select("g");Or(n,t.markers,t.type,t.diagramId),Pr(),Br(),kr(),Nr(),ts(t);const o=os(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await Xo(n,t);br(t),await Jo(t,s)}d(oi,"render");export{oi as render}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C7Roe_yn.js","assets/visualizations/mermaid/mermaid.core-Byx96n1y.js","assets/app/index-y89rQfXU.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); +import{_ as Rr}from"../../app/index-y89rQfXU.js";import{c as Nr}from"./chunk-RYQCIY6F-CvZ-mg4G.js";import{aw as Or,v as Pr,t as Br,u as kr,at as Qe,Y as _r,ag as Fr,ad as Dr,aG as Hr,ae as Xr,af as Yr,X as Gr,a6 as $r,P as zr,b9 as _e,b2 as Ve,a as d,av as Po}from"./mermaid.core-Byx96n1y.js";import{G as Vr}from"../../chunks/graph-Dqkl27Ch.js";import"../../chunks/map-8WAJQ6ap.js";import"../../chunks/purify.es-BnINGy_Y.js";async function Xo(t,e){const n=new Vr({multigraph:!0,compound:!0}),o=[...e.edges],s=_r(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),a=r.insert("g").attr("class","edges edgePath"),c=r.insert("g").attr("class","edgeLabels"),f=r.insert("g").attr("class","nodes"),g=new Map,p=t.node()!=null;await Promise.all(e.nodes.map(async M=>{var u;if(M.isGroup)n.setNode(M.id,{...M});else{if(p){const h=await Fr(f,M,{config:s,dir:M.dir}),l=((u=h.node())==null?void 0:u.getBBox())??{width:0,height:0};g.set(M.id,h),M.width=l.width,M.height=l.height}n.setNode(M.id,{...M})}}));for(const M of o)n.setEdge(M.start,M.end,{...M},M.id),e.edges.some(h=>h.id===M.id)||e.edges.push(M);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:M}=await Rr(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-C7Roe_yn.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));M(t,e)}return{graph:n,groups:{clusters:i,edgePaths:a,edgeLabels:c,nodes:f,rootGroups:r},nodeElements:g}}d(Xo,"createGraphWithElements");var Bo=5,je=1e-5,Ue=1e-6;function tn(t){const e=[];for(let n=0;n=1-Ue||M<=Ue||M>=1-Ue?null:{point:{x:t.x+p*s,y:t.y+p*r},tA:p,tB:M}}d(Yo,"segmentIntersection");function wn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(wn,"isHorizontalSeg");function Go(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d($o,"getArcSweepFlag");var jr=.001;function zo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Po[e.arrowTypeStart];if(o){const r=t[0],i=t[1],a=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(a),n[0].y=r.y+o*Math.sin(a)}const s=e.arrowTypeEnd&&Po[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],a=t[r-1],c=Math.atan2(a.y-i.y,a.x-i.x);n[r-1].x=a.x-s*Math.cos(c),n[r-1].y=a.y-s*Math.sin(c)}return n}d(zo,"applyMarkerOffsets");function Vo(t,e,n,o,s){const r=t.point.x,i=t.point.y,a={x:r-e*t.r,y:i-n*t.r},c={x:r+e*t.r,y:i+n*t.r},f=[`L${Oe(a)}`];return s==="arc"?f.push(`A${le(t.r)},${le(t.r)} 0 0 ${o} ${Oe(c)}`):f.push(`M${Oe(c)}`),f}d(Vo,"emitJump");function An(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,a=n.y-e.y,c=Math.hypot(s,r),f=Math.hypot(i,a);if(c0){const v=An(s[f-1],s[f],s[f+1]??s[f],Bo);v&&(l=v.cutLen)}let x=p,C=null;r&&fv.t-L.t);for(const v of b)v.r=Math.min(v.r,v.d-l,x-v.d);for(let v=0;vL){const y=L/2;b[v].r=Math.min(b[v].r,y),b[v+1].r=Math.min(b[v+1].r,y)}}for(const v of b)v.r=2?o:null}catch{return null}}d(Ko,"decodeDataPoints");function qo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const f of e)s.set(f.id,f);const r=[],i=new Map;for(const f of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(f.id):f.id,p=o.querySelector(`path[data-id="${g}"]`);if(!p)continue;i.set(f.id,p);const u=Ko(p.getAttribute("data-points"))??f.points;r.push({...f,points:u})}const a=Go(r);if(a.length===0)return;const c=new Map;for(const f of a){const g=c.get(f.jumpEdgeId)??[];g.push(f),c.set(f.jumpEdgeId,g)}for(const f of r){const g=c.get(f.id);if(!g||g.length===0)continue;const p=s.get(f.id),M=p==null?void 0:p.curve;if(M!==void 0&&!Wo(M))continue;const u=i.get(f.id);if(!u)continue;if(M===void 0){const v=u.getAttribute("d")??"";if(!Uo(v))continue}const h=u.getAttribute("style")??"",l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(h),x=l?Number.parseFloat(l[1]):null,C=l?Number.parseFloat(l[2]):null,b=jo(f,g,n);if(u.setAttribute("d",b),x!==null&&C!==null&&typeof u.getTotalLength=="function"){const v=u.getTotalLength(),L=Math.max(0,v-x-C),y=`0 ${x} ${L} ${C}`,I=h.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${y};`).replace(/;\s*;+/g,";");u.setAttribute("style",I)}}}d(qo,"applyLineJumpsToSvg");async function Jo(t,e){var s,r;for(const i of t.nodes)i.isGroup?await Dr(e.clusters,i):Hr(i);const n=new Map;for(const i of t.nodes)i!=null&&i.id&&n.set(i.id,i);for(const i of t.edges){const a=i.start?n.get(i.start)??{}:{},c=i.end?n.get(i.end)??{}:{},f=Xr(e.edgePaths,{...i},{},t.type,a,c,t.diagramId);i.label&&await Yr(e.rootGroups,i),i.label&&Zo(i,f)}const o=(r=(s=t.config)==null?void 0:s.swimlane)==null?void 0:r.lineHops;if(o!==!1){const i=o==="gap"?"gap":"arc",a=t.edges.filter(c=>Array.isArray(c.points)&&c.points.length>=2).map(c=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));qo(e.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}}d(Jo,"adjustLayout");function Zo(t,e){const n=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),o=Gr(),{subGraphTitleTotalMargin:s}=$r({flowchart:o.flowchart??{}});if(t.label){const r=zr.get(t.id);let i=t.x,a=t.y;if(n){const c=_e.calcLabelPosition(n);Qe.debug("Moving label "+t.label+" from (",i,",",a,") to (",c.x,",",c.y,") abc88"),e&&(i=c.x,a=c.y)}r.attr("transform",`translate(${i}, ${a+s/2})`)}if(t!=null&&t.startLabelLeft){const r=Ve.get(t.id).startLeft;let i=t==null?void 0:t.x,a=t==null?void 0:t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.startLabelRight){const r=Ve.get(t.id).startRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelLeft){const r=Ve.get(t.id).endLeft;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelRight){const r=Ve.get(t.id).endRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}}d(Zo,"positionEdgeLabel");var vn="__swimlane_default__",Ur=21,ko=20;function Rn(t){return Math.max(t.padding??ko,ko)}d(Rn,"topLaneHorizontalPadding");function Qo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,a=Math.min(r,n+s/2),c=Math.min(Ur,Math.max(0,a-i)),f=i+c;if(f<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:f}}d(Qo,"assignTopLaneTitleRect");function ts(t){const e=t.direction,n=t.nodes??(t.nodes=[]);for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===vn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:vn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=vn}d(ts,"prepareLayoutForSwimlanes");function es(t){const e=new Map;for(const c of t.nodes??[])e.set(c.id,c);const n=[];for(const c of t.edges??[]){const f=typeof c.start=="string"?c.start:void 0,g=typeof c.end=="string"?c.end:void 0;!f||!g||c.labelNodeId||n.push({id:c.id,src:f,dst:g,ref:c})}const o=t.nodes??[],s=o.filter(c=>c.isGroup),r=o.filter(c=>!c.isGroup);return{nodes:[...[...s].reverse(),...r].map(c=>c.id),edges:n,layout:t,nodeById:e}}d(es,"toGraphView");function ns(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=(o==null?void 0:o.layerGap)??100,a=(o==null?void 0:o.nodeGap)??40;let c=0;for(const M of e.layers){let u=0;for(const h of M){const l=r.get(h);if(!l){u++;continue}l.layer=c,l.order=u;const x=n.x[h]??u*a,C=n.y[h]??c*i;l.x=x,l.y=C,u++}c++}const f=s.nodes??[],g=new Map,p=[];for(const M of f){if(!(M!=null&&M.isGroup))continue;M.parentId||p.push(M);const u=f.filter(b=>b.parentId===M.id);let h=1/0,l=-1/0,x=1/0,C=-1/0;for(const b of u){const v=b.x??n.x[b.id],L=b.y??n.y[b.id],y=b.width??0,I=b.height??0;v!=null&&L!=null&&(h=Math.min(h,v-y/2),l=Math.max(l,v+y/2),x=Math.min(x,L-I/2),C=Math.max(C,L+I/2))}if(h===1/0||x===1/0)M.x=M.x??0,M.y=M.y??0,M.width=M.width??0,M.height=M.height??0;else{const b=M.padding??20,v=M.parentId?b:2*Rn(M),L=b,y=Math.max(0,l-h)+v,I=Math.max(0,C-x)+L,E=(h+l)/2,A=(x+C)/2;M.x=E,M.y=A,M.width=y,M.height=I,g.set(M.id,{minX:h,maxX:l,minY:x,maxY:C})}}if(p.length>0&&g.size>0){let M=1/0,u=-1/0,h=0;for(const l of p){const x=l.padding??20;x>h&&(h=x);const C=g.get(l.id);C&&(M=Math.min(M,C.minY),u=Math.max(u,C.maxY))}if(M!==1/0&&u!==-1/0){const l=Math.max(0,u-M),C=Math.max(h,36),b=l+2*C,v=(M+u)/2;for(const B of p)B.y=v,B.height=b,B.swimlaneContentTop=M;const L=[...p].sort((B,O)=>{const k=B.x??0,H=O.x??0;return k-H}),y=[],I=[],E=[];for(const B of L){const O=g.get(B.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*Rn(B),H=(O.minX+O.maxX)/2;y.push(B.id),I.push(H),E.push(k)}const A=y.length;if(A>0){const B=new Map;if(A===1)B.set(y[0],E[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Pe(e,n,o,s)}:void 0}d(co,"measuredNodeRect");function ao(t){if(t.isGroup)return;const e=co(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(ao,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)n}d(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}d(Ot,"isVerticalSegment");function Wt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(Wt,"overlapLength");function de(t,e,n=Yt){return t.horizontal&&e.horizontal&&yt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&>(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(de,"sameAxisSegmentOverlapLength");function Be(t,e=Yt){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(xt,"dedupeConsecutivePoints");function lo(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(lo,"classifyThreeSegmentRoute");function dn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ss,"rectContainsRect");function en(t,e){return t.lefte.left&&t.tope.top}d(en,"rectsOverlap");function Nn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Nn,"inflateRect");function Pe(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Pe,"rectFromCenterSize");function te(t){var e;return(e=co(t))==null?void 0:e.rect}d(te,"rectOfNodeBounds");function Le(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}}}d(Le,"portForRectSide");function uo(t,e,n,o,s,r=Yt){const i=e==="left"||e==="right",a=o==="left"||o==="right";if(i&&a){if(e==="right"&&o==="left"&&t.xn.x){if(yt(t,n,r))return[t,n];const p=(t.x+n.x)/2;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}if(e===o){if(yt(t,n,r))return;const p=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}return}if(!i&&!a){if(e===o){if(gt(t,n,r))return;const M=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:M},{x:n.x,y:M},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(gt(t,n,r))return[t,n];const p=(t.y+n.y)/2;return[t,{x:t.x,y:p},{x:n.x,y:p},n]}if(i&&!a){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&p?[t,{x:n.x,y:t.y},n]:void 0}const c=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return c&&f?[t,{x:t.x,y:n.y},n]:void 0}d(uo,"buildOrthogonalPortPath");function ho(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ho,"buildSameSideTrackPath");function un(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=ao(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(un,"collectRealNodeBounds");function Me(t){const e=[],n=[];for(const o of t){const s=ao(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(Me,"collectNodeRectEntries");function rs(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,a=o.height??0;n.push({nodeId:o.id,...Pe(s,r,i,a)})}return n}d(rs,"collectLayoutNodeRects");function go(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)h||MC)return!1;const b=Math.abs(l-g.a.x)s:r&&a&&yt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}d(is,"sameAxisSegmentsOverlap");function nn(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const a=i.points;if(!(!a||a.length<2))for(let c=0;cM+s&&hl+s&&po+Yt&&t=2?e[e.length-2]:void 0,c=(i?gt(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(c)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}d(on,"orthogonalizePolyline");function ue(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=as(e);if(e=o.points,!o.changed)break}return e}d(ue,"simplifyPolyline");var it=.001,Kr=.5,_o=4;function yo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=ls(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(Pn,"clipEndpoint");function fs(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Pn(s,o.srcRect,!0)),o.dstRect&&(s=Pn(s,o.dstRect,!1)),s=ue(on(s)),s=po(s,o.srcRect,o.dstRect),o.edge.points=ue(on(s))}}d(fs,"clipEdgeEndpointsToNodeBoundaries");function Bn(t,e,n,o=!1){if(yt(t,e,it)){if(e.yn.bottom+it)return e;if(o){if(t.xn.right+it)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(gt(t,e,it)){if(e.xn.right+it)return e;if(o){if(t.yn.bottom+it)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Bn,"snapEndpointToBoundary");function sn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(ds,"intersectRanges");function _n(t,e){return e==="left"||e==="right"?rn(t.top,t.bottom):rn(t.left,t.right)}d(_n,"clearanceRangeForSide");function cn(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(yt(t,e,it)&&o){if(Math.abs(t.x-n.left)0?ds(r):void 0}d(us,"straightClearanceRange");function Fn(t,e,n,o,s){const r=us(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,a=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(a-i)({...a}));for(let a=e;a>=0&&a=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)o.bottom+it;case"left":return yt(e,n,it)&&n.xo.right+it}}d(Xn,"leavesOutward");function Yn(t,e,n){if(t.length<3)return t;if(n){const r=Hn(t[0],t[1],e);return r&&Xn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Hn(t[o-1],t[o],e);return s&&Xn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Yn,"collapseOwnBorderStub");function ms(t,e,n){let o=t;if(e){const r=sn(o,0,1);if(r){const i=Bn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Yn(o,e,!0)}if(n){const r=o.length-1,i=sn(o,r,-1);if(i){const a=Bn(i,o[r],n,!0);a!==o[r]&&(o=[...o.slice(0,r),a])}o=Yn(o,n,!1)}const s=po(o,e,n);return s!==o||o.length===2?s:(e&&(o=Dn(o,e,!0)),n&&(o=Dn(o,n,!1)),o)}d(ms,"snapAndCollapseEndpoints");function Gn(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;const s=xt(o.points,it),r=ms(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Gn,"prepareEdgeEndpointsForRenderer");function xo(t){return new Map(t.map(e=>[e.id,e]))}d(xo,"buildNodeMap");function ys(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}d(ys,"resolveTopLevelGroupId");function $n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}d($n,"groupDepth");function bo(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,a=r.y;if(typeof i!="number"||typeof a!="number")continue;const c=r.width??0,f=r.height??0;e=Math.min(e,i-c/2),n=Math.max(n,i+c/2),o=Math.min(o,a-f/2),s=Math.max(s,a+f/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(bo,"boundsForChildren");function ps(t,e){const n=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)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ps,"applyGroupBounds");function xs(t){const e=xo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>$n(s,e)-$n(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=bo(s);r&&ps(o,r)}}d(xs,"recomputeNestedGroupBounds");function an(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);let r=1/0,i=-1/0;for(const c of s){const f=c[e];typeof f=="number"&&(r=Math.min(r,f),i=Math.max(i,f))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const a=d(c=>r+i-c,"mirror");for(const c of n){const f=c[e];typeof f=="number"&&(c[e]=a(f));const g=c.groupTitleRect;g&&(c.groupTitleRect=e==="x"?{...g,left:a(g.right),right:a(g.left)}:{...g,top:a(g.bottom),bottom:a(g.top)})}for(const c of o)for(const f of c.points??[])f[e]=a(f[e]);return!0}d(an,"mirrorAxis");function bs(t){return(t.nodes??[]).some(n=>!n.isGroup)?an(t,"y"):!0}d(bs,"applyBtDirectionTransform");function Ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/p):1;for(const P of s){const G=P.x??0,tt=((P.y??0)-i)*M+a,ft=G-r;P.x=tt,P.y=ft}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,ft=(G.y-i)*M+a,Mt=j-r;G.x=ft,G.y=Mt}xs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&an(t,"x"),!0;const h=xo(n),l=new Map;for(const P of n){if(P.isGroup)continue;const G=ys(P,h);if(!G)continue;const j=l.get(G)??[];j.push(P),l.set(G,j)}let x=0;for(const P of u){const G=P.padding??0;G>x&&(x=G)}const C=[];let b=1/0,v=-1/0;for(const P of u){const G=l.get(P.id)??[],j=bo(G);j&&(b=Math.min(b,j.minX),v=Math.max(v,j.maxX),C.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const L=Math.max(0,v-b),y=Math.max(x,10),I=L+2*y,E=a+I,O=(b+v)/2-I/2-a,k=O+E/2,H=Math.max(x,a);C.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PM.cy?C.bottom:C.top,H=M.cx+b;if(H<=C.left+ae||H>=C.right-ae)continue;v={x:H,y:k},L={x:H,y:a.y},y={x:a.x,y:a.y}}else{const k=u.cx>M.cx?C.right:C.left,H=M.cy+b;if(H<=C.top+ae||H>=C.bottom-ae)continue;v={x:k,y:H},L={x:a.x,y:H},y={x:a.x,y:a.y}}const I=ce(v,L,ae),E=ce(L,y,ae);if(I&&E||!I&&Pt(v,L,o,[g],1)||!E&&Pt(L,y,o,[p],1))continue;const A=!I&&nn(v,L,t,s,{epsilon:ae,skipDegenerateOther:!0}),B=!E&&nn(L,y,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(A||B)){I?x=[L,y]:E?x=[v,L]:x=[v,L,y];break}}x&&(s.points=x)}}d(Is,"portSwapToLShape");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values());for(const a of t){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<4)continue;const f=xt(c,.001);if(f.length<4)continue;const g=f.length-1,p=f[g],M=f[g-1],u=f[g-2],h=p.x-M.x,l=p.y-M.y,x=Math.hypot(h,l);if(x>=10||x<.001)continue;const C=M.x-u.x,b=M.y-u.y;if(Math.hypot(C,b)<.001)continue;const L=Nt(M,p,.001),y=Ot(M,p,.001),I=Nt(u,M,.001),E=Ot(u,M,.001);if(!(L&&E||y&&I))continue;const A=a.end,B=a.start,O=A?e.get(A):void 0;if(!O)continue;const k=O.x??0,H=O.y??0,P=te(O);if(!P)continue;let G,j;if(E){const J=b<0;G={x:k,y:u.y},j={x:k,y:J?P.bottom:P.top}}else{const J=C>0;G={x:u.x,y:H},j={x:J?P.right:P.left,y:H}}if(Pt(G,j,r,A?[A]:[],-2)||Pt(G,j,i,[],-2))continue;if(B){const J=e.get(B),rt=J?te(J):void 0;if(rt&&fo(G,rt,2))continue}const tt=d((J,rt)=>`${J.x.toFixed(3)},${J.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let J=0;J{for(const ut of t){if(ut===a||ut.isLayoutOnly)continue;const pt=ut.points;if(!(!pt||pt.length<2))for(let St=0;St=0){const J=f[g-3],rt=[B,A].filter(ut=>!!ut);if(Pt(J,G,r,rt,-2)||Mt(J,G))continue}const Ft=[...f.slice(0,g-2),G,j];a.points=Ft;const nt=a.labelNodeId;if(nt){const J=e.get(nt);if(J){const rt=J.width??0,ut=J.height??0;if(rt>0&&ut>0){let pt,St,wt=-1;for(let Kt=0;Kt=rt+2||me&&se>=ut+2)&&se>wt&&(wt=se,pt=(qt.x+Jt.x)/2,St=(qt.y+Jt.y)/2)}pt!==void 0&&St!==void 0&&(J.x=pt,J.y=St)}}}}}d(Ss,"collapseShortTerminalStub");var et=.001,Xt=8,at=Be,Ln=d((t,e)=>gt(t,e,et)||yt(t,e,et),"orthogonallyAligned");function Cs(t,e){const s=d((u,h)=>{const l=u.x??0,x=u.y??0,C=h.x-l,b=h.y-x;let v=(u.width??0)/2,L=(u.height??0)/2;return Math.abs(b)*v>Math.abs(C)*L?(b<0&&(L=-L),{x:l+(b===0?0:L*C/b),y:x+L}):(C<0&&(v=-v),{x:l+v,y:x+(C===0?0:v*b/C)})},"rectIntersect"),r=d((u,h)=>{const l=xt(u.points??[]);if(l.length<2)return;const x=h?u.start:u.end,C=x?e.get(x):void 0,b=C?te(C):void 0;if(!C||!x||!b)return;const v=h?l[0]:l[l.length-1],L=h?l[1]:l[l.length-2],y=s(C,v);let I=v;if(Ln(L,y)&&(I=L),gt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"V",coord:y.x,min:Math.min(y.y,I.y),max:Math.max(y.y,I.y),boundary:y,railEnd:I,rect:b};if(yt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"H",coord:y.y,min:Math.min(y.x,I.x),max:Math.max(y.x,I.x),boundary:y,railEnd:I,rect:b}},"terminalLaneFor"),i=d((u,h)=>Math.max(0,Math.min(u.max,h.max)-Math.max(u.min,h.min)),"projectedOverlapLength"),a=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&>(u.boundary,h.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&yt(u.boundary,h.boundary,1),"sameTerminalFace"),c=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:i(u,h)>=Xt&&Math.abs(u.coord-h.coord)<.5,"exactTerminalLaneConflict"),f=d((u,h)=>{if(u.nodeId!==h.nodeId||u.orientation!==h.orientation||u.orientation!=="H"||u.atStart===h.atStart)return!1;const l=i(u,h);if(l2*x?!1:a(u,h)&&Math.abs(u.coord-h.coord)<16},"nearTerminalLaneConflict"),g=d((u,h)=>{const l=xt(u.edge.points??[]);if(l.length<2)return;const x=u.orientation==="V"?{x:u.boundary.x+h,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+h},C=u.orientation==="V"?{x:u.railEnd.x+h,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+h};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?yt(x,u.boundary,et)&&x.x>=u.rect.left+1&&x.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?gt(x,u.boundary,et)&&x.y>=u.rect.top+1&&x.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const I=l.length>1&&ce(l[1],u.railEnd,et),E=l.slice(I?2:1),A=E[0];return A&&!Ln(A,C)?void 0:[x,C,...E]}const v=l.length>1&&ce(l[l.length-2],u.railEnd,et),L=l.slice(0,v?-2:-1),y=L[L.length-1];if(!(y&&!Ln(y,C)))return[...L,C,x]},"shiftedCandidate"),p=d(u=>{const h=u.edge,l=xt(h.points??[]);if(l.length!==2)return!1;const x=h.start,C=h.end,b=x?e.get(x):void 0,v=C?e.get(C):void 0;if(!b||!v)return!1;const L=b.x??0,y=b.y??0,I=v.x??0,E=v.y??0,[A,B]=l;return yt(A,B,et)&&Math.abs(y-E)<1&&Math.abs(L-I)>1||gt(A,B,et)&&Math.abs(L-I)<1&&Math.abs(y-E)>1},"laneIsStraightCollinearConnector"),M=[-7,7,-2*7,2*7,-3*7,3*7];for(let u=0;u<8;u++){const h=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let l=!1;for(let x=0;x{const A=p(I),B=p(E);return A!==B?Number(A)-Number(B):+!E.atStart-+!I.atStart});for(const I of y){for(const E of M){const A=g(I,E);if(!A)continue;const B=r({...I.edge,points:A},I.atStart);if(!(!B||h.some(O=>O.edge!==I.edge&&(c(B,O)||L&&f(B,O))))){I.edge.points=A,l=!0;break}}if(l)break}}if(!l)return}}d(Cs,"separateSharedRenderedTerminalLanes");function vs(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=d((a,c)=>{const f=a.start,g=a.end,p=at(c);if(p.length!==c.length-1)return!1;const M=[f,g].filter(u=>!!u);for(const u of p)if(Pt(u.a,u.b,o,M,-2)||Pt(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===a||u.isLayoutOnly)continue;const h=u.points;if(!(!h||h.length<2)){for(const l of p)for(const x of at(xt(h)))if(de(l,x,.5)>=Xt||he(l.a,l.b,x.a,x.b,et))return!1}}return!0},"candidateIsSafe"),i=d((a,c)=>{if(c+4>=a.length)return;const f=a[c],g=a[c+1],p=a[c+2],M=a[c+3],u=a[c+4],h=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&>(f,M,et)&>(f,u,et)&>(g,p,et)&&(g.x-f.x)*(M.x-p.x)<0,l=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&yt(f,M,et)&&yt(f,u,et)&&yt(g,p,et)&&(g.y-f.y)*(M.y-p.y)<0;if(h||l)return xt([...a.slice(0,c+1),u,...a.slice(c+5)]);if(c+5>=a.length)return;const x=a[c+5],C=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&Ot(u,x)&>(f,u,et)&>(f,x,et)&>(p,M,et)&&(p.x-g.x)*(u.x-M.x)<0,b=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&&Nt(u,x)&&yt(f,u,et)&&yt(f,x,et)&&yt(p,M,et)&&(p.y-g.y)*(u.y-M.y)<0;if(!(!C&&!b))return xt([...a.slice(0,c+1),x,...a.slice(c+6)])},"withoutDogleg");for(let a=0;a<8;a++){let c=!1;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(let p=0;p<=g.length-5;p++){const M=i(g,p);if(!(!M||!r(f,M))){f.points=M,c=!0;break}}if(c)break}if(!c)return}}d(vs,"collapseRedundantRectangularDoglegs");function zn(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(h=>!h.isLayoutOnly),c=d((h,l,x)=>xt(h===l?x??[]:h.points??[]),"pointsFor"),f=d((h,l)=>{let x=0;for(let C=0;C{const l=at(h);if(l.length!==3)return;const x=l[1];if(!(l[0].horizontal===x.horizontal||l[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);return r.filter(C=>{if(x.includes(C.id))return!1;const b=C.rect;return l.horizontal?Wt(l.a.x,l.b.x,b.left,b.right)>=Xt&&l.a.y>=b.top-2&&l.a.y<=b.bottom+2:Wt(l.a.y,l.b.y,b.top,b.bottom)>=Xt&&l.a.x>=b.left-2&&l.a.x<=b.right+2})},"blockingRectsFor"),M=d((h,l,x)=>{const C=h.map(v=>({...v}));if(l.horizontal)C[l.index].y=x,C[l.index+1].y=x;else if(l.vertical)C[l.index].x=x,C[l.index+1].x=x;else return;const b=ue(xt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),u=d((h,l,x)=>{const C=[h.start,h.end].filter(v=>!!v),b=at(l);if(b.length!==l.length-1)return!1;for(const v of b)if(Pt(v.a,v.b,r,C,-2)||Pt(v.a,v.b,i,[],-2))return!1;for(const v of a)if(v!==h){for(const L of b)for(const y of at(c(v)))if(de(L,y,.5)>=Xt)return!1}return f(h,l)<=x},"candidateIsSafe");for(let h=0;h<8;h++){const l=f();let x=!1;for(const C of a){const b=c(C),v=g(b);if(!v)continue;const L=p(C,v.segment);if(L.length===0)continue;const y=v.horizontal?[Math.min(...L.map(I=>I.rect.top))-20,Math.max(...L.map(I=>I.rect.bottom))+20]:[Math.min(...L.map(I=>I.rect.left))-20,Math.max(...L.map(I=>I.rect.right))+20];for(const I of y){const E=M(b,v.segment,I);if(!(!E||!u(C,E,l))){C.points=E,x=!0;break}}if(x)break}if(!x)return}}d(zn,"liftObstacleHuggingSameSideRails");function Vn(t,e){const o=d(c=>{const f=c.groupTitleRect;if(!(!f||typeof f.left!="number"||typeof f.right!="number"||typeof f.top!="number"||typeof f.bottom!="number"||!Number.isFinite(f.left)||!Number.isFinite(f.right)||!Number.isFinite(f.top)||!Number.isFinite(f.bottom)||f.right<=f.left||f.bottom<=f.top))return{left:f.left,right:f.right,top:f.top,bottom:f.bottom}},"validTitleRect"),s=d(c=>{if(!c.isGroup||c.parentId)return;const f=c.direction,g=typeof f=="string"?f.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const p=o(c),M=c.y,u=c.height;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(l<=0||h{if(!c.horizontal)return!1;const g=c.a.y;return g<=f.top+et||g>=f.bottom-et?!1:Wt(c.a.x,c.b.x,f.left,f.right)>=Xt},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(c=>!!c);if(i.length===0)return;let a=0;for(const c of t){if(c.isLayoutOnly)continue;const f=xt(c.points??[]);for(const g of at(f))for(const p of i)r(g,p.rect)&&(a=Math.max(a,p.rect.bottom-g.a.y+4))}if(!(a<=et))for(const c of i){const f=c.node.y,g=c.node.height;typeof f!="number"||typeof g!="number"||!Number.isFinite(f)||!Number.isFinite(g)||g<=0||(c.node.y=f-a/2,c.node.height=g+a,c.node.groupTitleRect={...c.rect,top:c.rect.top-a,bottom:c.rect.bottom-a})}}d(Vn,"liftTopLaneTitleBandsAboveRails");function jn(t,e){const o=d(f=>{const g=f.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId||f.direction!=="LR")return;const p=o(f),M=f.x,u=f.width;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(h<=0||l{if(!f.vertical)return!1;const p=f.a.x;return p<=g.left+et||p>=g.right-et?!1:Wt(f.a.y,f.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),i=d((f,g)=>{if(!f.horizontal)return!1;const p=f.a.y;return p<=g.top+et||p>=g.bottom-et?!1:Wt(f.a.x,f.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let c=0;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(const p of at(g))for(const M of a)if(r(p,M.rect))c=Math.max(c,M.rect.right-p.a.x+4);else if(i(p,M.rect)){const u=Math.min(p.a.x,p.b.x);c=Math.max(c,M.rect.right-u+4)}}if(!(c<=et))for(const f of a){const g=f.node.x,p=f.node.width;typeof g!="number"||typeof p!="number"||!Number.isFinite(g)||!Number.isFinite(p)||p<=0||(f.node.x=g-c/2,f.node.width=p+c,f.node.groupTitleRect={...f.rect,left:f.rect.left-c,right:f.rect.right-c})}}d(jn,"shiftLeftLaneTitleBandsLeftOfRails");function Ls(t,e){const{realNodeRects:o}=Me(e.values()),s=t.filter(h=>!h.isLayoutOnly),r=d((h,l=new Map)=>xt(l.get(h)??h.points??[]),"replacementPointsFor"),i=d((h=new Map)=>{let l=0;for(let x=0;xs.reduce((l,x)=>l+oe(r(x,h)),0),"totalBends"),c=d(h=>{const l=r(h);if(l.length<4)return;const x=l[l.length-2],C=l[l.length-1];if(!(!Nt(x,C,et)&&!Ot(x,C,et)))return{tailStart:x,terminal:C}},"terminalTailFor"),f=d((h,l)=>{const x=r(h);if(x.length<3)return;const C=x[0],b=x[1];let v;if(Nt(C,b,et))v={x:b.x,y:l.tailStart.y};else if(Ot(C,b,et))v={x:l.tailStart.x,y:b.y};else return;const L=ue(xt([C,b,v,l.tailStart,l.terminal]));return at(L).length===L.length-1?L:void 0},"candidateWithDestinationTail"),g=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);for(const C of at(l))if(Pt(C.a,C.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),p=d((h,l,x)=>{for(const C of s)if(C!==h){for(const b of at(l))for(const v of at(r(C,x)))if(de(b,v,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),M=d((h,l,x)=>!g(h,l)&&!p(h,l,x),"candidateIsSafe"),u=d(()=>{const h=new Map;for(const l of s){const x=l.end;if(!x||!e.has(x)||r(l).length<4)continue;const b=h.get(x)??[];b.push(l),h.set(x,b)}return h},"edgesByDestination");for(let h=0;h<4;h++){const l=i();if(l===0)return;const x=a();let C,b=l,v=x;for(const L of u().values())for(let y=0;y=l||G>b||G===b&&j>=v||(C=P,b=G,v=j)}if(!C)return;for(const[L,y]of C)L.points=y}}d(Ls,"swapDestinationTerminalTailsToReduceCrossings");function Es(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(L=>!L.isLayoutOnly),c=d((L,y=new Map)=>xt(y.get(L)??L.points??[]),"replacementPointsFor"),f=d((L=new Map)=>{let y=0;for(let I=0;Ia.reduce((y,I)=>y+oe(c(I,L)),0),"totalBends"),p=d(L=>{const y=L.start,I=L.end,E=y?e.get(y):void 0,A=I?e.get(I):void 0,B=E?te(E):void 0,O=A?te(A):void 0;return B&&O?{src:B,dst:O}:void 0},"endpointRectsFor"),M=d((L,y,I)=>{if(I.index<=0||I.index+1>=y.length-1)return;const E=p(L);if(E){if(I.vertical){const A=I.a.x,B=Math.min(E.src.left,E.dst.left),O=Math.max(E.src.right,E.dst.right),k=AO+et?"right":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"vertical",side:k,coord:A,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const A=I.a.y,B=Math.min(E.src.top,E.dst.top),O=Math.max(E.src.bottom,E.dst.bottom),k=AO+et?"bottom":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"horizontal",side:k,coord:A,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const L=[];for(const y of a){const I=c(y);for(const E of at(I)){const A=M(y,I,E);A&&L.push(A)}}return L},"collectExternalRails"),h=d((L,y)=>L.edge!==y.edge&&L.axis===y.axis&&L.side===y.side&&Wt(L.min,L.max,y.min,y.max)>=Xt,"railsInteract"),l=d(L=>{const y=[],I=new Set;for(const E of L){if(I.has(E))continue;const A=[E],B=[];for(I.add(E);A.length>0;){const O=A.pop();B.push(O);for(const k of L)!I.has(k)&&h(O,k)&&(I.add(k),A.push(k))}B.length>1&&y.push(B)}return y},"connectedComponents"),x=d(L=>{const y=[];for(const I of L)y.some(E=>Math.abs(E-I.coord){const y=L.map(A=>A.coord),I=x(L),E=[];if(L.length<=6){const A=new Array(I.length).fill(!1),B=[],O=d(()=>{if(B.length===L.length){B.some((k,H)=>Math.abs(k-y[H])>=et)&&E.push([...B]);return}for(const[k,H]of I.entries())A[k]||(A[k]=!0,B.push(H),O(),B.pop(),A[k]=!1)},"visit");return O(),E}for(let A=0;A{const I=new Map;for(const[A,B]of L.entries()){const O=y[A],k=I.get(B.edge)??B.points.map(H=>({x:H.x,y:H.y}));B.axis==="vertical"?(k[B.segmentIndex].x=O,k[B.segmentIndex+1].x=O):(k[B.segmentIndex].y=O,k[B.segmentIndex+1].y=O),I.set(B.edge,k)}const E=new Map;for(const[A,B]of I){const O=ue(xt(B));if(at(O).length!==O.length-1)return;E.set(A,O)}return E},"replacementsForAssignment"),v=d(L=>{for(const[y,I]of L){const E=[y.start,y.end].filter(A=>!!A);for(const A of at(I))if(Pt(A.a,A.b,r,E,-2)||Pt(A.a,A.b,i,[],-2))return!1}for(let y=0;y=Xt)return!1}}return!0},"candidateIsSafe");for(let L=0;L<4;L++){const y=f();if(y===0)return;let I,E=y,A=g(),B=Number.POSITIVE_INFINITY;for(const O of l(u()))for(const k of C(O)){const H=b(O,k);if(!H||!v(H))continue;const P=f(H);if(P>=y)continue;const G=g(H),j=O.reduce((tt,ft,Mt)=>tt+Math.abs(k[Mt]-ft.coord),0);P>E||P===E&&(G>A||G===A&&j>=B)||(I=H,E=P,A=G,B=j)}if(!I)return;for(const[O,k]of I)O.points=k}}d(Es,"reassignCrossingExternalRailChannels");function Ts(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,h,l)=>xt(u===h?l??[]:u.points??[]),"pointsFor"),a=d(u=>at(u).reduce((h,l)=>{const x=l.a.x-l.b.x,C=l.a.y-l.b.y;return h+Math.hypot(x,C)},0),"pathLength"),c=d((u,h)=>{let l=0;for(let x=0;x{if(u.horizontal){const l=u.a.y;return(Math.abs(l-h.top)<1||Math.abs(l-h.bottom)<1)&&Wt(u.a.x,u.b.x,h.left,h.right)>=Xt}if(u.vertical){const l=u.a.x;return(Math.abs(l-h.left)<1||Math.abs(l-h.right)<1)&&Wt(u.a.y,u.b.y,h.top,h.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const h=[u.start,u.end].filter(x=>!!x),l=[];for(const x of h){const C=e.get(x),b=C?te(C):void 0;b&&l.push(b)}return l},"endpointRectsFor"),p=d((u,h)=>{if(h+3>=u.length)return[];const l=u[h],x=u[h+1],C=u[h+2],b=u[h+3],v=Nt(l,x,et)&&Ot(x,C,et)&&Nt(C,b,et),L=Ot(l,x,et)&&Nt(x,C,et)&&Ot(C,b,et);if(!v&&!L)return[];if(!(v?Math.sign(x.x-l.x)!==Math.sign(b.x-C.x):Math.sign(x.y-l.y)!==Math.sign(b.y-C.y)))return[];const I=gt(l,b,et)||yt(l,b,et)?[]:[{x:l.x,y:b.y},{x:b.x,y:l.y}],E=I.length===0?[[...u.slice(0,h+1),...u.slice(h+3)]]:I.map(B=>[...u.slice(0,h+1),B,...u.slice(h+3)]),A=new Set;return E.map(B=>ue(xt(B))).filter(B=>{if(at(B).length!==B.length-1||!B.some(k=>ce(k,b,et)))return!1;const O=B.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return A.has(O)?!1:(A.add(O),!0)})},"shortcutCandidatesAt"),M=d((u,h,l)=>{const x=[u.start,u.end].filter(b=>!!b),C=g(u);for(const b of at(h))if(Pt(b.a,b.b,o,x,-2)||Pt(b.a,b.b,s,[],-2)||C.some(v=>f(b,v)))return!1;for(const b of r)if(b!==u){for(const v of at(h))for(const L of at(i(b)))if(de(v,L,.5)>=Xt)return!1}return c(u,h)<=l},"candidateIsSafe");for(let u=0;u<8;u++){const h=c();let l,x,C=h,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const L of r){const y=i(L),I=oe(y,et),E=a(y);for(let A=0;A<=y.length-4;A++)for(const B of p(y,A)){const O=oe(B,et),k=a(B);if(!(OC||P===C&&(O>b||O===b&&k>=v)||(l=L,x=B,C=P,b=O,v=k)}}if(!l||!x)return;l.points=x}}d(Ts,"shortcutRedundantOrthogonalJogs");function ws(t,e){const i=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const _=R.x??0,F=R.y??0,V=te(R);V&&i.push({id:String(R.id??""),cx:_,cy:F,rect:V})}if(i.length===0)return;const a=new Map(i.map(R=>[R.id,R])),c=i.map(R=>({id:R.id,rect:R.rect})),f=["top","bottom","left","right"],g={top:Math.min(...i.map(R=>R.rect.top))-20,bottom:Math.max(...i.map(R=>R.rect.bottom))+20,left:Math.min(...i.map(R=>R.rect.left))-20,right:Math.max(...i.map(R=>R.rect.right))+20},p=t.filter(R=>!R.isLayoutOnly),M=new Map(p.map((R,_)=>[R,_])),u=d(R=>{const _=R==="left"||R==="top"?-1:1,F=[];for(let V=0;V<=2;V++)F.push(g[R]+_*20*V);return F},"outwardTracksForSide"),h=d((R,_=new Map)=>xt(_.get(R)??R.points??[]),"replacementPointsFor"),l=d((R,_)=>{let F=0;for(const V of R)for(const K of _)he(V.a,V.b,K.a,K.b,et)&&F++;return F},"crossingCountBetweenSegments"),x=d((R,_)=>l(at(R),at(_)),"crossingCountBetweenPaths"),C=d((R=new Map)=>{let _=0;const F=[],V=new Set,K=[],Z=d(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y0&&(_+=T,F.push({first:q,second:w,count:T}),Z(q),Z(w))}}return K.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),{count:_,pairs:F,edgeSet:V,edges:K}},"crossingSnapshot"),b=d((R,_)=>{const F=new Set(_.keys());if(F.size===0)return R.count;let V=0;for(const Z of R.pairs)(F.has(Z.first)||F.has(Z.second))&&(V+=Z.count);let K=0;for(let Z=0;Z{const _=new Map;for(const K of R.pairs){const Z=_.get(K.first)??new Set;Z.add(K.second),_.set(K.first,Z);const Y=_.get(K.second)??new Set;Y.add(K.first),_.set(K.second,Y)}const F=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const Z=[K],Y=[];for(V.add(K);Z.length>0;){const q=Z.pop();Y.push(q);for(const m of _.get(q)??[])V.has(m)||(V.add(m),Z.push(m))}Y.sort((q,m)=>(M.get(q)??0)-(M.get(m)??0)),Y.length>1&&F.push(Y)}return F},"crossingComponents"),L=d(R=>[R.start,R.end].filter(_=>!!_),"endpointIdsFor"),y=d(R=>{const _=[];for(const F of v(R)){const V=new Set(F),K=new Set(F.flatMap(Y=>L(Y))),Z=[...F];for(const Y of p)V.has(Y)||L(Y).some(q=>K.has(q))&&Z.push(Y);Z.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),_.push(Z)}return _},"pairSearchGroups"),I=d((R,_,F)=>b(R,new Map([[_,F]])),"crossingCountWithSingleReplacement"),E=d(R=>{const _=new Map;for(const F of R.pairs)_.set(F.first,(_.get(F.first)??0)+F.count),_.set(F.second,(_.get(F.second)??0)+F.count);return _},"currentCrossingsByEdge"),A=d(R=>R.slice(1).reduce((_,F,V)=>{const K=R[V];return _+Math.abs(F.x-K.x)+Math.abs(F.y-K.y)},0),"pathLength"),B=d((R=new Map)=>p.reduce((_,F)=>_+oe(h(F,R)),0),"totalBends"),O=d((R=new Map)=>p.reduce((_,F)=>_+A(h(F,R)),0),"totalLength"),k=d((R,_,F=new Map)=>{const V=at(_);for(const K of p)if(K!==R){for(const Z of V)for(const Y of at(h(K,F)))if(de(Z,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),H=d((R,_)=>{const F=[R.start,R.end].filter(V=>!!V);for(const V of at(_))if(Pt(V.a,V.b,c,F,-2))return!0;return!1},"pathHitsNode"),P=d((R,_)=>{const F=ue(xt(_));at(F).length===F.length-1&&R.push(F)},"pushOrthogonalCandidate"),G=d(R=>R==="left"||R==="right","sideIsHorizontal"),j=d((R,_,F)=>{switch(_){case"left":return Math.min(R.x,F.x)-20;case"right":return Math.max(R.x,F.x)+20;case"top":return Math.min(R.y,F.y)-20;case"bottom":return Math.max(R.y,F.y)+20}},"localTrackForSameSide"),tt=d((R,_,F,V)=>{const K=F==="left"||F==="top"?-1:1,Z=[j(_,F,V),g[F]];for(const Y of Z)for(let q=0;q<=2;q++)P(R,ho(_,F,V,Y+K*20*q))},"addSameSideCandidates"),ft=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:Z,y:_.y},{x:Z,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),Mt=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:_.x,y:Z},{x:Y,y:Z},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Ht=d((R,_,F,V,K)=>{const Z=[...u("top"),...u("bottom")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:Y,y:_.y},{x:Y,y:m},{x:q,y:m},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),Ft=d((R,_,F,V,K)=>{const Z=[...u("left"),...u("right")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:_.x,y:Y},{x:m,y:Y},{x:m,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=d(R=>{const _=new Set;return R.map(F=>xt(F)).filter(F=>{const V=F.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return _.has(V)||F.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),J=d((R,_,F,V)=>{const K=[],Z=uo(R,_,F,V,20,et);Z&&P(K,Z),_===V&&tt(K,R,_,F);const Y=G(_),q=G(V);return Y&&!q?ft(K,R,_,F,V):!Y&&q?Mt(K,R,_,F,V):Y?Ht(K,R,_,F,V):Ft(K,R,_,F,V),nt(K)},"buildCandidatesForSides"),rt=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="top"||Y==="bottom"?u(Y):Z;for(const S of K){P(R,[_,F,{x:S,y:F.y},{x:S,y:q.y},q]);for(const w of m)P(R,[_,F,{x:S,y:F.y},{x:S,y:w},{x:q.x,y:w},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="left"||Y==="right"?u(Y):K;for(const S of Z){P(R,[_,F,{x:F.x,y:S},{x:q.x,y:S},q]);for(const w of m)P(R,[_,F,{x:F.x,y:S},{x:w,y:S},{x:w,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=d(R=>{const _=R.start,F=R.end,V=F?a.get(F):void 0;if(!_||!V)return[];const K=xt(R.points??[]);if(K.length<4)return[];const Z=K[0],Y=K[1],q=[];return Ot(Z,Y,et)?rt(q,Z,Y,V):Nt(Z,Y,et)&&ut(q,Z,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=d(R=>{const _=R.start,F=R.end,V=_?a.get(_):void 0,K=F?a.get(F):void 0;if(!V||!K)return[];const Z=[];for(const Y of f){const q=Le(V,Y);for(const m of f)Z.push(...J(q,Y,Le(K,m),m))}return Z.push(...pt(R)),Z},"candidatePathsFor"),wt=d(()=>new Map(p.map(R=>[R,at(h(R))])),"currentSegmentsByEdge"),Kt=d((R,_,F)=>{const V=new Set;for(const K of p){if(K===R)continue;const Z=F.get(K)??at(h(K));_.some(Y=>Z.some(q=>de(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=d((R,_,F,V)=>{const K=new Set;return St(R).map(Y=>ue(xt(Y))).filter(Y=>{if(H(R,Y))return!1;const q=Y.map(m=>`${m.x.toFixed(3)},${m.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let m=0;for(const S of p)S!==R&&(m+=l(q,F.get(S)??at(h(S))));return{candidate:Y,candidateSegments:q,crossings:_.count-(V.get(R)??0)+m,bends:oe(Y,et),totalBends:oe(Y),length:A(Y)}}).filter(({crossings:Y})=>Y<=_.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,F),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Jt=d((R,_,F,V,K,Z)=>{let Y=0;for(const m of R.pairs)(m.first===_||m.second===_||m.first===V||m.second===V)&&(Y+=m.count);let q=l(F.segments,K.segments);for(const m of p){if(m===_||m===V)continue;const S=Z.get(m)??at(h(m));q+=l(F.segments,S)+l(K.segments,S)}return R.count-Y+q},"pairCrossingCount"),se=d((R,_)=>{for(const F of R.sharedTrackConflicts)if(F!==_)return!1;return!0},"conflictsOnlyWith"),Ee=d((R,_)=>R.segments.some(F=>_.segments.some(V=>de(F,V,.5)>=Xt)),"candidatesShareTrack"),me=d((R,_,F,V)=>se(_,F.edge)&&se(V,R.edge)&&!Ee(_,V),"pairCandidatesAreCompatible"),Te=d((R,_,F,V,K)=>{const Z=Jt(R.current,_.edge,F,V.edge,K,R.baseSegments);if(!(Z>=R.current.count))return{replacements:new Map([[_.edge,F.path],[V.edge,K.path]]),crossings:Z,bends:R.currentBends-(R.baseBendsByEdge.get(_.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+F.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(_.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+F.length+K.length}},"scorePairReplacement"),mn=d((R,_)=>R.crossings<_.crossings||R.crossings===_.crossings&&(R.bends<_.bends||R.bends===_.bends&&R.length<_.length),"pairScoreIsBetter"),yn=d((R,_,F,V)=>{let K=V;for(const Z of _.candidates)for(const Y of F.candidates){if(!me(_,Z,F,Y))continue;const q=Te(R,_,Z,F,Y);q&&mn(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),pn=d(R=>{const _=B(),F=O(),V=wt(),K=E(R),Z=new Map(p.map(T=>[T,oe(h(T))])),Y=new Map(p.map(T=>[T,A(h(T))])),q=new Map,m=y(R);for(const T of m)for(const N of T){if(q.has(N))continue;const D=qt(N,R,V,K);D.length>0&&q.set(N,{edge:N,candidates:D})}let S={replacements:new Map,crossings:R.count,bends:_,length:F};const w={current:R,currentBends:_,currentLength:F,baseBendsByEdge:Z,baseLengthByEdge:Y,baseSegments:V};for(const T of m){const N=new Set(T.filter(W=>R.edgeSet.has(W))),D=T.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W0?S.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const _=C(),F=_.count;if(F===0)return;let V,K,Z=F,Y=Number.POSITIVE_INFINITY;for(const m of _.edges){const S=oe(h(m),et);for(const w of St(m)){const T=H(m,w),N=!T&&k(m,w),D=I(_,m,w),W=oe(w,et);T||N||!(DZ||D===Z&&W>=Y||(V=m,K=w,Z=D,Y=W)}}if(V&&K){V.points=K;continue}const q=pn(_);if(!q)return;for(const[m,S]of q)m.points=S}}d(ws,"resolveRenderedOrthogonalCrossings");var be=.001,Zr=8;function As(t,e){const{nodeInfoById:n,realNodeRects:o}=un(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(l=>l.rect.top))-r,bottom:Math.max(...o.map(l=>l.rect.bottom))+r,left:Math.min(...o.map(l=>l.rect.left))-r,right:Math.max(...o.map(l=>l.rect.right))+r},a=d((l,x,C,b)=>{const v=[],L=uo(l,x,C,b,r,be);return L&&v.push(L),x===b&&v.push(ho(l,x,C,i[x])),v},"buildOrthogonalPathCandidates"),c=d((l,x)=>{for(let C=0;C{let b=0;const v=Be(l,be),L=x.start,y=x.end;for(const I of t){if(I===x||I.isLayoutOnly)continue;const E=I.start,A=I.end;if(!C&&L&&y&&(E===L||E===y||A===L||A===y))continue;const B=I.points;if(!(!B||B.length<2))for(const O of v)for(const k of Be(B,be)){if(mo(O.a,O.b,k.a,k.b,be,be)){b++;continue}de(O,k,be)>=Zr&&b++}}return b},"pathConflictCount"),g=4,p=d((l,x)=>{const C=Math.abs(l.y-x.rect.top),b=Math.abs(l.y-x.rect.bottom),v=Math.abs(l.x-x.rect.left),L=Math.abs(l.x-x.rect.right);let y="top",I=C;return b{const b=M.get(l)??[];b.push({side:x,edgeId:C}),M.set(l,b)},"addFaceClaim");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points??[];if(x.length<1)continue;const C=l.id??"",b=l.start,v=l.end;if(b){const L=n.get(b);L&&u(b,p(x[0],L),C)}if(v){const L=n.get(v);L&&u(v,p(x[x.length-1],L),C)}}const h=d((l,x,C)=>{var b;return((b=M.get(l))==null?void 0:b.some(v=>v.edgeId!==C&&v.side===x))??!1},"faceIsClaimed");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points;if(!x||x.length<2)continue;const C=oe(x,be);if(C0){const Mt=f(tt,l,!0);if(Mt>O||Mt===O&&ft>=k)continue;O=Mt,k=ft,B=tt;continue}f(tt,l)>A||ftG.edgeId!==I));const P=M.get(v);P&&M.set(v,P.filter(G=>G.edgeId!==I)),u(b,p(B[0],L),I),u(v,p(B[B.length-1],y),I)}}}d(As,"simplifyDetouredEdges");var Qt=.001,Fo=10,Ke=7;function Un(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,a=r.y-s.y;if(!(Math.abs(i)+Math.abs(a)r&&en(t,Rs(r)))}d(Wn,"labelOverlapsOwnMarker");function Je(t,e){const n=[];for(const h of t){if(h.isLayoutOnly)continue;const l=h.points;if(!(!l||l.length<2))for(let x=0;x{const x=Nn(l,r);for(const{nodeId:C,rect:b}of o)if(C!==h&&en(x,b))return!0;return!1},"labelOverlapsForeignNode"),f=d((h,l)=>{const x=Nn(l,r);for(const C of n)if(C.edgeId!==h&&dn(C.p1,C.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),g=d((h,l,x)=>c(h,x)||f(l,x),"labelOverlapsAnything"),p=[],M=d(h=>{for(const{id:l,rect:x}of s)if(ss(x,h))return l},"findContainingLane"),u=d((h,l)=>p.some(x=>x.labelId!==h&&en(l,x.rect)),"overlapsPlacedLabel");for(const h of t){if(h.isLayoutOnly)continue;const l=h.labelNodeId;if(!l)continue;const x=e.get(l);if(!x)continue;const C=h.points;if(!C||C.length<2)continue;const b=x.width??0,v=x.height??0;if(b<=0||v<=0)continue;const L=[];for(let nt=0;nt=Qt&&pt>=Qt||L.push({idx:nt,length:ut+pt,orientation:ut>=Qt?"horizontal":"vertical",midX:(J.x+rt.x)/2,midY:(J.y+rt.y)/2})}if(L.length===0)continue;const y=L.length>=3?L.filter(nt=>nt.idx>0&&nt.idx0?y:L,E=b>=v?"horizontal":"vertical",A=d(nt=>[...nt].sort((J,rt)=>{const ut=J.orientation===E,pt=rt.orientation===E;if(ut!==pt)return ut?-1:1;const St=J.length>=(J.orientation==="horizontal"?b:v)+2,wt=rt.length>=(rt.orientation==="horizontal"?b:v)+2;return St!==wt?St?-1:1:rt.length-J.length}),"rankSegments"),B=L[0],O=L[L.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((nt,J)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*J,midY:rt.y+(ut.y-rt.y)*J}},"anchorAtT"),P=d((nt,J,rt)=>Math.min(rt,Math.max(J,nt)),"clamp"),G=d((nt,J)=>nt.midX>=J.left-Qt&&nt.midX<=J.right+Qt&&nt.midY>=J.top-Qt&&nt.midY<=J.bottom+Qt,"pointInsideRectInclusive"),j=d(nt=>{const J=Pe(nt.midX,nt.midY,b,v),rt=M(J);if(rt)return{laneId:rt,anchor:nt,rect:J};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const pt=ut.rect.left+b/2+i,St=ut.rect.right-b/2-i,wt=ut.rect.top+v/2+i,Kt=ut.rect.bottom-v/2-i;if(pt>St||wt>Kt)return;const qt={midX:P(nt.midX,pt,St),midY:P(nt.midY,wt,Kt)},Jt=Pe(qt.midX,qt.midY,b,v);return G(nt,Jt)?{laneId:ut.id,anchor:qt,rect:Jt}:void 0},"placementForAnchor"),tt=d((nt,J,rt)=>nt.orientation==="horizontal"?Math.abs(J.midX-rt.x):Math.abs(J.midY-rt.y),"distanceAlongSegment"),ft=d((nt,J)=>{const ut=(nt.orientation==="horizontal"?b/2:v/2)+a;if(nt===B){const pt=C[nt.idx];if(tt(nt,J,pt)+Qt{const J=A(nt);for(const rt of J)for(const ut of k){const pt=H(rt,ut);if(!ft(rt,pt))continue;const St=j(pt);if(St&&!Wn(St.rect,C)&&!u(l,St.rect)&&!g(l,h.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Ht=d((nt,J,rt=!1)=>{const ut=A(nt);for(const pt of ut){const St={midX:pt.midX,midY:pt.midY};if(J&&!ft(pt,St))continue;const wt=j(St);if(wt&&!Wn(wt.rect,C)&&!u(l,wt.rect)&&!c(l,wt.rect)&&(rt||!f(h.id,wt.rect)))return{laneId:wt.laneId,anchor:wt.anchor}}},"findLaneContainingFallback"),Ft=Mt(I)??(I.lengthrt.labelId===l);J>=0?p[J]={labelId:l,rect:nt}:p.push({labelId:l,rect:nt})}}}d(Je,"anchorLabelsToPolyline");var En=1e-6,Qr=8,Do=Qr/2,ti=3;function Kn(t,e){return t{const g=Kn(a,c);let p=0;const M=d(u=>{if(!u)return;const h=s.get(u);if(!h)return;const l=f==="x"?h.w/2:h.h/2;l>p&&(p=l)},"consider");M(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const h=u.start,l=u.end;!h||!l||Kn(h,l)===g&&M(u.labelNodeId)}return p>0?p+ti:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const a=i.points;if(!lo(a,En))continue;const c=go(i,n,En);if(!c)continue;const{srcId:f,dstId:g,srcInfo:p,dstInfo:M,collinearX:u,collinearY:h}=c;if(u===h)continue;let l,x;if(u){const y=M.cy>p.cy;l={x:p.cx,y:y?p.rect.bottom:p.rect.top},x={x:M.cx,y:y?M.rect.top:M.rect.bottom}}else{const y=M.cx>p.cx;l={x:y?p.rect.right:p.rect.left,y:p.cy},x={x:y?M.rect.left:M.rect.right,y:M.cy}}if(Pt(l,x,o,[f,g],1))continue;const b=r(i,f,g,u?"x":"y"),v=b>Do?b:Do,L=[0,v,-v];for(const y of L){const I={...l},E={...x};if(u){if(I.x+=y,E.x+=y,I.x<=p.rect.left||I.x>=p.rect.right||E.x<=M.rect.left||E.x>=M.rect.right)continue}else if(I.y+=y,E.y+=y,I.y<=p.rect.top||I.y>=p.rect.bottom||E.y<=M.rect.top||E.y>=M.rect.bottom)continue;if(!Pt(I,E,o,[f,g],1)&&!nn(I,E,t,i,{epsilon:En})){i.points=[I,E];break}}}}d(Ns,"straightenCollinearSiblingDetours");function qn(t,e){const{realNodeRects:c,labelNodeRects:f}=Me(e.values()),g=d((y,I)=>Be(I,.001).map(E=>({...E,edge:y,interior:E.index>=1&&E.index<=I.length-3})),"segmentsFor"),p=d(()=>{const y=[];for(const I of t){if(I.isLayoutOnly)continue;const E=I.points;!E||E.length<2||y.push(...g(I,xt(E)))}return y},"allSegments"),M=d((y,I)=>y.horizontal&&I.horizontal?Wt(y.a.x,y.b.x,I.a.x,I.b.x)>=8&&Math.abs(y.a.y-I.a.y)<7:y.vertical&&I.vertical?Wt(y.a.y,y.b.y,I.a.y,I.b.y)>=8&&Math.abs(y.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((y,I)=>{const E=y.start,A=y.end,B=g(y,I);if(B.length!==I.length-1)return!1;const O=[E,A].filter(H=>!!H),k=y.labelNodeId?[y.labelNodeId]:[];for(const H of B)if(Pt(H.a,H.b,c,O,-2)||Pt(H.a,H.b,f,k,-2))return!1;for(const H of t){if(H===y||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of B)for(const j of g(H,xt(P)))if(M(G,j)||he(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),h=d((y,I)=>{const E=xt(y.edge.points??[]);if(E.length<4||y.index>=E.length-1)return;const A=E.map(B=>({...B}));if(y.horizontal)A[y.index].y+=I,A[y.index+1].y+=I;else if(y.vertical)A[y.index].x+=I,A[y.index+1].x+=I;else return;return g(y.edge,A).length===A.length-1?A:void 0},"shiftedCandidate"),l=d((y,I)=>({x:y.x??(I.left+I.right)/2,y:y.y??(I.top+I.bottom)/2}),"nodeCenter"),x=d(y=>{const I=y.edge,E=xt(I.points??[]);if(E.length!==4||y.index!==1)return;const A=I.start?e.get(I.start):void 0,B=I.end?e.get(I.end):void 0,O=A?te(A):void 0,k=B?te(B):void 0,H=E.slice(y.index+2);if(!(!A||!B||!O||!k||H.length===0))return{sourceCenter:l(A,O),targetCenter:l(B,k),sourceRect:O,tail:H}},"sourceDetourContextFor"),C=d((y,I,E,A,B,O)=>{const k=A.y>=E.y,H=k?B.bottom:B.top,P=H+(k?20:-20);if(k&&y.b.y<=P+.001||!k&&y.b.y>=P-.001)return;const G=y.a.x+I;return xt([{x:E.x,y:H},{x:E.x,y:P},{x:G,y:P},{x:G,y:y.b.y},...O],.001)},"verticalSourceDetour"),b=d((y,I,E,A,B,O)=>{const k=A.x>=E.x,H=k?B.right:B.left,P=H+(k?20:-20);if(k&&y.b.x<=P+.001||!k&&y.b.x>=P-.001)return;const G=y.a.y+I;return xt([{x:H,y:E.y},{x:P,y:E.y},{x:P,y:G},{x:y.b.x,y:G},...O],.001)},"horizontalSourceDetour"),v=d((y,I)=>{const E=x(y);if(E){if(y.vertical)return C(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(y.horizontal)return b(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),L=[-7,7,-2*7,2*7,-3*7,3*7];for(let y=0;y<12;y++){const I=p();let E=!1;for(let A=0;AP.interior);for(const P of H){for(const G of L){const j=h(P,G);if(j&&u(P.edge,j)){P.edge.points=j,E=!0;break}const tt=v(P,G);if(tt&&u(P.edge,tt)){P.edge.points=tt,E=!0;break}}if(E)break}}if(!E)return}}d(qn,"nudgeSharedInteriorSubpaths");function Os(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=s*a-r*i;if(Math.abs(c)<1e-10)return!1;const f=n.x-t.x,g=n.y-t.y,p=(f*a-g*i)/c,M=(f*r-g*s)/c,u=.01;return p>u&&p<1-u&&M>u&&M<1-u}d(Os,"segmentsIntersect");function Ps(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=rs(e),r=[];for(const a of n){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<2)continue;const f=a.start,g=a.end,p=a.labelNodeId,M=a.id??`${f}->${g}`;for(const u of s)if(!(u.nodeId===f||u.nodeId===g)&&!(p&&u.nodeId===p)){for(let h=0;h0){const a=o.filter(f=>f.type==="edge-node-overlap").length,c=o.filter(f=>f.type==="edge-edge-crossing").length;Qe.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${a} edge-node overlap(s), ${c} edge crossing(s)`);for(const f of o)Qe.warn(`[SWIMLANE_VALIDATE] ${f.type}: ${f.detail}`)}return o}d(Ps,"validateSwimlanesLayout");function Bs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Ms(t,e)||e==="BT"&&s.length>0&&!bs(t))return;for(const a of o){if(a.isLayoutOnly)continue;const c=a.points;!c||c.length<2||(a.points=ue(on(c)))}As(o,n),Ns(o,n),Is(o,n);const r=new Map;for(const a of n)r.set(String(a.id),a);Je(o,r),fs(o,r),Ss(o,r),qn(o,r),Cs(o,r),vs(o,r),zn(o,r),Ls(o,r);const i=d(()=>{ws(o,r),Es(o,r),Ts(o,r),Je(o,r),Gn(o,r),zn(o,r),Je(o,r),Gn(o,r)},"finalizeRenderedEdges");i(),qn(o,r),i(),Vn(o,r),jn(o,r),Vn(o,r),jn(o,r)}d(Bs,"postProcessSwimlaneLayout");function Ie(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(Ie,"normalizeGraph");function Mo(t,e){return t.edges.filter(n=>n.dst===e)}d(Mo,"incoming");function ks(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(ks,"buildSuccessorMap");function Io(t){const e=ks(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(Io,"buildSortedSuccessorMap");function So(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(So,"buildInDegreeMap");function Co(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(Co,"sortedZeroInDegreeNodes");function hn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(hn,"buildPredecessorSuccessorMaps");function vo(t,e,n,o){var i,a;let s=0;for(const c of t.nodes)o!=null&&o.skipGroups&&((i=t.nodeById.get(c))!=null&&i.isGroup)||(s=Math.max(s,n[c]??0));const r=Array.from({length:s+1},()=>[]);for(const c of e)o!=null&&o.skipGroups&&((a=t.nodeById.get(c))!=null&&a.isGroup)||r[Math.max(0,n[c]??0)].push(c);return r}d(vo,"buildLayersFromRanks");function De(t){const e=So(t),n=Co(e),o=[],s=Io(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let a=0;for(;a{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),a=o,c=r,f=o;for(;a=s||ap.dst===M.dst?p.id.localeCompare(M.id):p.dst.localeCompare(M.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const p of n.get(g)??[]){const M=p.dst;o[M]===0?r(M):o[M]===1&&s.push(p)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,p)=>g.localeCompare(p));for(const g of i)o[g]===0&&r(g);const a=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),c=e.edges.map(g=>a.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:c,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(_s,"removeCycles_DFS");function Fs(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const a=n(r)??r;return e.set(o,a),a},"resolve");for(const o of t.nodes)n(o);return e}d(Fs,"buildTopLaneMap");function ge(t){const e=Fs(t);return n=>e.get(n)??null}d(ge,"createTopLaneResolver");function gn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(gn,"buildTopLaneOrder");function Eo(t,e){const n=gn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(Eo,"resolveTopLaneOrder");var ei={EPSILON:1e-6},ln={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Ho={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Ds(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=hn(n);for(const y of r.values())y.sort((I,E)=>I.localeCompare(E));const i=De(n)??[...n.nodes].sort((y,I)=>y.localeCompare(I)),a=new Map;for(const[y,I]of i.entries())a.set(I,y);const c=new Map,f=new Map;for(const y of n.nodes)f.set(y,[]);for(const y of i){const I=(r.get(y)??[]).filter(E=>c.has(E));if(I.length>0){const E=Hs(y,I,{laneOf:o,rankHint:s,topoIndex:a});c.set(y,E),f.get(E).push(y)}else c.has(y)||c.set(y,null)}for(const y of n.nodes)c.has(y)||c.set(y,null);const g=new Set;for(const y of n.nodes)(c.get(y)??null)===null&&g.add(y);const p=[...g].sort((y,I)=>{const E=a.get(y)??0,A=a.get(I)??0;return E===A?y.localeCompare(I):E-A}),M=Xs(n),u=new Map;for(const[y,I]of M.entries())u.set(y,[...I].sort((E,A)=>E.localeCompare(A)));const h=Ys(u),l=Gs(u),x=new Map;for(const y of n.nodes)x.set(y,[]);for(const y of l)for(const I of y.nodes){const E=x.get(I);E?E.push(y.id):x.set(I,[y.id])}const C=[],b=[],v=new Set,L=d(y=>{if(!v.has(y)){v.add(y),C.push(y);for(const I of f.get(y)??[])L(I);b.push(y)}},"walk");for(const y of p)L(y);for(const y of i)L(y);return{parent:c,children:f,roots:p,componentOf:h,blocks:l,nodeBlocks:x,adjacency:u,preorder:C,postorder:b,topologicalOrder:i}}d(Ds,"buildDrivingTree");function Hs(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{var l,x;const a=n.laneOf(r),c=n.laneOf(i),f=a!=null&&a===o,g=c!=null&&c===o;if(f!==g)return f?-1:1;const p=(l=n.rankHint)==null?void 0:l[r],M=(x=n.rankHint)==null?void 0:x[i];if(p!=null&&M!=null&&p!==M)return M-p;const u=n.topoIndex.get(r)??0,h=n.topoIndex.get(i)??0;return u!==h?u-h:r.localeCompare(i)})[0]}d(Hs,"chooseParent");function Xs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Xs,"buildAdjacency");function Ys(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Ys,"assignComponents");function Gs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((a,c)=>{e.set(a,++r),n.set(a,r);for(const f of t.get(a)??[])f!==c&&(e.has(f)?(e.get(f)??0)<(e.get(a)??0)&&(o.push([a,f]),n.set(a,Math.min(n.get(a)??r,e.get(f)??r))):(o.push([a,f]),i(f,a),n.set(a,Math.min(n.get(a)??r,n.get(f)??r)),(n.get(f)??0)>=(e.get(a)??0)&&s.push($s(a,f,o,s.length))))},"visit");for(const a of t.keys())e.has(a)||i(a,null);return s}d(Gs,"computeBlocks");function $s(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d($s,"popBlock");function zs(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,v]of o.entries())s.set(v,b);const r=o.length,i=new Array(r).fill(-1),a=new Array(r).fill(0),c=[],f=new Set;for(const b of o){const v=n.parent.get(b)??null,L=s.get(b);L!=null&&v==null&&(i[L]=-1,a[L]=0,f.has(b)||(f.add(b),c.push(b)))}for(;c.length>0;){const b=c.shift(),v=s.get(b);if(v==null)continue;const L=n.children.get(b)??[];for(const y of L){if(f.has(y))continue;const I=s.get(y);I!=null&&(i[I]=v,a[I]=a[v]+1,f.add(y),c.push(y))}}for(const b of o){if(f.has(b))continue;const v=s.get(b);v!=null&&(i[v]=-1,a[v]=0,f.add(b))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),p=Array.from({length:g},()=>new Array(r).fill(-1));for(let b=0;b{if(b===-1||v===-1)return-1;a[b]>y&1&&(b=p[y][b],b===-1))return-1;if(b===v)return b;for(let y=g-1;y>=0;y--){const I=p[y][b],E=p[y][v];I===-1||E===-1||I!==E&&(b=I,v=E)}return p[0][b]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const b of t.edges){let v=b.src,L=b.dst,y=e[v],I=e[L];if(y==null||I==null||(y>I&&([v,L]=[L,v],[y,I]=[I,y]),y==null||I==null||y===I))continue;const E=s.get(v),A=s.get(L);if(E==null||A==null)continue;const B=M(E,A);if(B===-1)continue;const O=u[B];for(let k=y;k{if(v.size!==0)for(const[L,y]of v)b.set(L,(b.get(L)??0)+y)},"mergeInto"),x=new Set,C=d(b=>{const v=s.get(b);x.add(b);const L=v==null?void 0:u[v],y=L?new Map(L):new Map,I=n.children.get(b)??[];for(const E of I){const A=C(E),B=e[b];if(B!=null){let O=h.get(b);O||(O=new Map,h.set(b,O));let k=A.get(B)??0;const H=e[E];H!=null&&H>B&&(k+=1),O.set(E,k)}l(y,A)}return y},"dfs");for(const b of n.roots)x.has(b)||C(b);for(const b of o)x.has(b)||C(b);return h}d(zs,"computeSubtreeCrossCounts");function Vs(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const a=[...e.get(r)??[]];a.sort(To(n));for(const c of a){s(c);const f=o.get(c);f!=null&&(i=Math.min(i,f))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Vs,"annotateMinimumLayers");function To(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(To,"compareByRankThenId");function js(t,e,n,o){let s=0;for(const c of e){const f=n[c]??0;f>s&&(s=f)}const r=Array.from({length:s+1},()=>[]),i=new Set,a=d(c=>{if(i.has(c))return;i.add(c);const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c);for(const g of o(c))a(g)},"emit");for(const c of t)a(c);for(const c of e)if(!i.has(c)){const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c),i.add(c)}return r}d(js,"emitNodesInTreeOrder");function Us(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Us,"deduplicateLayers");function Ws(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,a=[],c=[],f=n.get(s);for(const g of r){const p=o.get(g)??i;p>i?a.push({child:g,min:p}):c.push(g)}return a.sort((g,p)=>g.min===p.min?g.child.localeCompare(p.child):g.min-p.min),c.sort((g,p)=>{const M=(f==null?void 0:f.get(g))??0,u=(f==null?void 0:f.get(p))??0;if(M!==u)return M-u;const h=o.get(g)??i,l=o.get(p)??i;return h!==l?h-l:g.localeCompare(p)}),[...a.map(g=>g.child),...c]}}d(Ws,"createChildOrderer");function fn(t,e,n){const o=Ds(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const p of t.nodes)s.has(p)||s.set(p,[]);const i=zs(t,e,o),a=[...r].sort(To(e)),c=Vs(a,s,e),f=Ws(s,e,i,c);let g=js(a,t.nodes,e,f);return g=Us(g),g}d(fn,"buildMultitreeLayerOrder");function Ks(t,e,n){const o=new Set(t),s=new Set(e),r=ke(e),i=[];for(const a of n)o.has(a.src)&&s.has(a.dst)&&i.push(r.get(a.dst));return Lo(i)}d(Ks,"countCrossingsBetweenAdjacent");function Jn(t,e,n){const o=[];for(const r of e){const i=n[r.src],a=n[r.dst];if(i==null||a==null||i===a)continue;let c=r.src,f=r.dst,g=i,p=a;i>a&&(c=r.dst,f=r.src,g=a,p=i);for(let M=g;M(n[M]??0)-(n[p]??0));for(const p of g){const M=n[p]??0;if(M===0)continue;let u=0;for(const C of o.get(p)??[])u=Math.max(u,(n[C]??0)+1);if(u>=M)continue;const h=M;n[p]=u;const l=fn(t,n,s),x=Jn(l,t.edges,n);x(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(l=>l.src===s);if(i.length===0)continue;let a=!1,c=0;for(const l of i){const x=n(l.dst);x==null||x===r?a=!0:c++}if(c===0||a)continue;let f=0,g=!1;for(const l of t.edges){if(l.dst!==s)continue;const x=n(l.src);x&&(x===r?g=!0:f++)}if(f>0||!g)continue;const p=e[s]??0,M=p+c;let u=0;for(const l of t.edges)l.dst===s&&(u=Math.max(u,(e[l.src]??0)+1));const h=Math.max(p,u,M);h!==p&&(e[s]=h)}}d(Js,"adjustCrossLaneSources");function Zs(t,e){const n=Ie(t),o=De(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=ge(n);let i=Object.create(null);for(const c of o){const f=Mo(n,c),g=e!=null&&e.ignoreCrossLaneEdges?f.filter(p=>{const M=r(p.src),u=r(c);return!M||!u?!0:M===u}):f;if(g.length===0)i[c]=0;else if(s&&g.length===1){const p=g[0].src,M=r(p),u=r(c);M!==u?i[c]=i[p]??0:i[c]=(i[p]??0)+1}else{let p=-1/0;for(const M of g)p=Math.max(p,(i[M.src]??0)+1);i[c]=p===-1/0?0:p}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(i=qs(n,i)),e!=null&&e.ignoreCrossLaneEdges&&Js(n,i),{layers:fn(n,i,r),rankOf:i,dummy:new Set}}d(Zs,"assignLayers_LongestPath");function Qs(t,e){const n=Ie(t),s={...Zs(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=ge(n),{preds:i,succs:a}=hn(n,h=>{if(e!=null&&e.ignoreCrossLaneEdges){const l=r(h.src),x=r(h.dst);if(l&&x&&l!==x)return!1}return!0}),c=De(n)??[...n.nodes],f=[...c].reverse(),g=d((h,l)=>{let x=0;for(const v of i.get(h)??[])x=Math.max(x,(s[v]??0)+1);let C=Number.POSITIVE_INFINITY;const b=a.get(h)??[];return b.length>0&&(C=Math.min(...b.map(v=>(s[v]??0)-1))),Number.isFinite(C)||(C=Math.max(x,l)),Math.min(Math.max(l,x),C)},"clampFeasible"),p=ln.GRAVITY_ITERATIONS,M=d(h=>{let l=!1;for(const x of h){const C=i.get(x)??[],b=a.get(x)??[];if(C.length===0&&b.length===0)continue;const v=C.length>0?C.reduce((E,A)=>E+(s[A]??0)+1,0)/C.length:s[x]??0,L=b.length>0?b.reduce((E,A)=>E+(s[A]??0)-1,0)/b.length:s[x]??0,y=Math.round((v+L)/2),I=g(x,y);I!==s[x]&&(s[x]=I,l=!0)}return l},"relaxOrder");for(let h=0;h0){const x=Math.min(...l.map(C=>(s[C]??0)-1));(s[h]??0)>x&&(s[h]=x)}}return{layers:vo(n,c,s),rankOf:s,dummy:new Set}}d(Qs,"assignLayers_Gravity");function tr(t){const e=So(t),n=Io(t);let o=Co(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const a of n.get(i)??[])e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0&&r.push(a)}o=r.sort((i,a)=>i.localeCompare(a))}return s.length===t.nodes.length?s:null}d(tr,"topoSortByGenerationIfAcyclic");function er(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?tr(n)??[...n.nodes].sort():De(n)??[...n.nodes].sort(),s=ge(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),a=new Map,c=d((g,p)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(g)===r(p)?1:0:1,"edgeWeight");for(const g of o){const p=n.nodeById.get(g);if(p!=null&&p.isGroup)continue;const M=Mo(n,g);let u=0;if(M.length>0)for(const C of M){const b=C.src,v=i[b]??0;u=Math.max(u,v+c(b,g))}const h=r(g),l=a.get(h)??0,x=Math.max(u,l);i[g]=x,a.set(h,x+1)}return{layers:vo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(er,"assignLayers_LaneAwareCompact");function nr(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const a=new Map(n.nodeById),c=d(u=>{const h=`placeholder-${i++}`,l={id:h,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(h,l),r.add(h);s.length<=u;)s.push([]);return s[u].push(h),o[h]=u,h},"addDummyAt"),f=[...n.edges].sort((u,h)=>u.id===h.id?u.src===h.src?u.dst.localeCompare(h.dst):u.src.localeCompare(h.src):u.id.localeCompare(h.id)),g=[];for(const u of f){const h=o[u.src]??0,l=o[u.dst]??0;if(l-h<=1){g.push(u);continue}let x=u.src;for(let b=h+1,v=0;b!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:a};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:M}}d(nr,"makeProperLayering");function Zn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Zn,"median");function Qn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Qn,"barycenter");function or(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(or,"neighborPositionsFor");function sr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(sr,"currentOrderTieBreak");function to(t,e,n){const o=new Set(t),s=new Set(e),r=ke(t),i=ke(e),a=[];for(const f of n)o.has(f.src)&&s.has(f.dst)&&a.push({u:r.get(f.src),v:i.get(f.dst)});a.sort((f,g)=>f.u===g.u?f.v-g.v:f.u-g.u);const c=a.map(f=>f.v);return Lo(c)}d(to,"countCrossingsBetweenAdjacent");function Ze(t,e,n){return[...t].sort((o,s)=>{const r=Zn(e.get(o)??[]),i=Zn(e.get(s)??[]);return r===i?sr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(Ze,"sortByHeuristic");function eo(t,e,n,o,s,r){const i=ke(t),a=ke(e),c=or(e,i,n,o);if(!s||!r||r.length===0)return Ze(e,c,a);const f=new Map;for(const M of e){const u=s(M),h=f.get(u)??[];h.push(M),f.set(u,h)}const g=[];for(const M of r){const u=f.get(M);if(!u||u.length===0)continue;const h=Ze(u,c,a);g.push(...h)}const p=f.get(null);if(p&&p.length>0){const M=Ze(p,c,a);for(const u of M){const h=Qn(c.get(u)??[]);let l=g.length;if(isFinite(h))for(const[x,C]of g.entries()){const b=Qn(c.get(C)??[]);if(hi.has(l.src)&&a.has(l.dst)),g=c?n.filter(l=>a.has(l.src)&&c.has(l.dst)):void 0,p=d(l=>{let x=to(t,l,f);return g&&o&&(x+=to(l,o,g)),x},"crossingScore"),M=s?new Map:null;if(s&&M)for(const l of e)M.set(l,s(l));let u=!0,h=p(r);for(;u;){u=!1;for(let l=0;l+1[...a]),s=e.edges,r=ge(e),i=Eo(e,n==null?void 0:n.laneOrder);for(let a=0;a<3;a++){for(let c=1;c=0;c--)o[c]=eo(o[c+1],o[c],s,"up",r,i),o[c]=no(o[c+1],o[c],s,o[c-1],r)}return{layers:o}}d(rr,"orderLayers");function ir(t,e,n){const o=(n==null?void 0:n.layerGap)??Ho.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??Ho.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,i=(n==null?void 0:n.direction)??"TB",a=i==="LR"||i==="RL",c=t.layers,f=Object.create(null),g=Object.create(null),p=d(O=>e.nodeById.get(O),"getNode"),M=d(O=>{var k;return((k=p(O))==null?void 0:k.width)??0},"getWidth"),u=d(O=>{var k;return((k=p(O))==null?void 0:k.height)??0},"getHeight"),h=ge(e),l=Eo(e,n==null?void 0:n.laneOrder),x=c.map(O=>O.reduce((k,H)=>Math.max(k,u(H)),0)),C=[];if(a)for(let O=0;O+1Math.max(Mt,M(Ht)),0),H=c[O+1].reduce((Mt,Ht)=>Math.max(Mt,M(Ht)),0),P=x[O],G=x[O+1],j=P/2+G/2,tt=(k+H)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of c)for(const k of O)b.add(h(k));const v=b.has(null),L=l.filter(O=>b.has(O)),y=[...v?[null]:[],...L],I=Object.create(null);for(const O of L)I[O]=0;v&&(I.null=0);for(const O of c){const k=Object.create(null),H=[];for(const P of O){const G=h(P);G===null?H.push(P):(k[G]||(k[G]=[])).push(P)}for(const[P,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+M(ft),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(v&&H.length){const P=H.reduce((G,j)=>G+M(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const E=new Map;{const O=y.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,y.length-1))/2;for(let P=0;PM(nt)),Ht=Mt.reduce((nt,J)=>nt+J,0)+s*(tt.length-1);let Ft=ft-Ht/2;for(const[nt,J]of tt.entries()){const rt=Mt[nt];f[J]=Ft+rt/2,g[J]=A+H/2,Ft+=rt+s}}}const G=C[O]??0;A+=H+o+G}const B=new Map;for(const O of e.edges){const k=O.ref.id;B.has(k)||B.set(k,[]),B.get(k).push(O)}for(const[,O]of B){if(O.length===0)continue;const k=O[0].ref,H=k.start,P=k.end;if(H==null||P==null)continue;const G=Math.round(((f[H]??0)+(f[P]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===H||tt===P)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(f[tt]=G)}}return{x:f,y:g}}d(ir,"assignCoordinates");var cr=8;function ar(t){let e=2166136261;for(let n=0;n>>0}d(ar,"hashString");function lr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(lr,"mulberry32");function fr(t,e){const n=[...t],o=lr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(fr,"deterministicShuffle");function dr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(dr,"sourceDistance");function oo(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const a=n.get(s),c=n.get(r);a==null||c==null||(o+=i*Math.abs(a-c))}return o}d(oo,"laneArrangementCost");function ur(t){const e=gn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=ge(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,a=typeof r.end=="string"?r.end:void 0;if(!i||!a||!t.nodeById.has(i)||!t.nodeById.has(a))continue;const c=o(i),f=o(a);if(!c||!f||c===f)continue;const g=n.get(c),p=n.get(f);if(g==null||p==null)continue;const[M,u]=g<=p?[c,f]:[f,c],h=`${M}\0${u}`,l=s.get(h);l?l.weight++:s.set(h,{a:M,b:u,weight:1})}return[...s.values()]}d(ur,"buildWeightedLaneEdges");function so(t,e,n){const o=[...t];let s=oo(o,e),r=!0,i=0;const a=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return ar(`${t.join("|")}#${o}#${n}`)}d(gr,"seedForRestart");function mr(t,e={}){const n=gn(t);if(n.length<2)return n;const o=ur(t);if(o.length===0)return n;const s=new Map(n.map((a,c)=>[a,c]));let r=so(n,o,s);const i=Math.max(0,e.restarts??cr);for(let a=0;alt&&c*3>=a?i>0?"bottom":"top":a>lt?r>0?"right":"left":n}d(ro,"chooseOrthogonalSide");function io(t,e){return Math.abs(t.to-e.from)m.isGroup&&!m.parentId);for(const m of f){const S={id:m.id},w=d(T=>{i.set(T.id,S),n.filter(N=>N.parentId===T.id).forEach(w)},"assignLane");w(m)}const g=n.filter(m=>!m.isGroup&&!m.isEdgeLabel).map(m=>{const S=m.width??10,w=m.height??10,T=m.x??0,N=m.y??0,D=ni;return{nodeId:m.id,minX:T-S/2-D,maxX:T+S/2+D,minY:N-w/2-D,maxY:N+w/2+D,visualXHalfExtent:c?w/2+D:S/2+D}}),p=d((m,S,w,T)=>{let N=a.find(D=>D.orientation===m&&Math.abs(D.coord-S)<1);return N||(N={id:`pipe-${m}-${S.toFixed(0)}`,orientation:m,coord:S,spanMin:w,spanMax:T,tracks:[]},a.push(N)),N.spanMin=Math.min(N.spanMin,w),N.spanMax=Math.max(N.spanMax,T),N},"getOrAddPipe"),M=d((m,S)=>{const w=m.width??10,T=m.height??10,N=m.x??0,D=m.y??0;switch(S){case"top":return{x:N,y:D-T/2};case"bottom":return{x:N,y:D+T/2};case"left":return{x:N-w/2,y:D};case"right":return{x:N+w/2,y:D}}},"portForSide"),u=d((m,S,w)=>M(m,ro(m,S,w?"bottom":"top")),"getOrthogonalPort"),h=[],l=[],x=new Set,C=1e3,b=d((m,S,w)=>{if(h.length===0)return 0;const T=Math.abs(S.y-w.y)U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}else if(N){const W=S.x,ot=Math.min(S.y,w.y)-lt,U=Math.max(S.y,w.y)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="horizontal"||z.pipe.coordU||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}return D},"crossingPenalty"),v=s.map((m,S)=>{if(!m.start||!m.end)return{idx:S,crossLane:0,dx:0,dy:0};const w=r.get(m.start),T=r.get(m.end),N=i.get(m.start),D=i.get(m.end),W=N&&D&&N.id!==D.id?1:0,ot=w&&T?Math.abs((T.x??0)-(w.x??0)):0,U=w&&T?Math.abs((T.y??0)-(w.y??0)):0;return{idx:S,crossLane:W,dx:ot,dy:U}}).sort((m,S)=>{if(m.crossLane!==S.crossLane)return S.crossLane-m.crossLane;const w=m.dx+m.dy,T=S.dx+S.dy;return Math.abs(w-T)>1?w-T:m.idx-S.idx}).map(m=>m.idx),L=d((m,S,w,T)=>{const N=Math.min(m.x,S.x),D=Math.max(m.x,S.x),W=Math.min(m.y,S.y),ot=Math.max(m.y,S.y);return!!g.find(z=>w&&z.nodeId===w||T&&z.nodeId===T?!1:Math.abs(m.x-S.x)>lt?z.minYm.y&&z.maxX>N&&z.minXm.x&&z.maxY>W&&z.minYro(m,S,"bottom"),"determineSide"),A=new Map;for(const[m,S]of s.entries()){if(!S.start||!S.end||S.start===S.end||S.points&&S.points.length>0)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const N=(T.x??0)-(w.x??0),D=(T.y??0)-(w.y??0);A.set(m,{edgeIdx:m,srcId:S.start,dstId:S.end,srcSide:E(w,{x:T.x??0,y:T.y??0}),dstSide:E(T,{x:w.x??0,y:w.y??0}),absDx:Math.abs(N),absDy:Math.abs(D),dxSign:Math.sign(N),dySign:Math.sign(D)})}const B=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.absDx===0?1/0:m.absDy/m.absDx:m.absDy===0?1/0:m.absDx/m.absDy,"preferenceStrength"),O=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.dxSign>=0?"right":"left":m.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const m of A.values()){const S=`${m.srcId}:${m.srcSide}`;k.has(S)||k.set(S,[]),k.get(S).push(m)}const H=new Map,P=d((m,S)=>`${m}:${S}`,"loadKey");for(const m of A.values())H.set(P(m.srcId,m.srcSide),(H.get(P(m.srcId,m.srcSide))??0)+1),H.set(P(m.dstId,m.dstSide),(H.get(P(m.dstId,m.dstSide))??0)+1);for(const m of k.values())if(!(m.length<2)){m.sort((S,w)=>{const T=B(S),N=B(w);return Math.abs(T-N)>1e-9?N-T:S.edgeIdx-w.edgeIdx});for(let S=1;S=N||(H.set(P(w.srcId,w.srcSide),N-1),H.set(P(w.srcId,T),D+1),w.srcSide=T)}}const G=d(m=>{const S=m==null?void 0:m.shape;return S==="question"||S==="diamond"},"isDiamondNode"),j=new Map;for(const m of A.values())j.has(m.dstId)||j.set(m.dstId,new Set),j.get(m.dstId).add(m.dstSide);for(const m of A.values()){if(!G(r.get(m.srcId)))continue;const S=j.get(m.srcId);if(!(S!=null&&S.has(m.srcSide)))continue;const w=O(m);if(S.has(w)||(H.get(P(m.srcId,w))??0)>0)continue;const T=H.get(P(m.srcId,m.srcSide))??0;H.set(P(m.srcId,m.srcSide),Math.max(0,T-1)),H.set(P(m.srcId,w),1),m.srcSide=w}for(const m of A.values()){const{edgeIdx:S,srcId:w,dstId:T,srcSide:N,dstSide:D}=m,W=r.get(w),ot=r.get(T),U=`${w}:${N}:src`,z=N==="top"||N==="bottom"?ot.x??0:ot.y??0;y.has(U)||y.set(U,[]),y.get(U).push({edgeIdx:S,oppositeCoord:z});const bt=`${T}:${D}:dst`,dt=D==="top"||D==="bottom"?W.x??0:W.y??0;y.has(bt)||y.set(bt,[]),y.get(bt).push({edgeIdx:S,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[m,S]of y){if(S.length<2)continue;S.sort((At,Gt)=>At.oppositeCoord-Gt.oppositeCoord);const w=m.split(":"),T=w.slice(0,-2).join(":"),N=w[w.length-2],D=w[w.length-1],W=r.get(T);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,z=W.shape,dt=z==="question"||z==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(S.length+1))),Bt=-(st*(S.length-1))/2;for(const[At,Gt]of S.entries()){const ee=Bt+At*st,xn=`${Gt.edgeIdx}:${D}`;tt.set(xn,ee)}}const Mt=d(m=>{var S;return!!((S=s[m])!=null&&S.labelNodeId)},"edgeHasLabelNode"),Ht=d((m,S)=>m?(y.get(`${m}:${S}:src`)??[]).some(({edgeIdx:w})=>Mt(w))||(y.get(`${m}:${S}:dst`)??[]).some(({edgeIdx:w})=>Mt(w)):!1,"faceHasLabelNode"),Ft=d((m,S,w)=>S==="top"||S==="bottom"?{x:m.x+w,y:m.y}:{x:m.x,y:m.y+w},"applyPortOffset"),nt=d((m,S,w)=>{const T=A.get(m),N={x:w.x??0,y:w.y??0},D={x:S.x??0,y:S.y??0},W=(T==null?void 0:T.srcSide)??E(S,N),ot=(T==null?void 0:T.dstSide)??E(w,D);let U=T?M(S,T.srcSide):u(S,N,!0),z=T?M(w,T.dstSide):u(w,D,!1);const bt=tt.get(`${m}:src`),dt=tt.get(`${m}:dst`);return bt!==void 0&&(U=Ft(U,W,bt)),dt!==void 0&&(z=Ft(z,ot,dt)),{pSrcPort:U,pDstPort:z,srcSide:W,dstSide:ot}},"portsForEdge");for(const m of v){const S=s[m];if(l[m]=[],!S.start||!S.end||S.points&&S.points.length>0||S.start===S.end)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const{pSrcPort:N,pDstPort:D,srcSide:W,dstSide:ot}=nt(m,w,T),U={...N},z={...D},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(w.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(w.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=D.y>(T.y??0);z.y=X?D.y+ie:D.y-ie}else{const X=D.x>(T.x??0);z.x=X?D.x+ie:D.x-ie}const ct=d((X,$)=>{for(const Q of g)if(!$.includes(Q.nodeId)&&X.x>Q.minX&&X.xQ.minY&&X.y{if(Tt){const kt=X.y>($.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Ce:ht.minX-Ce,y:kt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:kt}}const Ct=X.x>($.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Ce:ht.minX-Ce,y:Rt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:Ct}},"obstacleDetour");let It=[];const Bt=[S.start,S.end],At=ct(U,Bt);if(At.inside&&At.obstacle){const X=At.obstacle;if(bt){const $=st(N,w,T,X,!0);U.x=$.x,U.y=$.y;const Q=$.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);It=[{x:N.x,y:Q},{x:$.x,y:Q},{x:$.x,y:$.y}]}else{const $=st(N,w,T,X,!1),Q=$.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=$.x,U.y=$.y,It=[{x:Q,y:N.y},{x:Q,y:$.y},{x:$.x,y:$.y}]}}let Gt=[];const ee=ct(z,Bt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const $=st(D,T,w,X,!0);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:D.x,y:$.y}]}else{const $=st(D,T,w,X,!1);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:$.x,y:D.y}]}}if(It.length===0&&Gt.length===0){const X=Ce,$=Math.abs(U.x-z.x)1||Ct>1,kt=I.get(S.start??"")??0,mt=I.get(S.end??"")??0,Vt=Tt>1&&Ht(S.start,W)||Ct>1&&Ht(S.end,ot),re=Tt<=1||kt<=2,Dt=Ct<=1||mt<=2;if(($||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Dt)&&!L(N,D,S.start,S.end)){S.points=[{...N},{...U},{...z},{...D}],x.add(m);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,D.x):Math.min(N.y,D.y),Et=Q?Math.max(N.x,D.x):Math.max(N.y,D.y),Zt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${m}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Et,tracks:[]};h.push({edgeIndex:m,segmentIndex:0,orientation:vt,pipe:Zt,trackIndex:0,from:Lt,to:Et});continue}}const xn=p("vertical",U.x,U.y,U.y);U.x=xn.coord;const Mr=p("vertical",z.x,z.y,z.y);z.x=Mr.coord;let ye=Math.min(U.x,z.x)-50,pe=Math.max(U.x,z.x)+50,we=Math.min(U.y,z.y)-50,Ae=Math.max(U.y,z.y)+50;for(const X of g){const $=Math.min(U.x,z.x),Q=Math.max(U.x,z.x),ht=Math.min(U.y,z.y),Tt=Math.max(U.y,z.y);X.minX$&&X.minYht&&(ye=Math.min(ye,X.minX-qe),pe=Math.max(pe,X.maxX+qe),we=Math.min(we,X.minY-qe),Ae=Math.max(Ae,X.maxY+qe))}for(const X of g){if(X.maxXpe||X.maxYAe)continue;const $=Ce;p("horizontal",X.minY-$,ye,pe),p("horizontal",X.maxY+$,ye,pe);const Q=Ne;p("vertical",X.minX-Q,we,Ae),p("vertical",X.maxX+Q,we,Ae)}p("horizontal",U.y,ye,pe),p("horizontal",z.y,ye,pe);const Ir=a.filter(X=>X.orientation==="horizontal"&&X.coord>=we&&X.coord<=Ae),Sr=a.filter(X=>X.orientation==="vertical"&&X.coord>=ye&&X.coord<=pe),He=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),Xe=He(U.x,U.y),wo=He(z.x,z.y),Ye=new Map,bn=new Map,Mn=new Map,Ge=new Set,Se=[];Ye.set(Xe,0),Mn.set(Xe,"n"),Se.push({key:Xe,f:Math.hypot(z.x-U.x,z.y-U.y),pt:U}),Ge.add(Xe);let $t=[];const xe=d((X,$)=>L(X,$,S.start,S.end),"checkSegmentBlocked"),In={x:z.x,y:U.y},Cr=xe(U,In),vr=xe(In,z),Lr=Cr||vr,Sn={x:U.x,y:z.y},Er=xe(U,Sn),Tr=xe(Sn,z);if(Lr?Er||Tr||(Math.abs(U.x-z.x)0;){Se.sort((mt,Vt)=>mt.f-Vt.f);const X=Se.shift();if(Ge.delete(X.key),X.key===wo){let mt=wo,Vt=z;for($t=[Vt];bn.has(mt);){const re=bn.get(mt);$t.unshift(re),Vt=re,mt=He(re.x,re.y)}break}const $=X.pt.x,Q=X.pt.y,ht=Sr.sort((mt,Vt)=>mt.coord-Vt.coord),Tt=ht.findIndex(mt=>Math.abs(mt.coord-$)<1),Ct=Ir.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];Tt>0&&kt.push({x:ht[Tt-1].coord,y:Q}),Tt>=0&&Tt0&&kt.push({x:$,y:Ct[Rt-1].coord}),Rt>=0&&Rtne.nodeId===S.start||ne.nodeId===S.end?!1:Vt!==re?ne.minYQ&&ne.maxX>Vt&&ne.minX$&&ne.maxY>Dt&&ne.minY10&&Cn<-5||Re<-10&&Cn>5)&&(Et=Math.abs(Cn)*100),(Zt>10&&$e<-5||Zt<-10&&$e>5)&&(Et+=Math.abs($e)*50);let Ao=0;const Ro=Mn.get(X.key)??"n",No=Math.abs($e)>lt?"h":"v";Ro!=="n"&&Ro!==No&&(Ao=50);const wr=Ut+Lt+Et+Ao,ze=(Ye.get(X.key)??1/0)+wr,Oo=Math.abs(z.x-mt.x)+Math.abs(z.y-mt.y);if(ze<(Ye.get(vt)??1/0))if(bn.set(vt,X.pt),Ye.set(vt,ze),Mn.set(vt,No),!Ge.has(vt))Se.push({key:vt,f:ze+Oo,pt:mt}),Ge.add(vt);else{const ne=Se.findIndex(Ar=>Ar.key===vt);ne!==-1&&(Se[ne].f=ze+Oo)}}}if($t.length===0&&($t=[U,{x:U.x,y:z.y},z]),$t.length>4){const X=$t[0],$=$t[$t.length-1];let Q=Math.min(X.x,$.x),ht=Math.max(X.x,$.x),Tt=Math.min(X.y,$.y),Ct=Math.max(X.y,$.y);for(const Dt of $t)Q=Math.min(Q,Dt.x),ht=Math.max(ht,Dt.x),Tt=Math.min(Tt,Dt.y),Ct=Math.max(Ct,Dt.y);const Rt=ht>Math.max(X.x,$.x),kt=QLt.minXjt&&Lt.minY_t);if(Ut.length>0){let Lt=Math.max(X.x,$.x);for(const Et of Ut){const Zt=(Et.minX+Et.maxX)/2;if(Et.visualXHalfExtent===void 0||isNaN(Et.visualXHalfExtent))continue;const Re=Zt+Et.visualXHalfExtent+Dt;Lt=Math.max(Lt,Re)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=g.filter(_t=>_t.minXMath.min(X.y,$.y));if(jt.length>0){let _t=Math.min(X.x,$.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Dt;_t=Math.min(_t,Lt)}Q=_t}}}const mt=d(Dt=>{const jt=$.y>X.y,_t=g.filter(Lt=>{const Et=Math.min(X.x,$.x)Lt.minX,Zt=Math.min(X.y,$.y)Lt.minY;return Et&&Zt});let vt=_t;if(c&&_t.length>0){const Lt=_t.filter(Et=>Et.minXDt);Lt.length>0&&(vt=Lt)}if(vt.length===0)return $.y;const Ut=Ce;if(jt){const Et=Math.max(...vt.map(Zt=>Zt.maxY))+Ut;if(Et<$.y-lt)return Et}else{const Et=Math.min(...vt.map(Zt=>Zt.minY))-Ut;if(Et>$.y+lt)return Et}return $.y},"findBestReturnY"),Vt=d(Dt=>{const jt=mt(Dt),_t={x:Dt,y:X.y},vt={x:Dt,y:jt},Ut={x:$.x,y:jt},Lt=xe(X,_t),Et=xe(_t,vt),Zt=xe(vt,Ut),Re=jt!==$.y?xe(Ut,$):!1;return!Lt&&!Et&&!Zt&&!Re?Math.abs(jt-$.y)=3){const X=zt[zt.length-1],$=zt[zt.length-2],Q=zt[zt.length-3],ht=Math.abs(Q.y-$.y)Math.abs(X.x-Q.x)&&zt.splice(-2,1)}else if(Tt){const Ct=Math.sign($.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs($.y-Q.y)>Math.abs(X.y-Q.y)&&zt.splice(-2,1)}}const fe=[zt[0]];for(let X=1;X$.x,Ct=ht.x>Q.x;if(Tt!==Ct){fe.push(Q);continue}continue}if(Math.abs($.x-Q.x)$.y,Ct=ht.y>Q.y;if(Tt!==Ct){fe.push(Q);continue}continue}fe.push(Q)}fe.push(zt[zt.length-1]);for(let X=0;Xm.from{const N=!T.segments.some(W=>(W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex)&&J(W,m)),D=!w.segments.some(W=>(W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex)&&J(W,S));return N&&D?(m.trackIndex=T.index,S.trackIndex=w.index,w.segments=[...w.segments.filter(W=>W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex),{edgeIndex:S.edgeIndex,segmentIndex:S.segmentIndex,from:S.from,to:S.to}],T.segments=[...T.segments.filter(W=>W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex),{edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=d(m=>{const S=m.tracks.length;return m.tracks[S]={index:S,coord:m.coord,segments:[]},S},"createNewTrack"),pt=d((m,S)=>{const w=m.pipe.tracks[m.trackIndex];w.segments=w.segments.filter(N=>N.edgeIndex!==m.edgeIndex||N.segmentIndex!==m.segmentIndex),m.trackIndex=S,m.pipe.tracks[S].segments.push({edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to})},"moveSegmentToTrack"),St=d((m,S)=>{const w=l[m.edgeIndex];for(const T of w){const N=h[T];N.pipe===m.pipe&&pt(N,S)}},"moveSegmentChainToTrack"),wt=d(m=>{const S=l[m.edgeIndex],w=S.indexOf(h.indexOf(m)),T=[];return w>0&&T.push(h[S[w-1]]),w{if(m.orientation===S.orientation)return!1;const w=m.orientation==="horizontal"?m:S,T=m.orientation==="horizontal"?S:m;return T.pipe.coord>w.from&&T.pipe.coordT.from&&w.pipe.coord{for(const w of m.tracks)if(!w.segments.some(N=>(N.edgeIndex!==S.edgeIndex||N.segmentIndex!==S.segmentIndex)&&J(N,S)))return w.index;return-1},"findAvailableTrack"),Jt=d((m,S)=>{if(m.trackIndex===S.trackIndex)return J(m,S);const w=wt(m),T=wt(S);return w.some(N=>T.some(D=>Kt(N,D)))},"segmentsConflict"),se=d((m,S,w)=>{if(rt(m,S,m.pipe.tracks[m.trackIndex],S.pipe.tracks[S.trackIndex]))return;const T=qt(m.pipe,S);w(S,T!==-1?T:ut(m.pipe))},"resolveTrackConflict"),Ee=d(m=>{let S=0;for(let w=0;w{if(me.has(m))return me.get(m);const S=l[m];if(S.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return me.set(m,ot),ot}const T=h[S[0]].pipe.coord;let N=T;for(let ot=1;otMath.abs(bt-T)?z:bt;break}}const D=Math.abs(N-T),W={dest:N,deviation:D,base:T,delta:N-T};return me.set(m,W),W},"getDestInfo"),mn=d(()=>{let m=0;const S=new Map;for(const[T,N]of s.entries())l[T].length!==0&&N.start&&(S.has(N.start)||S.set(N.start,[]),S.get(N.start).push(T));const w=d(T=>{const N=s[T];if(!N.start||!N.end)return 0;const D=r.get(N.start),W=r.get(N.end);if(!D||!W)return 0;const ot=(W.x??0)-(D.x??0),U=(W.y??0)-(D.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const T of S.values()){T.sort((D,W)=>{const ot=Te(D),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const z=w(D),bt=w(W);if(Math.abs(z-bt)>1)return bt-z;const dt=l[D].length,ct=l[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=l[D][0],It=l[W][0];if(h[st]&&h[It]){const Bt=h[st],At=h[It],Gt=Math.abs(Bt.to-Bt.from),ee=Math.abs(At.to-At.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=T.map(D=>h[l[D][0]]);m+=Ee(N)}return m},"fixSourceHandleCrossings"),yn=d(()=>{let m=0;const S=new Map;for(const[w,T]of s.entries())l[w].length!==0&&T.end&&(S.has(T.end)||S.set(T.end,[]),S.get(T.end).push(w));for(const w of S.values()){w.sort((N,D)=>{const W=d(z=>{const bt=l[z];if(bt.length<2)return 0;const dt=h[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(D);return Math.abs(ot-U)>.1?ot-U:N-D});const T=w.map(N=>h[l[N][l[N].length-1]]);m+=Ee(T)}return m},"fixTargetHandleCrossings"),pn=d(()=>{let m=0;for(const S of a){const w=[];for(const T of S.tracks)for(const N of T.segments){const D=l[N.edgeIndex].find(W=>h[W].segmentIndex===N.segmentIndex);D!==void 0&&w.push(h[D])}w.sort((T,N)=>T.edgeIndex-N.edgeIndex||T.segmentIndex-N.segmentIndex);for(let T=0;T{T.segments.forEach(N=>{S.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:T.index,from:N.from,to:N.to})})}),S.sort((T,N)=>T.from-N.from);const w=[];if(S.length>0){let T=[S[0]],N=S[0].to;for(let D=1;DN.add(st.trackIndex));const D=new Map;T.forEach(st=>{const It=Te(st.edgeIndex);D.set(st.trackIndex,(D.get(st.trackIndex)??0)+It.delta)});const W=[...N].filter(st=>(D.get(st)??0)<-1),ot=[...N].filter(st=>(D.get(st)??0)>1),U=[...N].filter(st=>Math.abs(D.get(st)??0)<=1);W.sort((st,It)=>(D.get(It)??0)-(D.get(st)??0)),ot.sort((st,It)=>(D.get(st)??0)-(D.get(It)??0));const z=d((st,It)=>{T.filter(Bt=>Bt.trackIndex===st).forEach(Bt=>{const At=x.has(Bt.edgeIndex)?m.coord:It;F.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,At)})},"assignCoord");let bt=0;for(const st of W)bt++,z(st,m.coord-bt*Tn);if(U.length===0&&N.size>0){const st=[...N].sort((At,Gt)=>Math.abs(D.get(At)??0)-Math.abs(D.get(Gt)??0))[0],It=W.indexOf(st);It!==-1&&W.splice(It,1);const Bt=ot.indexOf(st);Bt!==-1&&ot.splice(Bt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)z(st,m.coord);else{const It=dt%2===1?1:-1,Bt=Math.ceil(dt/2);z(st,m.coord+It*Bt*Tn*.5)}dt++}let ct=0;for(const st of ot)ct++,z(st,m.coord+ct*Tn)}}for(const[m,S]of s.entries()){const w=l[m]??[];if(w.length===0)continue;const T=[],N=r.get(S.start),D=r.get(S.end),{pSrcPort:W,pDstPort:ot}=nt(m,N,D),U=w.map(dt=>{const ct=h[dt],st=F.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});T.push(W);for(let dt=0;dtlt&&T.push(ve(ct,It)),Gt&&At.orient===ct.orient)if(Math.abs(ct.coord-At.coord)>lt){const ee=ct.orient==="vertical"?(It+At.from)/2:io(ct,At);T.push(ve(ct,ee),ve(At,ee))}else(dt===0||dt===U.length-2)&&T.push(ve(ct,io(ct,At)));else if(Gt)T.push(ve(ct,At.coord));else{const ee=Math.abs(ct.from-It)lt||Math.abs(z.y-ot.y)>lt)&&T.push(ot);const bt=[];T.length>0&&bt.push(T[0]);for(let dt=1;dtlt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}S.points=bt}for(const m of s){const S=m.__originalEdge;S&&m.points&&(S.points=m.points)}t.edges=(t.edges??[]).filter(m=>!m.isLayoutOnly);const V=d((m,S)=>{const w=S.x??0,T=S.y??0,N=S.width??0,D=S.height??0;if(N<=0||D<=0)return m;const W=w-N/2,ot=w+N/2,U=T-D/2,z=T+D/2;if(m.xot||m.yz)return m;const bt=m.x-W,dt=ot-m.x,ct=m.y-U,st=z-m.y,It=Math.min(bt,dt,ct,st);return It===bt?{x:W,y:m.y}:It===dt?{x:ot,y:m.y}:It===ct?{x:m.x,y:U}:{x:m.x,y:z}},"nodeBoundaryClamp");for(const m of t.edges){const S=m.points;if(!S||S.length<2)continue;const w=m.start,T=m.end,N=w?r.get(w):void 0,D=T?r.get(T):void 0;N&&(S[0]=V(S[0],N)),D&&(S[S.length-1]=V(S[S.length-1],D))}return t}d(pr,"routeEdgesOrthogonal");function xr(t){return t.direction??"TB"}d(xr,"getSwimlaneDirection");function br(t){var g,p,M,u,h;const e=es(t),n=((g=t.config.flowchart)==null?void 0:g.nodeSpacing)??40,o=((p=t.config.flowchart)==null?void 0:p.rankSpacing)??100,s=((M=t.config.swimlane)==null?void 0:M.ignoreCrossLaneEdges)??!0,r=((u=t.config.swimlane)==null?void 0:u.optimizeRanksByCrossings)??!0,i=((h=t.config.swimlane)==null?void 0:h.automaticLaneOrdering)??!1,a=xr(t),{ordered:c,coordinates:f}=yr(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:a});ns(e,c,f,{nodeGap:n,layerGap:o});for(const l of t.edges??[])delete l.points;pr(t,a);for(const l of t.edges??[])(!l.curve||l.curve==="basis")&&(l.curve="rounded");return Bs(t,a),Ps(t),a}d(br,"runSwimlaneLayoutCore");async function oi(t,e){const n=e.select("g");Or(n,t.markers,t.type,t.diagramId),Pr(),Br(),kr(),Nr(),ts(t);const o=os(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await Xo(n,t);br(t),await Jo(t,s)}d(oi,"render");export{oi as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js deleted file mode 100644 index bfdfc08ca..000000000 --- a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D8bBal3H.js +++ /dev/null @@ -1,8 +0,0 @@ -import{c as r,s as e}from"./flowDiagram-UKHOOZJN-CvT_V9C-.js";import{a}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import"./chunk-5VM5RSS4-CjM7JLQ8.js";import"./chunk-XXDRQBXY-DWj8dVYC.js";import"./chunk-KBJHAD2P-CNEAUy5I.js";import"./chunk-2GRJ4B5K-CJwzhEYx.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-Cb_XsJlf.js";var o=a(t=>`${e(t)} - .swimlane.cluster rect { - stroke: ${t.clusterBorder} !important; - } - [data-look="neo"].cluster rect { - filter: none; - } -`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DpcZasdm.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DpcZasdm.js new file mode 100644 index 000000000..cd23cbaf3 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DpcZasdm.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-UKHOOZJN-DmwC0ruo.js";import{a}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import"./chunk-5VM5RSS4-0VUj4cdX.js";import"./chunk-XXDRQBXY-DF1LpnDY.js";import"./chunk-KBJHAD2P-BwJsQpfI.js";import"./chunk-2GRJ4B5K-w7u93fzV.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-CK3FNdKP.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dz8AxK7r.js b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dq9PHz3C.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dz8AxK7r.js rename to veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dq9PHz3C.js index 91848eab8..1e76d3b7a 100644 --- a/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dz8AxK7r.js +++ b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-Dq9PHz3C.js @@ -1,4 +1,4 @@ -import{a as l,X as pt,ak as Wt,ap as Pt,H as Bt,Y as gt,at as S,aP as Vt,aC as Ft,aW as ft,_ as zt,w as Gt,s as Ot}from"./mermaid.core-DnksLuoJ.js";import{aB as J}from"../../app/index-DZf0wXGZ.js";import{d as ot}from"../../chunks/arc-CXEGKubz.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],c=[1,15],a=[1,16],o=[1,19],p=[1,20],y={trace:l(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:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`: +import{a as l,X as pt,ak as Wt,ap as Pt,H as Bt,Y as gt,at as S,aP as Vt,aC as Ft,aW as ft,_ as zt,w as Gt,s as Ot}from"./mermaid.core-Byx96n1y.js";import{aB as J}from"../../app/index-y89rQfXU.js";import{d as ot}from"../../chunks/arc-BmSNZeim.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],c=[1,15],a=[1,16],o=[1,19],p=[1,20],y={trace:l(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:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`: `+_.showPosition()+` Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":K="Parse error on line "+(M+1)+": Unexpected "+($==V?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(K,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:z,expected:D})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+$);switch(b[0]){case 1:h.push($),m.push(_.yytext),u.push(_.yylloc),h.push(b[1]),$=null,R=_.yyleng,v=_.yytext,M=_.yylineno,z=_.yylloc;break;case 2:if(I=this.productions_[b[1]][1],E.$=m[m.length-I],E._$={first_line:u[u.length-(I||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(I||1)].first_column,last_column:u[u.length-1].last_column},q&&(E._$.range=[u[u.length-(I||1)].range[0],u[u.length-1].range[1]]),T=this.performAction.apply(E,[v,R,M,C.yy,b[1],m,u].concat(L)),typeof T<"u")return T;I&&(h=h.slice(0,-1*I*2),m=m.slice(0,-1*I),u=u.slice(0,-1*I)),h.push(this.productions_[b[1]][0]),m.push(E.$),u.push(E._$),B=w[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},x=function(){var k={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.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),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-qZKAtDe0.js b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-CYHQcSxC.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-qZKAtDe0.js rename to veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-CYHQcSxC.js index d58e6697c..12ce81f00 100644 --- a/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-qZKAtDe0.js +++ b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-CYHQcSxC.js @@ -1,4 +1,4 @@ -import{d as Gt,aQ as Kt,V as Ht,$ as Xt,aT as Yt,W as Zt,aR as Qt,a as S,X as St,aP as Jt,k as $t,ak as te,ap as ee,H as ne,B as se,s as ie,r as re,O as oe}from"./mermaid.core-DnksLuoJ.js";import{aB as rt}from"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";const It=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let h=e[e.length-1];for(let u=0;uy.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(h)ct(n))}function tt(t,n){let s=0;for(let e=0;ev.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx=1)break;for(let f=1;fl+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a{const p={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;ul===h?0:lr.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;dp.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;mt[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(D=>N.has(D)));let I={},R={};if(f.length>0){let k=b(f,{lossFunction:v,distinct:m});l&&(k=Dt(k,o,d)),I=Ot(k,s,e,i,h),R=Lt(I,f,M)}const Z={};f.forEach(k=>{k.label&&(Z[k.sets]=k.label)});function U(k){if(k.sets in Z)return Z[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(k){const D=this.getAttribute("d");k.sets.length==1&&D&&!m&&(z=!0,V[k.sets[0]]=Me(D))});function q(k){return D=>{const W=k.sets.map(Q=>{let G=V[Q],Y=I[Q];return G||(G={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:G.x*(1-D)+Y.x*D,y:G.y*(1-D)+Y.y*D,radius:G.radius*(1-D)+Y.radius*D}});return wt(W,y)}}const A=B.selectAll(".venn-area").data(f,k=>k.sets),F=A.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(k=>U(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function P(k){return typeof k.transition=="function"?k.transition("venn").duration(r):k}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",k=>wt(k.sets.map(D=>I[D])),y);const C=_.selectAll("text").filter(k=>k.sets in R).text(k=>U(k)).attr("x",k=>Math.floor(R[k.sets].x)).attr("y",k=>Math.floor(R[k.sets].y));u&&(z?"on"in C?C.on("end",ot(I,U)):C.each("end",ot(I,U)):C.each(ot(I,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),X.style("font-size","0px")),{circles:I,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(` +import{d as Gt,aQ as Kt,V as Ht,$ as Xt,aT as Yt,W as Zt,aR as Qt,a as S,X as St,aP as Jt,k as $t,ak as te,ap as ee,H as ne,B as se,s as ie,r as re,O as oe}from"./mermaid.core-Byx96n1y.js";import{aB as rt}from"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";const It=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let h=e[e.length-1];for(let u=0;uy.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(h)ct(n))}function tt(t,n){let s=0;for(let e=0;ev.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx=1)break;for(let f=1;fl+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a{const p={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;ul===h?0:lr.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;dp.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;mt[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(D=>N.has(D)));let I={},R={};if(f.length>0){let k=b(f,{lossFunction:v,distinct:m});l&&(k=Dt(k,o,d)),I=Ot(k,s,e,i,h),R=Lt(I,f,M)}const Z={};f.forEach(k=>{k.label&&(Z[k.sets]=k.label)});function U(k){if(k.sets in Z)return Z[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(k){const D=this.getAttribute("d");k.sets.length==1&&D&&!m&&(z=!0,V[k.sets[0]]=Me(D))});function q(k){return D=>{const W=k.sets.map(Q=>{let G=V[Q],Y=I[Q];return G||(G={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:G.x*(1-D)+Y.x*D,y:G.y*(1-D)+Y.y*D,radius:G.radius*(1-D)+Y.radius*D}});return wt(W,y)}}const A=B.selectAll(".venn-area").data(f,k=>k.sets),F=A.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(k=>U(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function P(k){return typeof k.transition=="function"?k.transition("venn").duration(r):k}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",k=>wt(k.sets.map(D=>I[D])),y);const C=_.selectAll("text").filter(k=>k.sets in R).text(k=>U(k)).attr("x",k=>Math.floor(R[k.sets].x)).attr("y",k=>Math.floor(R[k.sets].y));u&&(z?"on"in C?C.on("end",ot(I,U)):C.each("end",ot(I,U)):C.each(ot(I,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),X.style("font-size","0px")),{circles:I,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(` M`,t,n),e.push(` m`,-s,0),e.push(` a`,s,s,0,1,0,s*2,0),e.push(` diff --git a/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-DvjwaJgh.js b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Dkoo2yzf.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-DvjwaJgh.js rename to veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Dkoo2yzf.js index e2e0f286c..b48550e44 100644 --- a/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-DvjwaJgh.js +++ b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Dkoo2yzf.js @@ -1,4 +1,4 @@ -import{p as Tt}from"./chunk-JWPE2WC7-CWI15yjG.js";import{aQ as zt,V as Lt,$ as Xt,aT as At,W as Et,aR as Yt,a as y,a8 as It,X as Bt,r as K,at as et,aP as Ft,B as Rt,s as Ot,Y as V}from"./mermaid.core-DnksLuoJ.js";import{p as Wt}from"./cynefin-OW5HDTMX-DAp7f4c2.js";import"../../app/index-DZf0wXGZ.js";import"../../chunks/purify.es-BnINGy_Y.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Tt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,z=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,z,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:At,getDiagramTitle:Xt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,z,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((z=a.wardley)==null?void 0:z.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map +import{p as Tt}from"./chunk-JWPE2WC7-s5uAWi9x.js";import{aQ as zt,V as Lt,$ as Xt,aT as At,W as Et,aR as Yt,a as y,a8 as It,X as Bt,r as K,at as et,aP as Ft,B as Rt,s as Ot,Y as V}from"./mermaid.core-Byx96n1y.js";import{p as Wt}from"./cynefin-OW5HDTMX-CfYIu5D_.js";import"../../app/index-y89rQfXU.js";import"../../chunks/purify.es-BnINGy_Y.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Tt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,z=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,z,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:At,getDiagramTitle:Xt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,z,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((z=a.wardley)==null?void 0:z.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),z=v.getDiagramTitle(),M=((U=g.size)==null?void 0:U.width)??r.width,k=((J=g.size)==null?void 0:J.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;z&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(z);const L=y(t=>r.padding+t/100*B,"projectX"),X=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:L(t.x),y:X(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const T=(h+l)/2;S.x=T,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+15*2).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const Q=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(Q).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(Q.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,T=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${T} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=L(t.targetX),i=X(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const A=C.filter(t=>t.sourceStrategy==="market");A.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:L(i.x),y:X(i.y)}));if(s.length>1)for(let i=0;i{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=L(g.annotationsBox.x),s=X(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const T=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(T)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const T=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-T,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",T).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=L(n.x),i=X(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=L(n.x),i=X(n.y),h=60,l=30,x=20,f=` M ${s} ${i-l/2} L ${s+h-x} ${i-l/2} diff --git a/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DfWAA2AU.js b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CSukDV3q.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DfWAA2AU.js rename to veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CSukDV3q.js index 1a24d73f1..c5adbb300 100644 --- a/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DfWAA2AU.js +++ b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CSukDV3q.js @@ -1,4 +1,4 @@ -import{aQ as xi,V as di,$ as Yt,aT as fi,W as pi,aR as mi,a as n,at as Nt,aP as yi,B as bi,s as Ai,X as kt,aN as wi,r as Ht,O as Ci,a8 as Si,y as Ri,aq as Ot}from"./mermaid.core-DnksLuoJ.js";import"../../app/index-DZf0wXGZ.js";import{i as _i}from"../../chunks/init-Gi6I4Gst.js";import{o as ki}from"../../chunks/ordinal-Cboi1Yqb.js";import{l as Wt}from"../../chunks/linear-CeDfK4RZ.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(V){g.length=g.length-2*V,C.length=C.length-V,r.length=r.length-V}n(gi,"popStack");function zt(){var V;return V=x.pop()||v.lex()||Vt,typeof V!="number"&&(V instanceof Array&&(x=V,V=x.pop()),V=u.symbols_[V]||V),V}n(zt,"lex");for(var M,U,O,bt,G={},xt,N,Bt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=zt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`: +import{aQ as xi,V as di,$ as Yt,aT as fi,W as pi,aR as mi,a as n,at as Nt,aP as yi,B as bi,s as Ai,X as kt,aN as wi,r as Ht,O as Ci,a8 as Si,y as Ri,aq as Ot}from"./mermaid.core-Byx96n1y.js";import"../../app/index-y89rQfXU.js";import{i as _i}from"../../chunks/init-Gi6I4Gst.js";import{o as ki}from"../../chunks/ordinal-Cboi1Yqb.js";import{l as Wt}from"../../chunks/linear-FRN7TzCz.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(V){g.length=g.length-2*V,C.length=C.length-V,r.length=r.length-V}n(gi,"popStack");function zt(){var V;return V=x.pop()||v.lex()||Vt,typeof V!="number"&&(V instanceof Array&&(x=V,V=x.pop()),V=u.symbols_[V]||V),V}n(zt,"lex");for(var M,U,O,bt,G={},xt,N,Bt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=zt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`: `+v.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==Vt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,f=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[f,Mt,gt,$.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Bt=rt[g[g.length-2]][g[g.length-1]],g.push(Bt);break;case 3:return!0}}return!0},"parse")},ot=function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,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:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+` diff --git a/veadk/webui/index.html b/veadk/webui/index.html index 1615b0876..79af96f26 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,7 +5,7 @@ AgentKit Studio - + diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index e50d90693..739f4c5a6 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -59,7 +59,7 @@ Your goal is to understand the user's request accurately and provide clear, conc Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},C8e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},O8e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},k8e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},E8e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},_8e={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},R8e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},D8e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},L8e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},M8e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},I8e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},P8e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},N8e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},B8e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Qtr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:E8e,codePackage:k8e,common:w8e,default:{common:w8e,yaml:A8e,validation:T8e,defaults:S8e,helpers:C8e,intelligentDeployment:O8e,codePackage:k8e,buildCanvas:E8e,intelligent:_8e,projectLibrary:R8e,modePicker:D8e,promptEditor:L8e,skills:M8e,workflow:I8e,workbench:P8e,traditional:N8e,template:B8e},defaults:S8e,helpers:C8e,intelligent:_8e,intelligentDeployment:O8e,modePicker:D8e,projectLibrary:R8e,promptEditor:L8e,skills:M8e,template:B8e,traditional:N8e,validation:T8e,workbench:P8e,workflow:I8e,yaml:A8e},Symbol.toStringTag,{value:"Module"})),$8e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},F8e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},z8e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},U8e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},V8e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Q8e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},G8e={all:"All"},H8e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},W8e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},Y8e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},q8e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},j8e={daily:"Daily",once:"Once",weekly:"Weekly"},X8e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},K8e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Z8e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Gtr=Object.freeze(Object.defineProperty({__proto__:null,actions:$8e,confirm:F8e,default:{actions:$8e,confirm:F8e,detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},Symbol.toStringTag,{value:"Module"})),J8e="Report an issue",eBe="Description",tBe="Common issues",rBe="Cancel",nBe="Done",iBe="Submit feedback",aBe="Submitting…",sBe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},oBe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},lBe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},Htr=Object.freeze(Object.defineProperty({__proto__:null,cancel:rBe,commonIssues:tBe,default:{title:J8e,descriptionLabel:eBe,commonIssues:tBe,cancel:rBe,done:nBe,submit:iBe,submitting:aBe,success:sBe,dialog:oBe,page:lBe},descriptionLabel:eBe,dialog:oBe,done:nBe,page:lBe,submit:iBe,submitting:aBe,success:sBe,title:J8e},Symbol.toStringTag,{value:"Module"})),cBe={back:"Back",close:"Close"},uBe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},hBe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},dBe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},fBe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},pBe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},gBe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},mBe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},vBe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},yBe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},bBe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},xBe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},wBe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},ABe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},TBe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},SBe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},CBe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},OBe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},kBe={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},EBe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},_Be={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},RBe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},DBe={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},LBe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},MBe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},Wtr=Object.freeze(Object.defineProperty({__proto__:null,actions:kBe,activity:wBe,analysis:xBe,artifact:ABe,capability:EBe,common:cBe,confirmation:DBe,conversation:_Be,default:{common:cBe,optimization:uBe,projects:hBe,framework:dBe,state:fBe,task:pBe,verification:gBe,transfer:mBe,validation:vBe,duration:yBe,expiry:bBe,analysis:xBe,activity:wBe,artifact:ABe,model:TBe,upload:SBe,deployment:CBe,workspace:OBe,actions:kBe,capability:EBe,conversation:_Be,questions:RBe,confirmation:DBe,errors:LBe,stopDialog:MBe},deployment:CBe,duration:yBe,errors:LBe,expiry:bBe,framework:dBe,model:TBe,optimization:uBe,projects:hBe,questions:RBe,state:fBe,stopDialog:MBe,task:pBe,transfer:mBe,upload:SBe,validation:vBe,verification:gBe,workspace:OBe},Symbol.toStringTag,{value:"Module"})),IBe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},PBe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},NBe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},BBe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},$Be={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},FBe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},zBe={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Ytr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$Be,compactSelect:IBe,default:{compactSelect:IBe,featureNotice:PBe,workspace:NBe,mode:BBe,agentPicker:$Be,skill:FBe,video:zBe},featureNotice:PBe,mode:BBe,skill:FBe,video:zBe,workspace:NBe},Symbol.toStringTag,{value:"Module"})),UBe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},VBe={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},QBe={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},GBe={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},HBe={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},WBe={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},YBe={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},qBe={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},jBe={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},XBe={back:"Back to Agents",subtitle:"{{agent}} 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"},KBe={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},ZBe={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. +- Maintain a polite, professional tone.`},C8e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},O8e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},k8e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},E8e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},_8e={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},R8e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},D8e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},L8e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},M8e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},I8e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},P8e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},N8e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},B8e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Qtr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:E8e,codePackage:k8e,common:w8e,default:{common:w8e,yaml:A8e,validation:T8e,defaults:S8e,helpers:C8e,intelligentDeployment:O8e,codePackage:k8e,buildCanvas:E8e,intelligent:_8e,projectLibrary:R8e,modePicker:D8e,promptEditor:L8e,skills:M8e,workflow:I8e,workbench:P8e,traditional:N8e,template:B8e},defaults:S8e,helpers:C8e,intelligent:_8e,intelligentDeployment:O8e,modePicker:D8e,projectLibrary:R8e,promptEditor:L8e,skills:M8e,template:B8e,traditional:N8e,validation:T8e,workbench:P8e,workflow:I8e,yaml:A8e},Symbol.toStringTag,{value:"Module"})),$8e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},F8e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},z8e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},U8e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},V8e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Q8e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},G8e={all:"All"},H8e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},W8e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},Y8e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},q8e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},j8e={daily:"Daily",once:"Once",weekly:"Weekly"},X8e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},K8e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Z8e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Gtr=Object.freeze(Object.defineProperty({__proto__:null,actions:$8e,confirm:F8e,default:{actions:$8e,confirm:F8e,detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},Symbol.toStringTag,{value:"Module"})),J8e="Report an issue",eBe="Description",tBe="Common issues",rBe="Cancel",nBe="Done",iBe="Submit feedback",aBe="Submitting…",sBe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},oBe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},lBe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},Htr=Object.freeze(Object.defineProperty({__proto__:null,cancel:rBe,commonIssues:tBe,default:{title:J8e,descriptionLabel:eBe,commonIssues:tBe,cancel:rBe,done:nBe,submit:iBe,submitting:aBe,success:sBe,dialog:oBe,page:lBe},descriptionLabel:eBe,dialog:oBe,done:nBe,page:lBe,submit:iBe,submitting:aBe,success:sBe,title:J8e},Symbol.toStringTag,{value:"Module"})),cBe={back:"Back",close:"Close"},uBe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},hBe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},dBe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},fBe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},pBe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},gBe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},mBe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},vBe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},yBe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},bBe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},xBe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},wBe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},ABe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},TBe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},SBe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},CBe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},OBe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},kBe={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},EBe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},_Be={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},RBe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},DBe={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},LBe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},MBe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},Wtr=Object.freeze(Object.defineProperty({__proto__:null,actions:kBe,activity:wBe,analysis:xBe,artifact:ABe,capability:EBe,common:cBe,confirmation:DBe,conversation:_Be,default:{common:cBe,optimization:uBe,projects:hBe,framework:dBe,state:fBe,task:pBe,verification:gBe,transfer:mBe,validation:vBe,duration:yBe,expiry:bBe,analysis:xBe,activity:wBe,artifact:ABe,model:TBe,upload:SBe,deployment:CBe,workspace:OBe,actions:kBe,capability:EBe,conversation:_Be,questions:RBe,confirmation:DBe,errors:LBe,stopDialog:MBe},deployment:CBe,duration:yBe,errors:LBe,expiry:bBe,framework:dBe,model:TBe,optimization:uBe,projects:hBe,questions:RBe,state:fBe,stopDialog:MBe,task:pBe,transfer:mBe,upload:SBe,validation:vBe,verification:gBe,workspace:OBe},Symbol.toStringTag,{value:"Module"})),IBe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},PBe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},NBe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},BBe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},$Be={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},FBe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},zBe={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Ytr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$Be,compactSelect:IBe,default:{compactSelect:IBe,featureNotice:PBe,workspace:NBe,mode:BBe,agentPicker:$Be,skill:FBe,video:zBe},featureNotice:PBe,mode:BBe,skill:FBe,video:zBe,workspace:NBe},Symbol.toStringTag,{value:"Module"})),UBe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},VBe={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},QBe={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},GBe={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},HBe={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},WBe={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},YBe={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},qBe={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},jBe={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},XBe={back:"Back to Agents",subtitle:"{{agent}} 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"},KBe={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},ZBe={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},JBe={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},qtr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:XBe,agentWorkspace:KBe,approval:WBe,commands:JBe,common:UBe,composer:YBe,default:{common:UBe,tool:VBe,threads:QBe,permissions:GBe,workspace:HBe,approval:WBe,composer:YBe,launch:qBe,session:jBe,agentDetails:XBe,agentWorkspace:KBe,handoff:ZBe,commands:JBe},handoff:ZBe,launch:qBe,permissions:GBe,session:jBe,threads:QBe,tool:VBe,workspace:HBe},Symbol.toStringTag,{value:"Module"})),e7e={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},t7e={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},r7e={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},n7e={cancel:"Cancel",close:"Close confirmation dialog"},jtr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:t7e,confirm:n7e,default:{login:e7e,authExpired:t7e,navbar:r7e,confirm:n7e},login:e7e,navbar:r7e},Symbol.toStringTag,{value:"Module"})),i7e={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User"}},a7e={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations"},s7e={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},Xtr=Object.freeze(Object.defineProperty({__proto__:null,account:i7e,default:{account:i7e,navigation:a7e,history:s7e},history:s7e,navigation:a7e},Symbol.toStringTag,{value:"Module"})),o7e={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},l7e={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},c7e={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: @@ -77,7 +77,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},B9e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},$9e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},F9e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},z9e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},U9e={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},V9e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Q9e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},G9e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},H9e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},W9e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Y9e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},q9e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},j9e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},srr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:z9e,codePackage:F9e,common:M9e,default:{common:M9e,yaml:I9e,validation:P9e,defaults:N9e,helpers:B9e,intelligentDeployment:$9e,codePackage:F9e,buildCanvas:z9e,intelligent:U9e,projectLibrary:V9e,modePicker:Q9e,promptEditor:G9e,skills:H9e,workflow:W9e,workbench:Y9e,traditional:q9e,template:j9e},defaults:N9e,helpers:B9e,intelligent:U9e,intelligentDeployment:$9e,modePicker:Q9e,projectLibrary:V9e,promptEditor:G9e,skills:H9e,template:j9e,traditional:q9e,validation:P9e,workbench:Y9e,workflow:W9e,yaml:I9e},Symbol.toStringTag,{value:"Module"})),X9e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},K9e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Z9e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},J9e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},eFe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},tFe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},rFe={all:"全部"},nFe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iFe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},aFe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},sFe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oFe={daily:"每天",once:"一次性",weekly:"每周"},lFe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},cFe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},uFe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},orr=Object.freeze(Object.defineProperty({__proto__:null,actions:X9e,confirm:K9e,default:{actions:X9e,confirm:K9e,detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},Symbol.toStringTag,{value:"Module"})),hFe="问题反馈",dFe="问题描述",fFe="常见问题",pFe="取消",gFe="完成",mFe="提交反馈",vFe="正在上报…",yFe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},bFe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},xFe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},lrr=Object.freeze(Object.defineProperty({__proto__:null,cancel:pFe,commonIssues:fFe,default:{title:hFe,descriptionLabel:dFe,commonIssues:fFe,cancel:pFe,done:gFe,submit:mFe,submitting:vFe,success:yFe,dialog:bFe,page:xFe},descriptionLabel:dFe,dialog:bFe,done:gFe,page:xFe,submit:mFe,submitting:vFe,success:yFe,title:hFe},Symbol.toStringTag,{value:"Module"})),wFe={back:"返回",close:"关闭"},AFe={title:"优化迁移项目",closeAria:"关闭优化窗口"},TFe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},SFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},CFe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},OFe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},kFe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},EFe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},_Fe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},RFe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},DFe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},LFe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},MFe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},IFe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},PFe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},NFe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},BFe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},$Fe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},FFe={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},zFe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},UFe={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},VFe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},QFe={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},GFe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},HFe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},crr=Object.freeze(Object.defineProperty({__proto__:null,actions:FFe,activity:MFe,analysis:LFe,artifact:IFe,capability:zFe,common:wFe,confirmation:QFe,conversation:UFe,default:{common:wFe,optimization:AFe,projects:TFe,framework:SFe,state:CFe,task:OFe,verification:kFe,transfer:EFe,validation:_Fe,duration:RFe,expiry:DFe,analysis:LFe,activity:MFe,artifact:IFe,model:PFe,upload:NFe,deployment:BFe,workspace:$Fe,actions:FFe,capability:zFe,conversation:UFe,questions:VFe,confirmation:QFe,errors:GFe,stopDialog:HFe},deployment:BFe,duration:RFe,errors:GFe,expiry:DFe,framework:SFe,model:PFe,optimization:AFe,projects:TFe,questions:VFe,state:CFe,stopDialog:HFe,task:OFe,transfer:EFe,upload:NFe,validation:_Fe,verification:kFe,workspace:$Fe},Symbol.toStringTag,{value:"Module"})),WFe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},YFe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},qFe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},jFe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},XFe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},KFe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},ZFe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},urr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:XFe,compactSelect:WFe,default:{compactSelect:WFe,featureNotice:YFe,workspace:qFe,mode:jFe,agentPicker:XFe,skill:KFe,video:ZFe},featureNotice:YFe,mode:jFe,skill:KFe,video:ZFe,workspace:qFe},Symbol.toStringTag,{value:"Module"})),JFe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},eze={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},tze={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},rze={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},nze={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},ize={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},aze={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},sze={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},oze={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},lze={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",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"},cze={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},uze={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},B9e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},$9e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},F9e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},z9e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},U9e={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},V9e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Q9e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},G9e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},H9e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},W9e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Y9e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},q9e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},j9e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},srr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:z9e,codePackage:F9e,common:M9e,default:{common:M9e,yaml:I9e,validation:P9e,defaults:N9e,helpers:B9e,intelligentDeployment:$9e,codePackage:F9e,buildCanvas:z9e,intelligent:U9e,projectLibrary:V9e,modePicker:Q9e,promptEditor:G9e,skills:H9e,workflow:W9e,workbench:Y9e,traditional:q9e,template:j9e},defaults:N9e,helpers:B9e,intelligent:U9e,intelligentDeployment:$9e,modePicker:Q9e,projectLibrary:V9e,promptEditor:G9e,skills:H9e,template:j9e,traditional:q9e,validation:P9e,workbench:Y9e,workflow:W9e,yaml:I9e},Symbol.toStringTag,{value:"Module"})),X9e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},K9e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Z9e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},J9e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},eFe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},tFe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},rFe={all:"全部"},nFe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iFe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},aFe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},sFe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oFe={daily:"每天",once:"一次性",weekly:"每周"},lFe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},cFe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},uFe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},orr=Object.freeze(Object.defineProperty({__proto__:null,actions:X9e,confirm:K9e,default:{actions:X9e,confirm:K9e,detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},Symbol.toStringTag,{value:"Module"})),hFe="问题反馈",dFe="问题描述",fFe="常见问题",pFe="取消",gFe="完成",mFe="提交反馈",vFe="正在上报…",yFe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},bFe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},xFe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},lrr=Object.freeze(Object.defineProperty({__proto__:null,cancel:pFe,commonIssues:fFe,default:{title:hFe,descriptionLabel:dFe,commonIssues:fFe,cancel:pFe,done:gFe,submit:mFe,submitting:vFe,success:yFe,dialog:bFe,page:xFe},descriptionLabel:dFe,dialog:bFe,done:gFe,page:xFe,submit:mFe,submitting:vFe,success:yFe,title:hFe},Symbol.toStringTag,{value:"Module"})),wFe={back:"返回",close:"关闭"},AFe={title:"优化迁移项目",closeAria:"关闭优化窗口"},TFe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},SFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},CFe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},OFe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},kFe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},EFe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},_Fe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},RFe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},DFe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},LFe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},MFe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},IFe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},PFe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},NFe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},BFe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},$Fe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},FFe={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},zFe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},UFe={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},VFe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},QFe={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},GFe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},HFe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},crr=Object.freeze(Object.defineProperty({__proto__:null,actions:FFe,activity:MFe,analysis:LFe,artifact:IFe,capability:zFe,common:wFe,confirmation:QFe,conversation:UFe,default:{common:wFe,optimization:AFe,projects:TFe,framework:SFe,state:CFe,task:OFe,verification:kFe,transfer:EFe,validation:_Fe,duration:RFe,expiry:DFe,analysis:LFe,activity:MFe,artifact:IFe,model:PFe,upload:NFe,deployment:BFe,workspace:$Fe,actions:FFe,capability:zFe,conversation:UFe,questions:VFe,confirmation:QFe,errors:GFe,stopDialog:HFe},deployment:BFe,duration:RFe,errors:GFe,expiry:DFe,framework:SFe,model:PFe,optimization:AFe,projects:TFe,questions:VFe,state:CFe,stopDialog:HFe,task:OFe,transfer:EFe,upload:NFe,validation:_Fe,verification:kFe,workspace:$Fe},Symbol.toStringTag,{value:"Module"})),WFe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},YFe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},qFe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},jFe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},XFe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},KFe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},ZFe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},urr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:XFe,compactSelect:WFe,default:{compactSelect:WFe,featureNotice:YFe,workspace:qFe,mode:jFe,agentPicker:XFe,skill:KFe,video:ZFe},featureNotice:YFe,mode:jFe,skill:KFe,video:ZFe,workspace:qFe},Symbol.toStringTag,{value:"Module"})),JFe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},eze={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},tze={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},rze={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},nze={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},ize={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},aze={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},sze={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},oze={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},lze={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",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"},cze={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},uze={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},hze={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},hrr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:lze,agentWorkspace:cze,approval:ize,commands:hze,common:JFe,composer:aze,default:{common:JFe,tool:eze,threads:tze,permissions:rze,workspace:nze,approval:ize,composer:aze,launch:sze,session:oze,agentDetails:lze,agentWorkspace:cze,handoff:uze,commands:hze},handoff:uze,launch:sze,permissions:rze,session:oze,threads:tze,tool:eze,workspace:nze},Symbol.toStringTag,{value:"Module"})),dze={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},fze={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},pze={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},gze={cancel:"取消",close:"关闭确认框"},drr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:fze,confirm:gze,default:{login:dze,authExpired:fze,navbar:pze,confirm:gze},login:dze,navbar:pze},Symbol.toStringTag,{value:"Module"})),mze={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},vze={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},yze={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},frr=Object.freeze(Object.defineProperty({__proto__:null,account:mze,default:{account:mze,navigation:vze,history:yze},history:yze,navigation:vze},Symbol.toStringTag,{value:"Module"})),bze={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},xze={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},wze={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: From 51ee94040287e18b42dcccd9c07dd15f87c7d16a Mon Sep 17 00:00:00 2001 From: "yanan.zhangyn" Date: Wed, 9 Sep 2026 17:23:30 +0800 Subject: [PATCH 4/4] test(studio): exercise real authenticated MCP discovery --- tests/cli/test_generated_agent_mcp.py | 123 ++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/tests/cli/test_generated_agent_mcp.py b/tests/cli/test_generated_agent_mcp.py index 4049662ae..9c863fc8c 100644 --- a/tests/cli/test_generated_agent_mcp.py +++ b/tests/cli/test_generated_agent_mcp.py @@ -14,6 +14,9 @@ from __future__ import annotations +import json +import threading +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from types import SimpleNamespace import httpx @@ -43,6 +46,126 @@ async def close(self) -> None: return None +class _AuthenticatedMcpHandler(BaseHTTPRequestHandler): + protocol_version = "HTTP/1.0" + requests: list[tuple[str, str, str]] = [] + + def log_message(self, *_args: object) -> None: + return + + def do_DELETE(self) -> None: # noqa: N802 + self.send_response(200) + self.send_header("Content-Length", "0") + self.end_headers() + + def do_POST(self) -> None: # noqa: N802 + length = int(self.headers.get("Content-Length", "0") or 0) + payload = json.loads(self.rfile.read(length) or b"{}") + method = str(payload.get("method") or "") + authorization = str(self.headers.get("Authorization") or "") + self.requests.append((self.path, method, authorization)) + if self.path != "/athena-mcp" or authorization != "Bearer fixture-token": + self._send_json(401, {"error": "unauthorized"}) + return + if method == "initialize": + self._send_json( + 200, + { + "jsonrpc": "2.0", + "id": payload.get("id"), + "result": { + "protocolVersion": "2025-03-26", + "capabilities": {"tools": {}}, + "serverInfo": {"name": "fixture", "version": "1"}, + }, + }, + session=True, + ) + return + if method == "notifications/initialized": + self.send_response(202) + self.send_header("Content-Length", "0") + self.end_headers() + return + if method == "tools/list": + self._send_json( + 200, + { + "jsonrpc": "2.0", + "id": payload.get("id"), + "result": { + "tools": [ + { + "name": "fixture_tool", + "description": "fixture", + "inputSchema": {"type": "object"}, + } + ] + }, + }, + ) + return + self._send_json(400, {"error": "unsupported"}) + + def _send_json( + self, + status: int, + value: object, + *, + session: bool = False, + ) -> None: + body = json.dumps(value).encode() + self.send_response(status) + self.send_header("Content-Type", "application/json") + if session: + self.send_header("Mcp-Session-Id", "fixture-session") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + +@pytest.mark.asyncio +async def test_debug_mcp_discovers_authenticated_custom_path_with_real_client( + monkeypatch, +) -> None: + _AuthenticatedMcpHandler.requests.clear() + server = ThreadingHTTPServer(("127.0.0.1", 0), _AuthenticatedMcpHandler) + thread = threading.Thread(target=server.serve_forever, daemon=True) + thread.start() + host, port = server.server_address[:2] + monkeypatch.setenv("NO_PROXY", "127.0.0.1") + monkeypatch.setenv("no_proxy", "127.0.0.1") + draft = AgentDraft( + name="demo-agent", + description="Demo agent", + instruction="Use the tool.", + mcpTools=[ + McpTool( + name="athena", + transport="http", + url=f"http://{host}:{port}/athena-mcp", + authToken="fixture-token", + ) + ], + ) + try: + resolved = await resolve_debug_mcp_endpoints(draft) + finally: + server.shutdown() + server.server_close() + thread.join(timeout=3) + + assert resolved.mcpTools[0].url == f"http://{host}:{port}/athena-mcp" + assert _AuthenticatedMcpHandler.requests + assert { + path for path, _method, _authorization in _AuthenticatedMcpHandler.requests + } == {"/athena-mcp"} + assert { + authorization + for _path, _method, authorization in _AuthenticatedMcpHandler.requests + } == {"Bearer fixture-token"} + + @pytest.mark.asyncio async def test_debug_mcp_keeps_configured_path_without_rewriting(monkeypatch) -> None: _FakeMcpToolset.attempted_urls = []