diff --git a/frontend/src/create/NewAgentWorkbench.tsx b/frontend/src/create/NewAgentWorkbench.tsx index 1869c2bc4..99eb9dbfc 100644 --- a/frontend/src/create/NewAgentWorkbench.tsx +++ b/frontend/src/create/NewAgentWorkbench.tsx @@ -698,7 +698,7 @@ export function NewAgentWorkbench({ const [maxInstance, setMaxInstance] = useState( sessionStorage === "in-memory" ? "1" : "5", ); - const [createEvaluationSets, setCreateEvaluationSets] = useState(true); + const [createEvaluationSets, setCreateEvaluationSets] = useState(false); const [deployResources, setDeployResources] = useState( DEFAULT_DEPLOY_RESOURCES, ); diff --git a/frontend/src/ui/ProjectPreview.tsx b/frontend/src/ui/ProjectPreview.tsx index 08e488c3f..d9b402d40 100644 --- a/frontend/src/ui/ProjectPreview.tsx +++ b/frontend/src/ui/ProjectPreview.tsx @@ -966,7 +966,7 @@ export function ProjectPreview({ const [maxInstance, setMaxInstance] = useState( inMemorySession || sidecarEnabled ? "1" : "5", ); - const [createEvaluationSets, setCreateEvaluationSets] = useState(true); + const [createEvaluationSets, setCreateEvaluationSets] = useState(false); const supportsEvaluationSets = cloudProvider !== "byteplus"; const effectiveCreateEvaluationSets = supportsEvaluationSets && createEvaluationSets; diff --git a/frontend/tests/deploymentConfigUi.test.mjs b/frontend/tests/deploymentConfigUi.test.mjs index f86e12a12..036978436 100644 --- a/frontend/tests/deploymentConfigUi.test.mjs +++ b/frontend/tests/deploymentConfigUi.test.mjs @@ -22,6 +22,10 @@ const customCreateSource = readFileSync( new URL("../src/create/CustomCreate.tsx", import.meta.url), "utf8", ); +const newAgentWorkbenchSource = readFileSync( + new URL("../src/create/NewAgentWorkbench.tsx", import.meta.url), + "utf8", +); const agentTypeMetaSource = readFileSync( new URL("../src/create/agentTypeMeta.tsx", import.meta.url), "utf8", @@ -428,10 +432,14 @@ test("requires explicit confirmation before starting deployment", () => { ); }); -test("creates feedback evaluation sets by default and sends the deployment choice", () => { +test("leaves feedback evaluation sets off by default in both deployment workbenches", () => { assert.match( projectPreviewSource, - /useState\(true\)[\s\S]*?projectPreview\.createEvaluationSets[\s\S]*?projectPreview\.createEvaluationSetsHint/, + /const \[createEvaluationSets, setCreateEvaluationSets\] = useState\(false\);/, + ); + assert.match( + newAgentWorkbenchSource, + /const \[createEvaluationSets, setCreateEvaluationSets\] = useState\(false\);/, ); assert.match( projectPreviewSource, diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index 65782d40a..152204316 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -1217,6 +1217,158 @@ async def fail_mcp_discovery(draft): assert response.json()["detail"] == original_detail +@pytest.mark.parametrize( + ( + "credential_storage", + "tool_name", + "edited_url", + "expected_status", + "expect_credential", + ), + [ + ("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), + ( + "servers-json", + "jvmdiag", + "https://8.8.8.8/changed-mcp", + 422, + False, + ), + ], +) +def test_generated_debug_applies_published_mcp_credential_contract_before_discovery( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + credential_storage: str, + tool_name: str, + edited_url: str, + expected_status: int, + expect_credential: bool, +) -> None: + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + from veadk.cli.generated_agent_mcp import McpDebugConnectionError + + credential_reference = "MCP_LEGACY_AGENT_JVMDIAG_AUTH_TOKEN" + credential_value = "server-retained-debug-secret" + published_draft = { + "name": "legacy_agent", + "description": "Existing Agent", + "instruction": "Use the diagnostic MCP.", + "mcpTools": [ + { + "name": tool_name, + "transport": "http", + "url": "https://8.8.8.8/mcp", + "authTokenEnv": credential_reference, + } + ], + } + runtime_envs = [SimpleNamespace(key=credential_reference, value=credential_value)] + if credential_storage == "servers-json": + runtime_envs = [ + SimpleNamespace( + key="MCP_SERVERS_JSON", + value=json.dumps( + [ + { + "name": tool_name or "mcp", + "url": "https://8.8.8.8/mcp", + "headers": {"Authorization": f"Bearer {credential_value}"}, + } + ] + ), + ) + ] + runtime = SimpleNamespace( + runtime_id="runtime-debug-mcp", + runtime_name="legacy-agent-runtime", + current_version_number=3, + tags=[], + envs=runtime_envs, + network_configurations=[ + SimpleNamespace( + endpoint="https://runtime.example.com", + network_type="public", + ) + ], + authorizer_configuration=SimpleNamespace( + key_auth=SimpleNamespace(api_key="runtime-api-key"), + custom_jwt_authorizer=None, + ), + ) + + monkeypatch.setattr( + AgentkitRuntimeClient, + "get_runtime", + lambda _self, _request: runtime, + ) + + captured_discovery_env: dict[str, str] = {} + + async def capture_mcp_discovery(draft, env_values=None): + captured_discovery_env.update(env_values or {}) + if not expect_credential: + raise McpDebugConnectionError("changed MCP endpoint rejected") + return draft + + monkeypatch.setattr( + "veadk.cli.generated_agent_mcp.resolve_debug_mcp_endpoints", + capture_mcp_discovery, + ) + + class RuntimeDebugClient(_FakeAsyncClient): + 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, + } + ) + raise AssertionError(f"unexpected Runtime request path: {url}") + + monkeypatch.setenv("_FAAS_FUNC_ID", "function-test") + app = _generated_debug_app(monkeypatch, tmp_path) + _FakeProcess.created.clear() + _FakeAsyncClient.listed_apps = ["legacy_agent"] + monkeypatch.setattr("subprocess.Popen", _FakeProcess) + monkeypatch.setattr("httpx.AsyncClient", RuntimeDebugClient) + real_socket = socket.socket + monkeypatch.setattr( + "socket.socket", + lambda *args, **kwargs: ( + real_socket(*args, **kwargs) + if len(args) >= 4 or "fileno" in kwargs + else _FakeSocket(*args, **kwargs) + ), + ) + + with TestClient(app) as client: + edited_draft = json.loads(json.dumps(published_draft)) + edited_draft["mcpTools"][0]["url"] = edited_url + response = client.post( + "/web/generated-agent-test-runs", + json={ + "draft": edited_draft, + "runtimeId": runtime.runtime_id, + "runtimeRegion": "cn-shanghai", + }, + ) + + assert response.status_code == expected_status, response.text + if expect_credential: + assert captured_discovery_env[credential_reference] == credential_value + else: + assert credential_reference not in captured_discovery_env + assert credential_value not in response.text + + def test_debug_text_redacts_environment_and_inline_markers( monkeypatch: pytest.MonkeyPatch, ) -> None: diff --git a/tests/cli/test_studio_rbac.py b/tests/cli/test_studio_rbac.py index d0537ac9a..a51aabc39 100644 --- a/tests/cli/test_studio_rbac.py +++ b/tests/cli/test_studio_rbac.py @@ -1277,6 +1277,63 @@ async def initialize_evaluation_sets(**_kwargs: Any) -> list[str]: assert os.environ.get("BYTEPLUS_ACCESS_KEY") is None +def test_volcengine_deploy_omits_feedback_evaluation_sets_by_default( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + evaluation_set_calls = 0 + + def launch(*, config_file: str, **_kwargs: Any) -> SimpleNamespace: + assert Path(config_file).is_file() + return SimpleNamespace( + success=True, + error=None, + deploy_result=SimpleNamespace( + endpoint_url="https://runtime.example.com", + metadata={ + "runtime_id": "runtime-default-evaluation-off", + "runtime_name": "default-evaluation-off", + "runtime_endpoint": "https://runtime.example.com", + "runtime_apikey": "secret", + }, + ), + ) + + async def initialize_evaluation_sets(**_kwargs: Any) -> list[str]: + nonlocal evaluation_set_calls + evaluation_set_calls += 1 + return ["unexpected"] + + monkeypatch.setattr("agentkit.toolkit.sdk.launch", launch) + monkeypatch.setattr( + "frontend.server.evaluation_automation.datasets.ensure_feedback_sets", + initialize_evaluation_sets, + ) + app = _create_studio_app(monkeypatch, tmp_path, developers="developer") + + with TestClient(app) as client: + with client.stream( + "POST", + "/web/deploy-agentkit", + headers={"X-VeADK-Local-User": "developer"}, + json={ + "name": "default-evaluation-off", + "files": [{"path": "app.py", "content": "app = object()\n"}], + "config": {"region": "cn-beijing", "projectName": "default"}, + }, + ) as response: + frames = [ + json.loads(line.removeprefix("data: ")) + for line in response.iter_lines() + if line.startswith("data: ") + ] + + assert response.status_code == 200 + assert frames[-1]["success"] is True + assert not [frame for frame in frames if frame.get("phase") == "evaluation"] + assert evaluation_set_calls == 0 + + def test_migration_routes_require_agent_management_role( monkeypatch: pytest.MonkeyPatch, tmp_path: Path, @@ -5442,6 +5499,7 @@ async def _mark_validated_oauth_token(request: Request, call_next): "removeRuntimeEnvKeys": remove_runtime_env_keys, "files": [{"path": "app.py", "content": "app = object()\n"}], "config": {"region": region, "projectName": "default"}, + "createEvaluationSets": True, "authentication": {"type": "api_key"}, "im": {"feishu": {"enabled": not remove_feishu_credentials}}, "envs": requested_envs, diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 815500e50..338801c66 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -4451,6 +4451,7 @@ async def _agentkit_proxy(request: Request, path: str): debug_runtime_env_from_draft, generate_project_from_draft, normalize_and_validate_draft, + prepare_mcp_auth, ) from veadk.cli.generated_agent_security import ( DebugPolicyError, @@ -5077,10 +5078,15 @@ async def _generate_project_and_draft_from_request( *, debug: bool, owner_id: str = "local", + validated_test_request: GeneratedAgentTestRunRequest | None = None, + debug_mcp_env_values: Mapping[str, str] | None = None, ) -> tuple[GeneratedProject, AgentDraft]: try: if debug: - req = GeneratedAgentTestRunRequest.model_validate(data) + req = ( + validated_test_request + or GeneratedAgentTestRunRequest.model_validate(data) + ) else: req = GeneratedAgentProjectRequest.model_validate(data) draft = normalize_and_validate_draft(req.draft) @@ -5099,7 +5105,18 @@ async def _generate_project_and_draft_from_request( else _cloud_studio_private_networks ), ) - draft = await resolve_debug_mcp_endpoints(draft) + if debug_mcp_env_values: + draft = prepare_mcp_auth(draft) + mcp_env_values = dict(draft.deployment.envValues) + for key, value in debug_mcp_env_values.items(): + if value and not mcp_env_values.get(key): + mcp_env_values[key] = value + draft = await resolve_debug_mcp_endpoints( + draft, + mcp_env_values, + ) + else: + draft = await resolve_debug_mcp_endpoints(draft) else: validate_project_policy(draft) project = generate_project_from_draft(draft) @@ -5658,10 +5675,99 @@ async def _create_generated_agent_test_run(request: Request): temp_dir = "" proc = None try: + try: + test_request = GeneratedAgentTestRunRequest.model_validate(data) + except ValidationError as error: + raise HTTPException(status_code=422, detail=error.errors()) from error + + runtime_envs: dict[str, str] = {} + debug_mcp_env_values: dict[str, str] = {} + runtime_id = test_request.runtimeId.strip() + runtime_region = _coerce_cloud_region(test_request.runtimeRegion) + if runtime_id: + edited_draft = test_request.draft.model_dump( + mode="json", + by_alias=True, + exclude_none=True, + ) + requested_references = mcp_auth_environment_keys(edited_draft) + requested_env_values = test_request.draft.deployment.envValues + stored_references = tuple( + reference + for reference in requested_references + if not requested_env_values.get(reference) + ) + if stored_references: + ( + update_capability, + runtime, + ) = await _runtime_update_capability_details( + request, + runtime_id=runtime_id, + region=runtime_region, + ) + else: + update_capability = {} + runtime = await asyncio.to_thread( + _authorized_runtime, + request, + runtime_id, + runtime_region, + coded_access_error=True, + ) + runtime_envs = { + str(item.key): str(item.value or "") + for item in (getattr(runtime, "envs", None) or []) + if getattr(item, "key", None) + and not _is_debug_protected_model_env(str(item.key)) + } + published_agent = update_capability.get("agent") + published_draft = ( + published_agent.get("draft") + if isinstance(published_agent, Mapping) + else None + ) + if stored_references and isinstance(published_draft, Mapping): + published_environment = _legacy_runtime_environment(runtime) + published_references = mcp_auth_environment_keys(published_draft) + published_reference_values = { + reference: published_environment[reference] + for reference in published_references + if published_environment.get(reference) + } + if set(published_references).difference(published_reference_values): + try: + recovery, recovered_values = _legacy_mcp_state( + runtime, + runtime_region, + ) + published_reference_values.update( + mcp_secret_values_for_draft_references( + draft=published_draft, + recovery=recovery, + recovered_values=recovered_values, + ) + ) + except LegacyRecoveryError as error: + logger.info( + "debug MCP credential recovery unavailable " + "runtime_id=%s region=%s code=%s", + runtime_id, + 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, + ) + project, draft = await _generate_project_and_draft_from_request( data, debug=True, owner_id=owner_id or "local", + validated_test_request=test_request, + debug_mcp_env_values=debug_mcp_env_values, ) sidecar_env: dict[str, str] = {} sidecar_plan: dict[str, Any] | None = None @@ -5698,25 +5804,6 @@ async def _create_generated_agent_test_run(request: Request): status_code=409, detail="Harness Sidecar 配置已更新,请重新解析后再启动调试。", ) - runtime_envs: dict[str, str] = {} - runtime_id = str(data.get("runtimeId") or "").strip() - if runtime_id: - runtime_region = ( - str(data.get("runtimeRegion") or "cn-beijing").strip() - or "cn-beijing" - ) - runtime = _authorized_runtime( - request, - runtime_id, - runtime_region, - coded_access_error=True, - ) - runtime_envs = { - str(item.key): str(item.value or "") - for item in (getattr(runtime, "envs", None) or []) - if getattr(item, "key", None) - and not _is_debug_protected_model_env(str(item.key)) - } temp_dir = tempfile.mkdtemp(prefix="veadk_generated_agent_test_") app_name = _write_generated_project(project, temp_dir) staged_environment_skills = "" @@ -6444,7 +6531,7 @@ async def _deploy_to_agentkit(request: Request): trusted_intelligent_source = source.get("kind") == "intelligentDevelopment" config = data.get("config", {}) task_id = str(data.get("taskId") or f"deploy-{id(request)}").strip() - create_evaluation_sets = data.get("createEvaluationSets", True) + create_evaluation_sets = data.get("createEvaluationSets", False) author, owner_id = runtime_attribution(principal) environment_ref = ( data.get("environment") if isinstance(data.get("environment"), dict) else {} diff --git a/veadk/webui/assets/app/index-BghMFnjN.js b/veadk/webui/assets/app/index-DrDSbkyg.js similarity index 99% rename from veadk/webui/assets/app/index-BghMFnjN.js rename to veadk/webui/assets/app/index-DrDSbkyg.js index bd31d1475..883e6a2fe 100644 --- a/veadk/webui/assets/app/index-BghMFnjN.js +++ b/veadk/webui/assets/app/index-DrDSbkyg.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-zvRmi_H8.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-s7eQqghJ.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-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={};/** * @license React * react-jsx-runtime.production.js @@ -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 axt={parse:Jvt,stringify:sxt};var NEe=axt;const oxt=2e5,lxt=new Set(["__proto__","constructor","prototype"]),cxt=/^(?: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"&&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-zvRmi_H8.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-DqQIQjjY.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(` +`||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 mxt(e){let t=e,n=0;for(;;){const i=pxt(t,n);if(!i)return t;const r=dxt(t,i.openingIndex),s=t.slice(i.openingIndex+1,r),a=JSON.stringify(hxt(i.type,s));t=`${t.slice(0,i.index)}${a}${t.slice(r+1)}`,n=i.index+a.length}}function gxt(e,t=!1){if(e.length>oxt)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,` `).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(` @@ -1056,17 +1056,17 @@ README.md ${c}`:e}}return`${e} ${t}`}function X9t(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const i=n.indexOf(` `);return i>=0&&(n=n.slice(i+1)),{text:n,omitted:!0}}function Y9t(e,t,n=G9t){const i=K9t((e==null?void 0:e.text)??"",t.text??""),r=X9t(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 Z9t(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 J9t(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 eFt({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 tFt({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),D0e(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(()=>Z9t(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 I0e({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 R0e({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(eFt,{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:J9t(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",wke);xo.registerLanguage("typescript",Ike);xo.registerLanguage("javascript",mke);xo.registerLanguage("json",gke);xo.registerLanguage("yaml",Pke);xo.registerLanguage("markdown",xke);xo.registerLanguage("bash",JB);xo.registerLanguage("ini",uke);xo.registerLanguage("dockerfile",Emt);xo.registerLanguage("makefile",vke);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 nFt(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 iFt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>rje),void 0)),pp=()=>{};function rFt({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 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:"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 aFt({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(D7e,{})}),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 oFt({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 lFt(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 cFt={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 uFt(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 cFt[r]??null}function dFt(e,t){try{const n=uFt(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 fFt(e){return[{phase:"build",label:e("projectPreview.steps.buildImage")},{phase:"deploy",label:e("projectPreview.steps.deploy")},{phase:"publish",label:e("projectPreview.steps.publish")}]}function hFt(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 pFt(e){return e?!e.memory.shortTerm||(e.shortTermBackend||"local")==="local":!1}function mFt(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 gFt(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 bFt(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 yFt(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function vFt({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=pFt(i),X=(r==null?void 0:r.trim())||(i==null?void 0:i.name)||e.name,ae=p.useMemo(()=>Xje(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(Rje),[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(!0),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=mFt(Yr,sa,B),Co=!re&&Xi.valid&&(Xi.min!==1||Xi.max!==5),xe=Q?hFt(B):fFt(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 Lbe(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(l7e,{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}:gFt(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=N9t(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,yFt()])}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=Pje(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=ARe(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}):R9t(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=sRe(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(` +`).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 Z9t(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 J9t(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 eFt({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 tFt({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),D0e(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(()=>Z9t(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 I0e({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 R0e({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(eFt,{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:J9t(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",wke);xo.registerLanguage("typescript",Ike);xo.registerLanguage("javascript",mke);xo.registerLanguage("json",gke);xo.registerLanguage("yaml",Pke);xo.registerLanguage("markdown",xke);xo.registerLanguage("bash",JB);xo.registerLanguage("ini",uke);xo.registerLanguage("dockerfile",Emt);xo.registerLanguage("makefile",vke);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 nFt(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 iFt=p.lazy(()=>Md(()=>Promise.resolve().then(()=>rje),void 0)),pp=()=>{};function rFt({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 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:"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 aFt({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(D7e,{})}),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 oFt({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 lFt(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 cFt={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 uFt(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 cFt[r]??null}function dFt(e,t){try{const n=uFt(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 fFt(e){return[{phase:"build",label:e("projectPreview.steps.buildImage")},{phase:"deploy",label:e("projectPreview.steps.deploy")},{phase:"publish",label:e("projectPreview.steps.publish")}]}function hFt(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 pFt(e){return e?!e.memory.shortTerm||(e.shortTermBackend||"local")==="local":!1}function mFt(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 gFt(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 bFt(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 yFt(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function vFt({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=pFt(i),X=(r==null?void 0:r.trim())||(i==null?void 0:i.name)||e.name,ae=p.useMemo(()=>Xje(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(Rje),[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=mFt(Yr,sa,B),Co=!re&&Xi.valid&&(Xi.min!==1||Xi.max!==5),xe=Q?hFt(B):fFt(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 Lbe(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(l7e,{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}:gFt(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=N9t(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,yFt()])}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=Pje(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=ARe(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}):R9t(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=sRe(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 L0e({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=nFt(_t,si.phase);si.buildLog?we=Y9t(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 P0e({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(Ibe(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(()=>oUe);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=aRe({agentId:be.agentId,deployAction:be.deployAction,deploySource:be.deploySource,createMode:be.createMode,aiAssisted:be.aiAssisted});try{const Ct=D9t(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(g7e,{className:"pp-ic"}),B("projectPreview.exportYaml")]}),se&&l&&o.jsx(nSt,{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 bFt(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(v7e,{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(w7e,{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(vFt,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[I&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:I,children:[o.jsx(Sbe,{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(b7e,{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(_7e,{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(iFt,{value:Si.content,path:Si.path,onChange:ed})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:dFt(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:lFt(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(oFt,{value:ia,disabled:Ce,onChange:be=>{Mt(null),Nr(be)}})]})]})]}),o.jsx(tFt,{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(q9t,{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(Dje,{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(sFt,{}):o.jsx(rFt,{})})]}),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(Abe,{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(aFt,{open:Ot,isUpdate:re,...h,onCancel:nd,onConfirm:()=>void ji()})]})}const xFt=new Set(["MODEL_AGENT_API_KEY"]),wFt=new Set(["MODEL_AGENT_NAME","MODEL_NAME"]),OFt=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!OFt.has(e)}function kk(e){return xFt.has(e)||/(?:API_KEY|ACCESS_KEY|SECRET_KEY|PRIVATE_KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIAL)$/.test(e)}function SFt(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):wFt.has(r)?wh(t):e.environment.defaults[r];s!=null&&s.trim()&&(n[r]=s)}return n}function kFt({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:Xje(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 EFt="_Container_1tuad_1",CFt="_Checkbox_1tuad_22",TFt="_CheckMark_1tuad_92",AFt="_Label_1tuad_162",O2={Container:EFt,Checkbox:CFt,CheckMark:TFt,Label:AFt},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(Mze,{className:O2.Checkbox,id:l,disabled:i,...s,children:o.jsx($ze,{className:O2.CheckMark})}),t&&o.jsx("label",{htmlFor:l,className:O2.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},_Ft="_RadioGroup_onrfm_1",NFt="_RadioLabel_onrfm_9",jFt="_RadioIndicatorWrapper_onrfm_26",RFt="_RadioItem_onrfm_43",IFt="_RadioIndicator_onrfm_26",Gw={RadioGroup:_Ft,RadioLabel:NFt,RadioIndicatorWrapper:jFt,RadioItem:RFt,RadioIndicator:IFt},NRe=p.createContext(null),PFt=()=>{const e=p.use(NRe);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(NRe,{value:a,children:o.jsx(iWe,{className:pi(Gw.RadioGroup,n),"data-direction":i,onValueChange:e,disabled:r,...s,children:t})})},DFt=({value:e,disabled:t=!1,required:n,children:i,className:r,block:s=!1,...a})=>{const{disabled:l}=PFt(),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(oWe,{id:d,value:e,disabled:c,required:n,className:Gw.RadioItem,children:o.jsx(cWe,{className:Gw.RadioIndicator})})}),i]})})};Wg.Item=DFt;function MFt({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",MFt),sequential:uw("sequential",O7e),parallel:uw("parallel",P7e),loop:uw("loop",_be),a2a:uw("a2a",Zj)},LFt=[dw.llm,dw.sequential,dw.parallel,dw.loop,dw.a2a],jRe=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 RRe=new Set(["local","sqlite","mysql","postgresql"]),IRe=new Set(["local","opensearch","redis","viking","openviking","mem0"]),PRe=new Set(["opensearch","viking","context_search","openviking"]),DRe=new Set(["apmplus","cozeloop","tls"]),MRe=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),$Ft=new Set(["llm","sequential","parallel","loop","a2a"]),FFt=new Set(["lark-cli","github-cli","pandoc"]),BFt=new Set(["default","ops"]);function En(e,t=""){return typeof e=="string"?e:t}function al(e){return e===!0}function UFt(e){return typeof e=="string"&&BFt.has(e)?e:"default"}function xv(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function QFt(e){return Array.from(new Set(xv(e).filter(t=>FFt.has(t))))}function zFt(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function LRe(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 $Re(e){return typeof e=="string"&&$Ft.has(e)?e:"llm"}function FRe(e){return e==="byteplus"?"byteplus":"volcengine"}function BRe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function URe(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 VFt(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:UFt(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 QRe(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const i=n&&typeof n=="object"?n:{},r=FRe(i.cloudProvider??t),s=i.memory&&typeof i.memory=="object"?i.memory:{},a=URe(i.a2aRegistry),l=$Re(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:BRe(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=>MRe.has(u)),customTools:LRe(i.customTools),memory:{shortTerm:al(s.shortTerm),longTerm:al(s.longTerm)},shortTermBackend:wv(i.shortTermBackend,RRe,"local"),longTermBackend:wv(i.longTermBackend,IRe,"local"),longTermMemoryIndex:En(i.longTermMemoryIndex),autoSaveSession:al(i.autoSaveSession),knowledgebase:al(i.knowledgebase),knowledgebaseBackend:wv(i.knowledgebaseBackend,PRe,nm),knowledgebaseIndex:En(i.knowledgebaseIndex),tracing:al(i.tracing),tracingExporters:xv(i.tracingExporters).filter(u=>DRe.has(u)),a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,subAgents:QRe(i.subAgents,r),selectedSkills:zRe(i)}}):[]}function zRe(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 HFt(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=zFt(i.envValues),s=t.cloudEnvironment&&typeof t.cloudEnvironment=="object"?t.cloudEnvironment:{},a=URe(t.a2aRegistry),l=$Re(t.agentType),c=a.enabled&&l==="llm"?"a2a":l,u=FRe(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:BRe(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=>MRe.has(f)),customTools:LRe(t.customTools),mcpTools:d,a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,memory:{shortTerm:al(n.shortTerm),longTerm:al(n.longTerm)},shortTermBackend:wv(t.shortTermBackend,RRe,"local"),longTermBackend:wv(t.longTermBackend,IRe,"local"),longTermMemoryIndex:En(t.longTermMemoryIndex),autoSaveSession:al(t.autoSaveSession),knowledgebase:al(t.knowledgebase),knowledgebaseBackend:wv(t.knowledgebaseBackend,PRe,nm),knowledgebaseIndex:En(t.knowledgebaseIndex),tracing:al(t.tracing),tracingExporters:xv(t.tracingExporters).filter(f=>DRe.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:QFt(s.cliTools),...typeof s.dockerfile=="string"?{dockerfile:s.dockerfile}:{}},harnessSidecar:VFt(t.harnessSidecar),subAgents:QRe(t.subAgents,u),selectedSkills:zRe(t)}}function VRe(e,t=e.cloudProvider??"volcengine"){const n=e.cloudProvider??t,i=new Set(gOe(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=>VRe(r,n))}}const qFt=/^[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 WFt(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&&qFt.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 HRe(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 GFt(e,t){let n=e.name.trim();if(!n){const i=HRe(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 qRe(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=GFt(l,c),d=HRe(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 KFt(e){const t=new Set;return dj(e,n=>{const i=d1(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function WRe(e){const t=new Set;return dj(e,n=>{const i=d1(n);i&&t.add(i)}),[...t]}function XFt(e,t){const n=new Set(WRe(t));return[...new Set(e)].filter(i=>!n.has(i))}function YFt(e){if(e.credentialUpdate==="pending")return"";if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=d1(e);return t?`\${${t}}`:""}function ZFt(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 JFt(e){const t={...e,credentialConfigured:!1};return delete t.authToken,delete t.authTokenEnv,t}function e7t(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 GRe(e){return e.credentialUpdate==="pending"}function t7t(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 n7t(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 i7t(e){const t=I8(e);return t.credentialUpdate="remove",t}function r7t(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 s7t(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 a7t(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=WFt(`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 KRe(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=>KRe(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(KRe(r))}const c7t={missing_http_tool:"helpers.mcpGateway.missingHttpTool",missing_url:"helpers.mcpGateway.missingUrl"};function Dne(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 Dne("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 Dne("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 Mne(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 XRe({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)} · ${Mne(_,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:Mne(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 Lne(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 $ne({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(JFe,{"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&&Lne(Z)?Z:"local"}),B=v7t(Q),[ee,le]=p.useState("1"),[se,re]=p.useState(B==="in-memory"?"1":"5"),[ge,W]=p.useState(!0),[X,ae]=p.useState(Rje),[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=Pje(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(XRe,{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=>{Lne(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(Dje,{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(vbe,{"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($ne,{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($ne,{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(bbe,{"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(PFe,{"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 Fne=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function kL(e){let t=0;for(let n=0;n>>0;return Fne[t%Fne.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 Bne(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 Une(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 YRe({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=lye(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:Bne(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)}}),Bne(N.end_time-N.start_time)]}),o.jsx("div",{className:"td-section",children:a("trace.attributes")}),o.jsx("div",{className:"td-props",children:Une(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))}),Une(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-s7eQqghJ.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 ZRe(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){ZRe([...hz(),e])}function fw(e){ZRe(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:I7e,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:p7e},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:M7e},{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:Tbe},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:o7e},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:R7e}];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 Qne({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"},zne={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},JRe="REGISTRY_SPACE_ID",U7t=mOe.filter(e=>e.key!==JRe);function eIe(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:MBe(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:xl(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:$Be(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:FBe(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:BBe(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 Vne(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 Hne(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 qne({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=DBe(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(qne,{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(qne,{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 tIe({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(tIe,{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=>Vne(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Vne(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(tIe,{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=>Hne(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[Hne(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?t7t(m,h.target.value):m))}),e7t(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":GRe(d),value:YFt(d),placeholder:d.credentialConfigured&&!d.authToken?r("traditional.mcp.configuredPlaceholder"):r("traditional.mcp.tokenPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?ZFt(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?n7t(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?i7t(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?JFt(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),Wne=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(GRe)?"mcpAuthRequired":jRe(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function nIe(e,t,n=[]){const i=[];if(n.length===0){const a=qRe(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(...nIe(a,t,[...n,l]))),i}function iBt(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function iIe(e){return 1+e.subAgents.reduce((t,n)=>t+iIe(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=Bst(n.draft).map(mA);let c=!1,u="";for(const h of SRe(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(mOe,a)}),Object.assign(s,eIe(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=jst.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 rIe(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=kRe(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{...TRe(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 sIe(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(sIe(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=rIe(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(Qne,{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(ICe,{}):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(j7e,{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(Qne,{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(s7e,{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:Rst.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:P4t(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 zne))return;const Ge=zne[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>=Wne)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>=Wne)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(()=>gOe(d),[d]),as=p.useMemo(()=>new Set(zi.map(Y=>Y.id)),[zi]),Lr=pe.mcpTools??[],_r=We?qRe(w):null,xs=pe.selectedSkills??[],os=Y=>{as.has(Y)&&Fe({builtinTools:ri.includes(Y)?ri.filter(we=>we!==Y):[...ri,Y]})},ia=jRe(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(()=>v$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(()=>nIe(w,ra),[w,ra]),Jn=Qa.length===0,Ni=p.useMemo(()=>Ig(w,d),[d,w]),Eo=Fst(w),xa=aN(w),Xi=Ist(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(()=>kRe(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:rIe(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?$st(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=b$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 aye(sIe(lt,j),u?{runtimeId:u.runtimeId,region:u.region}:void 0),M7t(zn.runId),ds="create_test_session";const Sn=await oye(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 cye({runId:un.run.runId,userId:"test_user",sessionId:un.sessionId,text:Y})){const Ri=Yi.error||Yi.errorMessage||Yi.error_message;if(Ri||(Nn=Oye(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?s7t(w):un?r7t(w):void 0,mcpCredentialReuses:u?a7t(w):void 0,removeRuntimeEnvKeys:u?[...XFt(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=j9t(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:LBe(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:LFt.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(JRe,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:eIe(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:Tbe}),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(XRe,{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:iIe(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(YRe,{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 Gne=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 aIe(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=aIe(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=Rkt(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=aIe(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>Gne){k(l("codePackage.errors.tooLarge"));return}y(!0);try{const R=await Eje(new Uint8Array(await T.arrayBuffer()),{maxEntries:F8,maxUncompressedBytes:Gne}),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 Kne(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 Xne(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(ACe,{})})]}),o.jsx("div",{className:"migration-optimize-dialog__body",children:o.jsx(wRe,{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(xRe,{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,Yne=3e3,KBt=5e3,Zne=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 oIe(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:oIe(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,Zne)},[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:Zne})}):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}=qEe(`${(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||!Jne(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(),Yne))}catch(tn){if(xe.signal.aborted)return;bt(y("activity.loadError")),fg(Z.state)&&tn instanceof sl&&tn.retryable&&(Xe=window.setTimeout(()=>void Yt(),Yne))}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(eie(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=SFt(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 Kne(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 Kne(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)||eie((Z==null?void 0:Z.sourceFileName)||"migration.zip"),files:[{path:"migration-result.json",content:`${JSON.stringify(ve,null,2)} +`+FU(KRe(r))}const c7t={missing_http_tool:"helpers.mcpGateway.missingHttpTool",missing_url:"helpers.mcpGateway.missingUrl"};function Dne(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 Dne("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 Dne("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 Mne(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 XRe({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)} · ${Mne(_,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:Mne(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 Lne(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 $ne({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(JFe,{"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&&Lne(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(Rje),[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=Pje(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(XRe,{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=>{Lne(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(Dje,{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(vbe,{"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($ne,{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($ne,{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(bbe,{"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(PFe,{"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 Fne=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function kL(e){let t=0;for(let n=0;n>>0;return Fne[t%Fne.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 Bne(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 Une(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 YRe({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=lye(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:Bne(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)}}),Bne(N.end_time-N.start_time)]}),o.jsx("div",{className:"td-section",children:a("trace.attributes")}),o.jsx("div",{className:"td-props",children:Une(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))}),Une(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-D_TDjSd9.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 ZRe(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){ZRe([...hz(),e])}function fw(e){ZRe(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:I7e,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:p7e},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:M7e},{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:Tbe},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:o7e},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:R7e}];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 Qne({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"},zne={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},JRe="REGISTRY_SPACE_ID",U7t=mOe.filter(e=>e.key!==JRe);function eIe(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:MBe(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:xl(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:$Be(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:FBe(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:BBe(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 Vne(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 Hne(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 qne({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=DBe(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(qne,{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(qne,{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 tIe({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(tIe,{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=>Vne(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Vne(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(tIe,{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=>Hne(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[Hne(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?t7t(m,h.target.value):m))}),e7t(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":GRe(d),value:YFt(d),placeholder:d.credentialConfigured&&!d.authToken?r("traditional.mcp.configuredPlaceholder"):r("traditional.mcp.tokenPlaceholder"),onChange:h=>i(e.map((m,g)=>g===f?ZFt(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?n7t(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?i7t(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?JFt(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),Wne=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(GRe)?"mcpAuthRequired":jRe(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function nIe(e,t,n=[]){const i=[];if(n.length===0){const a=qRe(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(...nIe(a,t,[...n,l]))),i}function iBt(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function iIe(e){return 1+e.subAgents.reduce((t,n)=>t+iIe(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=Bst(n.draft).map(mA);let c=!1,u="";for(const h of SRe(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(mOe,a)}),Object.assign(s,eIe(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=jst.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 rIe(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=kRe(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{...TRe(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 sIe(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(sIe(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=rIe(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(Qne,{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(ICe,{}):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(j7e,{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(Qne,{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(s7e,{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:Rst.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:P4t(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 zne))return;const Ge=zne[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>=Wne)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>=Wne)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(()=>gOe(d),[d]),as=p.useMemo(()=>new Set(zi.map(Y=>Y.id)),[zi]),Lr=pe.mcpTools??[],_r=We?qRe(w):null,xs=pe.selectedSkills??[],os=Y=>{as.has(Y)&&Fe({builtinTools:ri.includes(Y)?ri.filter(we=>we!==Y):[...ri,Y]})},ia=jRe(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(()=>v$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(()=>nIe(w,ra),[w,ra]),Jn=Qa.length===0,Ni=p.useMemo(()=>Ig(w,d),[d,w]),Eo=Fst(w),xa=aN(w),Xi=Ist(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(()=>kRe(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:rIe(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?$st(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=b$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 aye(sIe(lt,j),u?{runtimeId:u.runtimeId,region:u.region}:void 0),M7t(zn.runId),ds="create_test_session";const Sn=await oye(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 cye({runId:un.run.runId,userId:"test_user",sessionId:un.sessionId,text:Y})){const Ri=Yi.error||Yi.errorMessage||Yi.error_message;if(Ri||(Nn=Oye(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?s7t(w):un?r7t(w):void 0,mcpCredentialReuses:u?a7t(w):void 0,removeRuntimeEnvKeys:u?[...XFt(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=j9t(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:LBe(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:LFt.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(JRe,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:eIe(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:Tbe}),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(XRe,{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:iIe(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(YRe,{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 Gne=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 aIe(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=aIe(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=Rkt(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=aIe(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>Gne){k(l("codePackage.errors.tooLarge"));return}y(!0);try{const R=await Eje(new Uint8Array(await T.arrayBuffer()),{maxEntries:F8,maxUncompressedBytes:Gne}),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 Kne(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 Xne(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(ACe,{})})]}),o.jsx("div",{className:"migration-optimize-dialog__body",children:o.jsx(wRe,{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(xRe,{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,Yne=3e3,KBt=5e3,Zne=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 oIe(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:oIe(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,Zne)},[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:Zne})}):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}=qEe(`${(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||!Jne(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(),Yne))}catch(tn){if(xe.signal.aborted)return;bt(y("activity.loadError")),fg(Z.state)&&tn instanceof sl&&tn.retryable&&(Xe=window.setTimeout(()=>void Yt(),Yne))}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(eie(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=SFt(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 Kne(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 Kne(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)||eie((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)}),Jne(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:oIe(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(Xne,{})})]}):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(Xne,{})})]}):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 lIe=1,pUt="MODEL_AGENT_API_KEY",cIe="WorkspaceDraftError";function B8(e){const t=new Error($t(e));return t.name=cIe,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(WRe(t.draft)),new Set(Object.keys(t.envValues)))}function uIe(e){return{...e,draft:gUt(e.draft)}}function bUt(e){const t=Array.isArray(e)?e:pj(e)&&e.version===lIe?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(uIe)}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===cIe?i:B8("helpers.drafts.readFailed")}}function tie(e,t,n){if(!t)return;const i={version:lIe,drafts:n.map(uIe)};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",dIe=["permissions","resolving","downloading","preparing","provisioning","scheduler","submitting","publishing"];function DL(e,t,n=!1){const i=n&&dIe.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 nie(){window.sessionStorage.removeItem(yz)}function iie({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 rie({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 sie({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 Q0e(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()=>{nie(),C.current="",S.current=F,E.current=Date.now(),a("checking-permissions"),d(""),x("idle");try{const B=await z0e();if(h(B),!B.ready){pw(),a("permission");return}h(null),ML(F,E.current),a("submitting");const ee=await V0e(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=dIe.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(iie,{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(iie,{})}),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(sie,{lines:L,phase:"error",copyState:y,onCopy:B=>void H(B)}),i.updateLogsVisible===!1&&o.jsx(rie,{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(rie,{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 aie=wUt();function DUt({canUpdate:e=!1}){const{t}=Te("newChat"),n=aie.length?aie:[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 fIe(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 hIe(e){return fIe("/web/sandbox/capabilities",e)}async function pIe(e,t){return fIe(`/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 oie(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=pRe(t,g),v=t.status==="optimizing"||t.status==="generating",y=t.errorStage==="optimization"?s("video.task.retryOptimization"):s("video.task.retryGeneration"),x=hRe(t.resolvedMode??t.requestedMode,g),O=t.error.includes("尚未开通"),w=e9t(t,g),k=t.generationStartedAt===null?"":J8t(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(oie,{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(oie,{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 lie(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(lie)},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 lie(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(uRe,{})})]}),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(cRe,{}),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(b8t,{}),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 mIe=new Set(["creating","pending","running","starting","initializing"]),gIe="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)===gIe)??r.find(a=>mIe.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 cie(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(tRe,{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:cie(e.createdAt,x)})]}),b?null:o.jsxs("div",{children:[o.jsx("dt",{children:r("agentDetails.expiresAt")}),o.jsx("dd",{children:cie(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",$ae,!0,!0);an.hasResourceBundle("zh-CN","sandbox")||an.addResourceBundle("zh-CN","sandbox",tde,!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 bIe(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(bIe).filter(n=>!t||[n.name,n.description,...n.keywords].some(i=>i.toLocaleLowerCase().includes(t))).sort((n,i)=>uie(n,t)-uie(i,t)).slice(0,12)}function uie(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(bIe).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 yIe(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(g8t,{}),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(u8t,{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(h8t,{className:"icon"}),E("composer.uploadImage")]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>se(j),children:[o.jsx(p8t,{className:"icon"}),E("composer.uploadDocument")]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>se(A),children:[o.jsx(m8t,{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(cRe,{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(v8t,{}):o.jsx(y8t,{})}):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(f8t,{className:"icon"}):a?o.jsx(ju,{className:"icon spin"}):o.jsx(d8t,{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 vIe(){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:vIe()})}function die(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 fie(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 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("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(()=>vIe(),[]),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(die,{})})]}),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(hie,{}),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(fie,{}),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(fie,{}),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(hie,{}),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(die,{}):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(S7e,{className:"icon"}):o.jsx(E7e,{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(""),jbe().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=Q7e.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:()=>V7e(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 xIe(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 pie(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){pie(e,t,":before",n),pie(e,t,":after",n)}const mie="application/font-woff",gie="image/jpeg",YQt={woff:mie,woff2:mie,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gie,jpeg:gie,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 OIe(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 OIe(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(SIe(e))}const azt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",SIe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ozt(e,t,n){var i,r;if(SIe(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):xIe(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 kIe=/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(kIe,(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 EIe(e){return e.search(kIe)!==-1}async function CIe(e,t,n){if(!EIe(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 CIe(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=>TIe(r,t));await Promise.all(i).then(()=>e)}async function TIe(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 bie={};async function yie(e){let t=bie[e];if(t!=null)return t;const i=await(await fetch(e)).text();return t={url:e,cssText:i},bie[e]=t,t}async function vie(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),OIe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(a,`url(${c})`),[a,c]))});return Promise.all(s).then(()=>n)}function xie(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=yie(c).then(d=>vie(d,t)).then(d=>xie(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(yie(r.href).then(l=>vie(l,t)).then(l=>xie(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=>EIe(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 AIe(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(AIe(s))}),Array.from(i.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function _Ie(e,t){const n=await Ezt(e,t),i=Czt(e);return(await Promise.all(n.filter(s=>i.has(AIe(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return CIe(s.cssText,a,t)}))).join(` -`)}async function Tzt(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await _Ie(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}=wIe(e,t),r=await JI(e,t,!0);return await Tzt(r,t),await TIe(r,t),Ozt(r,t),await qQt(r,n,i)}async function _zt(e,t={}){const{width:n,height:i}=wIe(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 _Ie(e,t)}const Rzt=816,HA=1154,Izt=12e3,Pzt=.72,Dzt=HA*1.12,A2=10,NIe=[".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(NIe)).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 jIe(e,t,n,i){if(e.matches(NIe))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 RIe(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=RIe(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-Df6srQ2e.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,RIe(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,IIe=1200;function wz(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function PIe(e){return wz(e.trim(),rVt)}function DIe(e){return wz(e,IIe)}function wie(e){return e.trim().length>0}function sVt(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=PIe(e),r=DIe(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 _Ie(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}=wIe(e,t),r=await JI(e,t,!0);return await Tzt(r,t),await TIe(r,t),Ozt(r,t),await qQt(r,n,i)}async function _zt(e,t={}){const{width:n,height:i}=wIe(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 _Ie(e,t)}const Rzt=816,HA=1154,Izt=12e3,Pzt=.72,Dzt=HA*1.12,A2=10,NIe=[".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(NIe)).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 jIe(e,t,n,i){if(e.matches(NIe))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 RIe(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=RIe(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-CV8XpAZ1.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,RIe(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,IIe=1200;function wz(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function PIe(e){return wz(e.trim(),rVt)}function DIe(e){return wz(e,IIe)}function wie(e){return e.trim().length>0}function sVt(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=PIe(e),r=DIe(t.trim());return wz(`${n.selectedExcerpt}${n.separator}${i} ${n.annotation}${n.separator}${r}`,iVt)}function Oie(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=Oie(t.anchorNode),i=Oie(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=PIe(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||!wie(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:IIe,disabled:c,invalid:!!d,"aria-label":r("annotation.content"),placeholder:r("annotation.placeholder"),onChange:y=>{l(DIe(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:!wie(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 MIe(e){return mVt[e]??"flex-start"}function LIe(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:MIe(e.justify),alignItems:LIe(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:MIe(e.justify),alignItems:LIe(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([hIe(),pIe("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 Sie(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,kie=5e3,TVt=500,AVt=new Set,_Vt=[],Sf=["list_envs","get_env_manifest","execute_in_sandbox","delegate_to_codex_sandbox"],$Ie="veadk.sessionEnvironmentMounts.v1";function Eie(){return{mounts:{},workspaceIds:{}}}function NVt(){if(typeof localStorage>"u")return Eie();try{const e=JSON.parse(localStorage.getItem($Ie)??"{}"),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 Eie()}}function jVt(e,t){if(!(typeof localStorage>"u"))try{localStorage.setItem($Ie,JSON.stringify({mounts:e,workspaceIds:t}))}catch{}}function Ul(){return{skills:[]}}function yw(e,t,n){return`${e}\0${t}\0${n}`}async function Cie(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=yIe(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 Tie(e){return e.replace(/__[0-9a-f]{10}(?:__.*)?$/i,"")}function Aie(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 FIe(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(...FIe(n)));return t}function _ie(){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 Nie({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"?HEe(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 jie({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(XFe,{className:"icon","aria-hidden":"true"})})}const Rie=Array.from({length:14},(e,t)=>`greetings.${t}`),Iie=()=>Rie[Math.floor(Math.random()*Rie.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 Pie(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Die(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 Mie(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 Lie(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 $ie(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=hye(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 yRe($.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=aRe({agentId:$.agentName,deployAction:"create",deploySource:"intelligent_development",createMode:"intelligent",aiAssisted:1});try{const{blob:G,filename:ie}=await g9t($),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=$ie(Re.config);if(rt.length>0){const nn=await Promise.all(rt.map(It=>n8t(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 i8t({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 r8t({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 s8t(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:o8t(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(mRe(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=$ie(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=Z8t({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 a8t($.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(Iie),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({}),[BIe,Oz]=p.useState({}),[UIe,h0]=p.useState({}),Sz=_n.has(l),g1=fn.has(l),p0=Sz||m,m0=y?k:p0,QIe=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(yIe($)),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 zIe=oC[l]??"",VIe=BIe[l]??AVt,HIe=UIe[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,qIe=(tP==null?void 0:tP.skills)??(wa.targetAgent?[]:(Qn==null?void 0:Qn.skills)??[]),WIe=ps?FIe(ps):[],Ez=(ps==null?void 0:ps.instruction)??((oV=Qn==null?void 0:Qn.draft)==null?void 0:oV.instruction),GIe=Qn&&Ez!==void 0?fUe({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 KIe($){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(_ie),[Az,_z]=p.useState([]),[XIe,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})},[]),[YIe,ZIe]=p.useState(!0),[b0,ms]=p.useState(!1),[JIe,iP]=p.useState("skills"),[cC,rP]=p.useState({kind:"key",key:"titles.skillLibrary"}),ePe=cC.kind==="key"?e(cC.key,{name:cC.name}):cC.title,tPe=p.useCallback($=>{rP(z=>z.kind==="literal"&&z.title===$?z:{kind:"literal",title:$})},[]),[nPe,uC]=p.useState(null),[dC,Ur]=p.useState(!1),[y0,ui]=p.useState(!1),[iPe,uf]=p.useState("entry"),[sP,v0]=p.useState("traditional"),[Nz,Va]=p.useState(null),[rPe,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(""),[sPe,aPe]=p.useState("good"),[oPe,hC]=p.useState("basic"),[lPe,cPe]=p.useState("good"),[v1,pC]=p.useState(""),[uPe,dPe]=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($),$}),[fPe,Dz]=p.useState(!1),[hPe,Mz]=p.useState(""),[Lz,bC]=p.useState(null),[pPe,$z]=p.useState({}),[mPe,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]),[gPe,hP]=p.useState(!1),vC=p.useRef(!1),k0=p.useRef(!1),rd=p.useCallback($=>{if(!Lt)return!1;try{tie(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]),bPe=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&&tie(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 yPe=p.useCallback($=>{if(!Lt)return;const z=[...new Set($.filter(Boolean))];fC(z),localStorage.setItem(q8(Lt),JSON.stringify(z))},[Lt]),vPe=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 nye(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))&&(GPe(),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 xPe($){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),wPe=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=Aie(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:++wPe.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 OPe=p.useCallback(()=>{const $=E0.current;!$||rp.current||(ip.current=$.scrollHeight-$.scrollTop-$.clientHeight<32)},[]),SPe=p.useCallback($=>{$.deltaY<0&&(rp.current=!1,ip.current=!1)},[]),kPe=p.useCallback(()=>{rp.current=!1,ip.current=!1},[]),EPe=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,$),J7e()&&$(),()=>window.removeEventListener(m4,$)},[]);const CPe=p.useCallback(async()=>{if(c0.current)return;c0.current=!0;const $=H7e();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),eBe(),$.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),U0e().then(z=>{$||Xh(z)}).catch(z=>{console.warn("[app] /web/access failed; using ordinary-user access:",z),$||Xh(B0e)}),()=>{$=!0}},[Br,Lt]),p.useEffect(()=>{F0e().then($=>{const z="prod";d$t({enabled:$.telemetry.enabled,environment:z});const G=$.telemetry.studio;f$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)??""}),p$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();$&&(h$t({userUniqueId:$,accountId:Wi.telemetry.accountId??"",userRole:Wi.role==="admin"?"admin":"member",userSource:Xn?"local":"sso"}),m$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:ePe||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=Z$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($=>{$&&ZIe(!!$.credentials)}).catch($=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",$)})},[]);function TPe($){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 APe(){Xh(null),Xn?(z7e(),u0(""),d0(void 0),l0("unauthenticated")):W7e()}p.useEffect(()=>{if(Br==="authenticated"){if(kc==="cloud"){const $=Mie(hu);r(z=>z&&$.includes(z)?z:(z&&(k0.current=!0,localStorage.removeItem(yu.app)),""));return}$be().then($=>{n($);const z=Mie(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 $=Lie(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(kie)}}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(kie):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(_ie()===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 Sie($,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"?hIe(G.signal):pIe($,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 _Pe(){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 NPe($,z,G){var Ne;(Ne=ye.current)==null||Ne.abort();const ie=new AbortController;ye.current=ie,ke("loading"),Le("");const fe=g$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 jPe($,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 Cie(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 RPe($){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 IPe($,z="my_agents"){lt("");const G=w2({targetId:String($),agentKind:"codex",connectSource:z});try{const ie=await dr.connectSession($),fe=await Cie(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 PPe($){ot($.toolName),dP({page:"sandbox-agent-detail",returnTo:"agents"}),Pe($),bt(null),sr(!0),rr(!1),lt("")}async function DPe($){$.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 MPe(){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 LPe(){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 $Pe($){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 FPe=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 BPe($){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 UPe($){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 QPe($){const z=y;if(!z||re)return;const G=++Qe.current;lt(""),ge(!0);const ie=Array.from($).map(fe=>{const Ne={id:Pie(),mimeType:Die(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 zPe($){const z=Hs.find(G=>G.id===$);z&&(We(z.previewUrl),$r(G=>G.filter(ie=>ie.id!==$)))}function VPe(){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 HPe(){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-DqQIQjjY.js b/veadk/webui/assets/chunks/CodeDiffEditor-CEoOh5b3.js similarity index 99% rename from veadk/webui/assets/chunks/CodeDiffEditor-DqQIQjjY.js rename to veadk/webui/assets/chunks/CodeDiffEditor-CEoOh5b3.js index 32173a9ce..815f0da98 100644 --- a/veadk/webui/assets/chunks/CodeDiffEditor-DqQIQjjY.js +++ b/veadk/webui/assets/chunks/CodeDiffEditor-CEoOh5b3.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-BghMFnjN.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-s7eQqghJ.js b/veadk/webui/assets/chunks/MarkdownPromptEditor-D_TDjSd9.js similarity index 99% rename from veadk/webui/assets/chunks/MarkdownPromptEditor-s7eQqghJ.js rename to veadk/webui/assets/chunks/MarkdownPromptEditor-D_TDjSd9.js index 970a091fe..f688d2cc7 100644 --- a/veadk/webui/assets/chunks/MarkdownPromptEditor-s7eQqghJ.js +++ b/veadk/webui/assets/chunks/MarkdownPromptEditor-D_TDjSd9.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-BghMFnjN.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-DrDSbkyg.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-DIFRJAlh.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-BG3_BTp-.js b/veadk/webui/assets/chunks/index.es-ywE1lWsR.js similarity index 99% rename from veadk/webui/assets/chunks/index.es-BG3_BTp-.js rename to veadk/webui/assets/chunks/index.es-ywE1lWsR.js index 53aa04098..830a44548 100644 --- a/veadk/webui/assets/chunks/index.es-BG3_BTp-.js +++ b/veadk/webui/assets/chunks/index.es-ywE1lWsR.js @@ -1,4 +1,4 @@ -import{L as Ke,a8 as Do}from"../app/index-BghMFnjN.js";import{_ as Xa}from"./jspdf.es.min-Df6srQ2e.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-DrDSbkyg.js";import{_ as Xa}from"./jspdf.es.min-CV8XpAZ1.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-Df6srQ2e.js b/veadk/webui/assets/chunks/jspdf.es.min-CV8XpAZ1.js similarity index 99% rename from veadk/webui/assets/chunks/jspdf.es.min-Df6srQ2e.js rename to veadk/webui/assets/chunks/jspdf.es.min-CV8XpAZ1.js index 7fcb13a9b..65ef1472c 100644 --- a/veadk/webui/assets/chunks/jspdf.es.min-Df6srQ2e.js +++ b/veadk/webui/assets/chunks/jspdf.es.min-CV8XpAZ1.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/index.es-BG3_BTp-.js","assets/app/index-BghMFnjN.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-BghMFnjN.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-DrDSbkyg.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-BG3_BTp-.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-ywE1lWsR.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-DrDSbkyg.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-pZs22V0-.js b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-B29YUl57.js similarity index 86% rename from veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-pZs22V0-.js rename to veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-B29YUl57.js index 411785bf2..ba78b738f 100644 --- a/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-pZs22V0-.js +++ b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-B29YUl57.js @@ -1 +1 @@ -import{g as p,r as u,d as n}from"./chunk-6Q2QTUOP-BAMwxW8C.js";import{p as f}from"./chunk-JWPE2WC7-CnOYqciR.js";import{a,at as o}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-BDEKezxG.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-BCw2FKcW.js";import{p as f}from"./chunk-JWPE2WC7-BOJuOOaZ.js";import{a,at as o}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-DKpH19Te.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-BDUspHNj.js b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-PMJr7sI-.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BDUspHNj.js rename to veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-PMJr7sI-.js index e28509d73..02877e234 100644 --- a/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BDUspHNj.js +++ b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-PMJr7sI-.js @@ -1,4 +1,4 @@ -import{p as qe}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as cr}from"./cynefin-OW5HDTMX-BDEKezxG.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as Te,a8 as gr,aB as ur}from"../../app/index-BghMFnjN.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as cr}from"./cynefin-OW5HDTMX-DKpH19Te.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as Te,a8 as gr,aB as ur}from"../../app/index-DrDSbkyg.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-CLyorRKg.js b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CNTRtLYk.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CLyorRKg.js rename to veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CNTRtLYk.js index f1be3e8fe..3e00d320b 100644 --- a/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CLyorRKg.js +++ b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CNTRtLYk.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-BUuVvI3_.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-zvRmi_H8.js";import{aB as O}from"../../app/index-BghMFnjN.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-CaKgKiXs.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-Bw-frwih.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-DIFRJAlh.js";import{aB as O}from"../../app/index-DrDSbkyg.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-BOyxvQK6.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-Cae4gy7g.js b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-BChGqELS.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Cae4gy7g.js rename to veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-BChGqELS.js index eaf134c99..e5b84003c 100644 --- a/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Cae4gy7g.js +++ b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-BChGqELS.js @@ -1,4 +1,4 @@ -import{g as Se,e as De}from"./chunk-2GRJ4B5K-CsxmIqME.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-zvRmi_H8.js";import{aB as jt}from"../../app/index-BghMFnjN.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-Cpt1I9VE.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-DIFRJAlh.js";import{aB as jt}from"../../app/index-DrDSbkyg.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-CsxmIqME.js b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-Cpt1I9VE.js similarity index 93% rename from veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CsxmIqME.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-Cpt1I9VE.js index 7fffbb6a8..9bc7fd159 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CsxmIqME.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-Cpt1I9VE.js @@ -1 +1 @@ -import{a as i,ar as d,aO as o}from"./mermaid.core-zvRmi_H8.js";import{aB as l}from"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{aB as l}from"../../app/index-DrDSbkyg.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-BBfqg1zM.js b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-CU-_PF6u.js similarity index 66% rename from veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-BBfqg1zM.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-CU-_PF6u.js index 6b7b75bc3..bfcc56483 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-BBfqg1zM.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-CU-_PF6u.js @@ -1 +1 @@ -import{a as s}from"./mermaid.core-zvRmi_H8.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-DIFRJAlh.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-BXC-12VF.js b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-aLKUoBsu.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-BXC-12VF.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-aLKUoBsu.js index 3940c27f8..ab8584fb8 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-BXC-12VF.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-aLKUoBsu.js @@ -1,4 +1,4 @@ -import{g as ee}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as se}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import{c as fe}from"./chunk-2GRJ4B5K-CsxmIqME.js";import{aB as Dt}from"../../app/index-BghMFnjN.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-DwzbC2Dj.js";import{s as se}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import{c as fe}from"./chunk-2GRJ4B5K-Cpt1I9VE.js";import{aB as Dt}from"../../app/index-DrDSbkyg.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-BUuVvI3_.js b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-Bw-frwih.js similarity index 83% rename from veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BUuVvI3_.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-Bw-frwih.js index a363d33e3..7ef9ae2de 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BUuVvI3_.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-Bw-frwih.js @@ -1,4 +1,4 @@ -import{a as e}from"./mermaid.core-zvRmi_H8.js";var l=e(()=>` +import{a as e}from"./mermaid.core-DIFRJAlh.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BAMwxW8C.js b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BCw2FKcW.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BAMwxW8C.js rename to veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BCw2FKcW.js index 049fde5e0..2faec8c85 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BAMwxW8C.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-BCw2FKcW.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-zvRmi_H8.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-DIFRJAlh.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-CopkVVcD.js b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CjC9SgQf.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CopkVVcD.js rename to veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CjC9SgQf.js index dd0fbb504..2638d9cfd 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CopkVVcD.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-CjC9SgQf.js @@ -1,4 +1,4 @@ -import{g as st}from"./chunk-5VM5RSS4-BUuVvI3_.js";import{g as it}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as at}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import{c as mt}from"./chunk-2GRJ4B5K-CsxmIqME.js";import{aB as fe}from"../../app/index-BghMFnjN.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-Bw-frwih.js";import{g as it}from"./chunk-XXDRQBXY-DwzbC2Dj.js";import{s as at}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import{c as mt}from"./chunk-2GRJ4B5K-Cpt1I9VE.js";import{aB as fe}from"../../app/index-DrDSbkyg.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-CnOYqciR.js b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-BOJuOOaZ.js similarity index 78% rename from veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-CnOYqciR.js rename to veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-BOJuOOaZ.js index 46bd9c336..054d94ea2 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-CnOYqciR.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-BOJuOOaZ.js @@ -1 +1 @@ -import{a as l}from"./mermaid.core-zvRmi_H8.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-DIFRJAlh.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-BjHMFaWV.js b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BFMFlWAI.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BjHMFaWV.js rename to veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BFMFlWAI.js index 7c29a7a8d..421422187 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BjHMFaWV.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-BFMFlWAI.js @@ -1 +1 @@ -import{a,B as w,at as x}from"./mermaid.core-zvRmi_H8.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-DIFRJAlh.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-CgUJXTQz.js b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-B6K8N_TN.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-CgUJXTQz.js rename to veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-B6K8N_TN.js index 4be42bcbb..4ef84d1c8 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-CgUJXTQz.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-B6K8N_TN.js @@ -1 +1 @@ -import{a as d,at as i}from"./mermaid.core-zvRmi_H8.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-DIFRJAlh.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-D1mvyA-R.js b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DwzbC2Dj.js similarity index 53% rename from veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-D1mvyA-R.js rename to veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DwzbC2Dj.js index c19030155..fde0e8ef2 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-D1mvyA-R.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-DwzbC2Dj.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-zvRmi_H8.js";import{aB as o}from"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{aB as o}from"../../app/index-DrDSbkyg.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-B3UoohtC.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B3UoohtC.js deleted file mode 100644 index 70b89e3d5..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-B3UoohtC.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CopkVVcD.js";import{a as i}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import"./chunk-5VM5RSS4-BUuVvI3_.js";import"./chunk-XXDRQBXY-D1mvyA-R.js";import"./chunk-KBJHAD2P-BjHMFaWV.js";import"./chunk-2GRJ4B5K-CsxmIqME.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-DCAOEH9i.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DCAOEH9i.js new file mode 100644 index 000000000..1ab332a44 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DCAOEH9i.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CjC9SgQf.js";import{a as i}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import"./chunk-5VM5RSS4-Bw-frwih.js";import"./chunk-XXDRQBXY-DwzbC2Dj.js";import"./chunk-KBJHAD2P-BFMFlWAI.js";import"./chunk-2GRJ4B5K-Cpt1I9VE.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-B3UoohtC.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B3UoohtC.js deleted file mode 100644 index 70b89e3d5..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B3UoohtC.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CopkVVcD.js";import{a as i}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import"./chunk-5VM5RSS4-BUuVvI3_.js";import"./chunk-XXDRQBXY-D1mvyA-R.js";import"./chunk-KBJHAD2P-BjHMFaWV.js";import"./chunk-2GRJ4B5K-CsxmIqME.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-DCAOEH9i.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DCAOEH9i.js new file mode 100644 index 000000000..1ab332a44 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DCAOEH9i.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-CjC9SgQf.js";import{a as i}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import"./chunk-5VM5RSS4-Bw-frwih.js";import"./chunk-XXDRQBXY-DwzbC2Dj.js";import"./chunk-KBJHAD2P-BFMFlWAI.js";import"./chunk-2GRJ4B5K-Cpt1I9VE.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-CmheEffx.js b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-P8wTxlHV.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-CmheEffx.js rename to veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-P8wTxlHV.js index ae3f20c2c..ca82dc9ee 100644 --- a/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-CmheEffx.js +++ b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-P8wTxlHV.js @@ -1 +1 @@ -import{a as V,at as k}from"./mermaid.core-zvRmi_H8.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as $,a8 as lt,aB as gt}from"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{L as $,a8 as lt,aB as gt}from"../../app/index-DrDSbkyg.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-BDEKezxG.js b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DKpH19Te.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-BDEKezxG.js rename to veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DKpH19Te.js index 34b887939..d455b69b2 100644 --- a/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-BDEKezxG.js +++ b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DKpH19Te.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-BghMFnjN.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-DrDSbkyg.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as Bt}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.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-mz2Xz3uP.js b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-B7OcovWp.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-mz2Xz3uP.js rename to veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-B7OcovWp.js index 5bf434108..61a77ee1d 100644 --- a/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-mz2Xz3uP.js +++ b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-B7OcovWp.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-CgUJXTQz.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-zvRmi_H8.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-BghMFnjN.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-B6K8N_TN.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-DIFRJAlh.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-DrDSbkyg.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-BLRGvaRA.js b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-bIojOXvj.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-BLRGvaRA.js rename to veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-bIojOXvj.js index 512a60531..9db655b34 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-BLRGvaRA.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-bIojOXvj.js @@ -1,4 +1,4 @@ -import{I as z}from"./chunk-2Q5K7J3B-BBfqg1zM.js";import{p as O}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as re}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.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-CU-_PF6u.js";import{p as O}from"./chunk-JWPE2WC7-BOJuOOaZ.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-DIFRJAlh.js";import{p as re}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.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-DW5rcXCO.js b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-DmSmX2ct.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-DW5rcXCO.js rename to veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-DmSmX2ct.js index 2493685d9..2cca97c48 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-DW5rcXCO.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-DmSmX2ct.js @@ -1,3 +1,3 @@ -import{p as oe}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-BDEKezxG.js";import{aB as we}from"../../app/index-BghMFnjN.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-DKpH19Te.js";import{aB as we}from"../../app/index-DrDSbkyg.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-CwZ5JfXy.js b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B7BvwrFE.js similarity index 94% rename from veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-CwZ5JfXy.js rename to veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B7BvwrFE.js index 521879190..2e58a285b 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-CwZ5JfXy.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-B7BvwrFE.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as N}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as N}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.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-OMr-4g1c.js b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-fnR-JIUC.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-OMr-4g1c.js rename to veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-fnR-JIUC.js index 950904401..e44db5b81 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-OMr-4g1c.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-fnR-JIUC.js @@ -1,4 +1,4 @@ -import{p as ge}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{s as Ne}from"./chunk-KBJHAD2P-BjHMFaWV.js";import{p as Me}from"./cynefin-OW5HDTMX-BDEKezxG.js";import{aB as Q}from"../../app/index-BghMFnjN.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-BOJuOOaZ.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-DIFRJAlh.js";import{s as Ne}from"./chunk-KBJHAD2P-BFMFlWAI.js";import{p as Me}from"./cynefin-OW5HDTMX-DKpH19Te.js";import{aB as Q}from"../../app/index-DrDSbkyg.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-Ba1z5Z84.js b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-CD9_oIaI.js similarity index 95% rename from veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-Ba1z5Z84.js rename to veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-CD9_oIaI.js index 5069e8887..55bebdca3 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-Ba1z5Z84.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-CD9_oIaI.js @@ -1,4 +1,4 @@ -import{p as I}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as X}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.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-BCw2FKcW.js";import{p}from"./chunk-JWPE2WC7-BOJuOOaZ.js";import{a as t,at as o}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-DKpH19Te.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-BhhzuVhC.js b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-BqDJ_eox.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-BhhzuVhC.js rename to veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-BqDJ_eox.js index f016bbcde..d97b67a49 100644 --- a/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-BhhzuVhC.js +++ b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-BqDJ_eox.js @@ -1,4 +1,4 @@ -import{g as Bt}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as Ft}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import{aB as Jt}from"../../app/index-BghMFnjN.js";import{c as $t}from"../../chunks/channel-CaKgKiXs.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-DwzbC2Dj.js";import{s as Ft}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import{aB as Jt}from"../../app/index-DrDSbkyg.js";import{c as $t}from"../../chunks/channel-BOyxvQK6.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-BnMBJoUW.js b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BBJrja2h.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BnMBJoUW.js rename to veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BBJrja2h.js index 71955895e..f8653783c 100644 --- a/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BnMBJoUW.js +++ b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BBJrja2h.js @@ -1,4 +1,4 @@ -import{g as Xt}from"./chunk-5VM5RSS4-BUuVvI3_.js";import{g as Qt}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as Jt}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import{c as fe}from"./chunk-2GRJ4B5K-CsxmIqME.js";import{aB as it}from"../../app/index-BghMFnjN.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-CaKgKiXs.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-Bw-frwih.js";import{g as Qt}from"./chunk-XXDRQBXY-DwzbC2Dj.js";import{s as Jt}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import{c as fe}from"./chunk-2GRJ4B5K-Cpt1I9VE.js";import{aB as it}from"../../app/index-DrDSbkyg.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-BOyxvQK6.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-Cte4pA_E.js b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-6V-kA62G.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-Cte4pA_E.js rename to veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-6V-kA62G.js index fe9cee8f3..486105c20 100644 --- a/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-Cte4pA_E.js +++ b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-6V-kA62G.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-zvRmi_H8.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-BghMFnjN.js";import{b as qn,t as Oe,c as Gn,a as jn,l as Qn}from"../../chunks/linear-CfIcNiPP.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-DIFRJAlh.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-DrDSbkyg.js";import{b as qn,t as Oe,c as Gn,a as jn,l as Qn}from"../../chunks/linear-BH38WWmj.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-CKhOzY2l.js b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-wofP8tVj.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CKhOzY2l.js rename to veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-wofP8tVj.js index 1f0be5050..d2fd7aae3 100644 --- a/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CKhOzY2l.js +++ b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-wofP8tVj.js @@ -1,4 +1,4 @@ -import{I as he}from"./chunk-2Q5K7J3B-BBfqg1zM.js";import{p as $e}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as Be}from"./cynefin-OW5HDTMX-BDEKezxG.js";import{aB as Ce}from"../../app/index-BghMFnjN.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-CU-_PF6u.js";import{p as $e}from"./chunk-JWPE2WC7-BOJuOOaZ.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-DIFRJAlh.js";import{p as Be}from"./cynefin-OW5HDTMX-DKpH19Te.js";import{aB as Ce}from"../../app/index-DrDSbkyg.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-CTlXoskR.js b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-NxEP5KEo.js similarity index 69% rename from veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-CTlXoskR.js rename to veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-NxEP5KEo.js index 893a2411d..a8cfbb997 100644 --- a/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-CTlXoskR.js +++ b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-NxEP5KEo.js @@ -1,2 +1,2 @@ -import{a as e,at as s,aP as n,B as i}from"./mermaid.core-zvRmi_H8.js";import{p}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{p}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.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-BY0FA-Hx.js b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-CYK-Z6qK.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-BY0FA-Hx.js rename to veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-CYK-Z6qK.js index 4b99146be..02b46ff1a 100644 --- a/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-BY0FA-Hx.js +++ b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-CYK-Z6qK.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-zvRmi_H8.js";import"../../app/index-BghMFnjN.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-DIFRJAlh.js";import"../../app/index-DrDSbkyg.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-xfdDF0eR.js b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-83lr1vs2.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-xfdDF0eR.js rename to veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-83lr1vs2.js index 054242295..2b7aac2ba 100644 --- a/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-xfdDF0eR.js +++ b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-83lr1vs2.js @@ -1,4 +1,4 @@ -import{g as gt}from"./chunk-5VM5RSS4-BUuVvI3_.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-CsxmIqME.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-zvRmi_H8.js";import{aB as G}from"../../app/index-BghMFnjN.js";import{d as it}from"../../chunks/arc-U0016Dxb.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-Bw-frwih.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-Cpt1I9VE.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-DIFRJAlh.js";import{aB as G}from"../../app/index-DrDSbkyg.js";import{d as it}from"../../chunks/arc-Cf13o3c-.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-Dp1MWLQ4.js b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-CqjnZtZ-.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-Dp1MWLQ4.js rename to veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-CqjnZtZ-.js index dfc690aba..cc00ee0bb 100644 --- a/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-Dp1MWLQ4.js +++ b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-CqjnZtZ-.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-zvRmi_H8.js";import{g as Ne}from"./chunk-5VM5RSS4-BUuVvI3_.js";import"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{g as Ne}from"./chunk-5VM5RSS4-Bw-frwih.js";import"../../app/index-DrDSbkyg.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-zvRmi_H8.js b/veadk/webui/assets/visualizations/mermaid/mermaid.core-DIFRJAlh.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mermaid.core-zvRmi_H8.js rename to veadk/webui/assets/visualizations/mermaid/mermaid.core-DIFRJAlh.js index 43fef6e70..485d83a96 100644 --- a/veadk/webui/assets/visualizations/mermaid/mermaid.core-zvRmi_H8.js +++ b/veadk/webui/assets/visualizations/mermaid/mermaid.core-DIFRJAlh.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/dagre-VZM6K2ZE-mz2Xz3uP.js","assets/visualizations/mermaid/chunk-RYQCIY6F-CgUJXTQz.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-BghMFnjN.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-Dx-21Bxz.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-CmheEffx.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-Cae4gy7g.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-CsxmIqME.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BnMBJoUW.js","assets/visualizations/mermaid/chunk-5VM5RSS4-BUuVvI3_.js","assets/visualizations/mermaid/chunk-XXDRQBXY-D1mvyA-R.js","assets/visualizations/mermaid/chunk-KBJHAD2P-BjHMFaWV.js","assets/chunks/channel-CaKgKiXs.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-1_GRLMGz.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-BhhzuVhC.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CKhOzY2l.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-BBfqg1zM.js","assets/visualizations/mermaid/chunk-JWPE2WC7-CnOYqciR.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-BDEKezxG.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-Cte4pA_E.js","assets/chunks/linear-CfIcNiPP.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-CTlXoskR.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-CRPDTFAS.js","assets/chunks/arc-U0016Dxb.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CjlmFCI4.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DZr8r99o.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BcH8jW5-.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-DYijrPjz.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-B3UoohtC.js","assets/visualizations/mermaid/chunk-GF5L2VYU-CopkVVcD.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-B3UoohtC.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-D_yegtAR.js","assets/visualizations/mermaid/chunk-5RXB4S5H-BXC-12VF.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CyeTdqHj.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-xfdDF0eR.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-15gq1ysl.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-C4HMbRuU.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-Dp1MWLQ4.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CiawNi1Y.js","assets/visualizations/mermaid/diagram-LBJQPF4R-CwZ5JfXy.js","assets/visualizations/mermaid/diagram-UB23O5K3-Ba1z5Z84.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CLyorRKg.js","assets/visualizations/mermaid/diagram-7IWD3JNH-BLRGvaRA.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-BDUspHNj.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-DW5rcXCO.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-BY0FA-Hx.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-BaqcIeAW.js","assets/visualizations/mermaid/diagram-Q27KOJAE-OMr-4g1c.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Cb9xJDoM.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-ChLLNXju.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-OvRL3Aqr.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-BAMwxW8C.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-M9b2d1BE.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-pZs22V0-.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-ChUZwIPn.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-BghMFnjN.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-B7OcovWp.js","assets/visualizations/mermaid/chunk-RYQCIY6F-B6K8N_TN.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-DrDSbkyg.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-D8P6-g_Y.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-P8wTxlHV.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-BChGqELS.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-Cpt1I9VE.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BBJrja2h.js","assets/visualizations/mermaid/chunk-5VM5RSS4-Bw-frwih.js","assets/visualizations/mermaid/chunk-XXDRQBXY-DwzbC2Dj.js","assets/visualizations/mermaid/chunk-KBJHAD2P-BFMFlWAI.js","assets/chunks/channel-BOyxvQK6.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-ChusEoNO.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-BqDJ_eox.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-wofP8tVj.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-CU-_PF6u.js","assets/visualizations/mermaid/chunk-JWPE2WC7-BOJuOOaZ.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-DKpH19Te.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-6V-kA62G.js","assets/chunks/linear-BH38WWmj.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-NxEP5KEo.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-Bta2ILc4.js","assets/chunks/arc-Cf13o3c-.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-C_XF1UAa.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CC6YDU2C.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-Bkj8A__N.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Cg7TCjlQ.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-DCAOEH9i.js","assets/visualizations/mermaid/chunk-GF5L2VYU-CjC9SgQf.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DCAOEH9i.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-Cbw5Bqh6.js","assets/visualizations/mermaid/chunk-5RXB4S5H-aLKUoBsu.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DsOdxbWm.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-83lr1vs2.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-BioTVgYN.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-gK33vyoz.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-CqjnZtZ-.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-Bi2NxLcb.js","assets/visualizations/mermaid/diagram-LBJQPF4R-B7BvwrFE.js","assets/visualizations/mermaid/diagram-UB23O5K3-CD9_oIaI.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-CNTRtLYk.js","assets/visualizations/mermaid/diagram-7IWD3JNH-bIojOXvj.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-PMJr7sI-.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-DmSmX2ct.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-CYK-Z6qK.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DJvl0nxw.js","assets/visualizations/mermaid/diagram-Q27KOJAE-fnR-JIUC.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-B0YRW9sK.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-eH3Rj8nF.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-CpcTjzxu.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-BCw2FKcW.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-DTvFT4jm.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-B29YUl57.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-C4SjAJ9Y.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-DrDSbkyg.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-mz2Xz3uP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-Dx-21Bxz.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-CmheEffx.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-Cae4gy7g.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-BnMBJoUW.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-BnMBJoUW.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-1_GRLMGz.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-BhhzuVhC.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-CKhOzY2l.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-Cte4pA_E.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-CTlXoskR.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-CRPDTFAS.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-CjlmFCI4.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-DZr8r99o.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-BcH8jW5-.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-DYijrPjz.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-B3UoohtC.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-B3UoohtC.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-D_yegtAR.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-CyeTdqHj.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-xfdDF0eR.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-BnMBJoUW.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-15gq1ysl.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-C4HMbRuU.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-Dp1MWLQ4.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-CiawNi1Y.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-CwZ5JfXy.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-Ba1z5Z84.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-CLyorRKg.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-BLRGvaRA.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-BDUspHNj.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-DW5rcXCO.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-BY0FA-Hx.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-BaqcIeAW.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-OMr-4g1c.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-Cb9xJDoM.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-ChLLNXju.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-OvRL3Aqr.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-M9b2d1BE.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-pZs22V0-.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-ChUZwIPn.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-B7OcovWp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-D8P6-g_Y.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-P8wTxlHV.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-BChGqELS.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-BBJrja2h.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-BBJrja2h.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-ChusEoNO.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-BqDJ_eox.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-wofP8tVj.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-6V-kA62G.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-NxEP5KEo.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-Bta2ILc4.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-C_XF1UAa.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-CC6YDU2C.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-Bkj8A__N.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-Cg7TCjlQ.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-DCAOEH9i.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-DCAOEH9i.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-Cbw5Bqh6.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-DsOdxbWm.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-83lr1vs2.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-BBJrja2h.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-BioTVgYN.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-gK33vyoz.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-CqjnZtZ-.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-Bi2NxLcb.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-B7BvwrFE.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-CD9_oIaI.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-CNTRtLYk.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-bIojOXvj.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-PMJr7sI-.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-DmSmX2ct.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-CYK-Z6qK.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-DJvl0nxw.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-fnR-JIUC.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-B0YRW9sK.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-eH3Rj8nF.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-CpcTjzxu.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-DTvFT4jm.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-B29YUl57.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-C4SjAJ9Y.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-C4HMbRuU.js b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-gK33vyoz.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-C4HMbRuU.js rename to veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-gK33vyoz.js index 05a5b1eef..fc9bf500c 100644 --- a/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-C4HMbRuU.js +++ b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-gK33vyoz.js @@ -1,4 +1,4 @@ -import{g as oe}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as ce}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import"../../app/index-BghMFnjN.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-DwzbC2Dj.js";import{s as ce}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import"../../app/index-DrDSbkyg.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-ChUZwIPn.js b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-C4SjAJ9Y.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-ChUZwIPn.js rename to veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-C4SjAJ9Y.js index a5dde8ed4..bbd5689cb 100644 --- a/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-ChUZwIPn.js +++ b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-C4SjAJ9Y.js @@ -1 +1 @@ -import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-BAMwxW8C.js";import{p}from"./chunk-JWPE2WC7-CnOYqciR.js";import{a as t,at as o}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-BDEKezxG.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-BCw2FKcW.js";import{p}from"./chunk-JWPE2WC7-BOJuOOaZ.js";import{a as t,at as o}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-DKpH19Te.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-CRPDTFAS.js b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-Bta2ILc4.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-CRPDTFAS.js rename to veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-Bta2ILc4.js index 2380d65ec..db3d83353 100644 --- a/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-CRPDTFAS.js +++ b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-Bta2ILc4.js @@ -1,4 +1,4 @@ -import{p as rt}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as xt}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.js";import{d as Z}from"../../chunks/arc-U0016Dxb.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as xt}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.js";import{d as Z}from"../../chunks/arc-Cf13o3c-.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-CjlmFCI4.js b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-C_XF1UAa.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CjlmFCI4.js rename to veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-C_XF1UAa.js index 3d266b5ff..ee6408383 100644 --- a/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-CjlmFCI4.js +++ b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-C_XF1UAa.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-zvRmi_H8.js";import{aB as Vt}from"../../app/index-BghMFnjN.js";import{l as ie}from"../../chunks/linear-CfIcNiPP.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-DIFRJAlh.js";import{aB as Vt}from"../../app/index-DrDSbkyg.js";import{l as ie}from"../../chunks/linear-BH38WWmj.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-OvRL3Aqr.js b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-CpcTjzxu.js similarity index 84% rename from veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-OvRL3Aqr.js rename to veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-CpcTjzxu.js index ae826a362..64eb03f76 100644 --- a/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-OvRL3Aqr.js +++ b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-CpcTjzxu.js @@ -1 +1 @@ -import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-BAMwxW8C.js";import{p as m}from"./chunk-JWPE2WC7-CnOYqciR.js";import{a as n,at as i}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-BDEKezxG.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-BCw2FKcW.js";import{p as m}from"./chunk-JWPE2WC7-BOJuOOaZ.js";import{a as n,at as i}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-DKpH19Te.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-BcH8jW5-.js b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-Bkj8A__N.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BcH8jW5-.js rename to veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-Bkj8A__N.js index 72738356b..6191717dc 100644 --- a/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BcH8jW5-.js +++ b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-Bkj8A__N.js @@ -1,4 +1,4 @@ -import{g as ze}from"./chunk-XXDRQBXY-D1mvyA-R.js";import{s as Xe}from"./chunk-KBJHAD2P-BjHMFaWV.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-zvRmi_H8.js";import"../../app/index-BghMFnjN.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-DwzbC2Dj.js";import{s as Xe}from"./chunk-KBJHAD2P-BFMFlWAI.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-DIFRJAlh.js";import"../../app/index-DrDSbkyg.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-CiawNi1Y.js b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-Bi2NxLcb.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CiawNi1Y.js rename to veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-Bi2NxLcb.js index 0cf9301b2..2bdd97abf 100644 --- a/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-CiawNi1Y.js +++ b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-Bi2NxLcb.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-zvRmi_H8.js";import{aB as Q}from"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{aB as Q}from"../../app/index-DrDSbkyg.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-DYijrPjz.js b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Cg7TCjlQ.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-DYijrPjz.js rename to veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Cg7TCjlQ.js index cb96e97c1..9b22d04df 100644 --- a/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-DYijrPjz.js +++ b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-Cg7TCjlQ.js @@ -1,4 +1,4 @@ -import{I as er}from"./chunk-2Q5K7J3B-BBfqg1zM.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-zvRmi_H8.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-CsxmIqME.js";import{aB as Wt}from"../../app/index-BghMFnjN.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-CU-_PF6u.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-DIFRJAlh.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-Cpt1I9VE.js";import{aB as Wt}from"../../app/index-DrDSbkyg.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-Dw9vj0yB.js b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C0iQGuUk.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-Dw9vj0yB.js rename to veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C0iQGuUk.js index 18b648872..78e8296d7 100644 --- a/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-Dw9vj0yB.js +++ b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-C0iQGuUk.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.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-DIFRJAlh.js";import"../../app/index-DrDSbkyg.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-D_yegtAR.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-Cbw5Bqh6.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-D_yegtAR.js rename to veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-Cbw5Bqh6.js index 688452df9..a0455f7ec 100644 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-D_yegtAR.js +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-Cbw5Bqh6.js @@ -1 +1 @@ -import{b as R,s as W,S as N}from"./chunk-5RXB4S5H-BXC-12VF.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-zvRmi_H8.js";import{aB as H}from"../../app/index-BghMFnjN.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-D1mvyA-R.js";import"./chunk-KBJHAD2P-BjHMFaWV.js";import"./chunk-2GRJ4B5K-CsxmIqME.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-aLKUoBsu.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-DIFRJAlh.js";import{aB as H}from"../../app/index-DrDSbkyg.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-DwzbC2Dj.js";import"./chunk-KBJHAD2P-BFMFlWAI.js";import"./chunk-2GRJ4B5K-Cpt1I9VE.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-CyeTdqHj.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CyeTdqHj.js deleted file mode 100644 index 11034573a..000000000 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CyeTdqHj.js +++ /dev/null @@ -1 +0,0 @@ -import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-BXC-12VF.js";import{a as i}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import"./chunk-XXDRQBXY-D1mvyA-R.js";import"./chunk-KBJHAD2P-BjHMFaWV.js";import"./chunk-2GRJ4B5K-CsxmIqME.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-DsOdxbWm.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DsOdxbWm.js new file mode 100644 index 000000000..72bc1282d --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DsOdxbWm.js @@ -0,0 +1 @@ +import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-aLKUoBsu.js";import{a as i}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import"./chunk-XXDRQBXY-DwzbC2Dj.js";import"./chunk-KBJHAD2P-BFMFlWAI.js";import"./chunk-2GRJ4B5K-Cpt1I9VE.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-Dx-21Bxz.js b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D8P6-g_Y.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-Dx-21Bxz.js rename to veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D8P6-g_Y.js index eb0a59869..bd2ac421f 100644 --- a/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-Dx-21Bxz.js +++ b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-D8P6-g_Y.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-Dw9vj0yB.js","assets/visualizations/mermaid/mermaid.core-zvRmi_H8.js","assets/app/index-BghMFnjN.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); -import{_ as Rr}from"../../app/index-BghMFnjN.js";import{c as Nr}from"./chunk-RYQCIY6F-CgUJXTQz.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-zvRmi_H8.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-Dw9vj0yB.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-C0iQGuUk.js","assets/visualizations/mermaid/mermaid.core-DIFRJAlh.js","assets/app/index-DrDSbkyg.js","assets/styles/index-BilOAbdo.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); +import{_ as Rr}from"../../app/index-DrDSbkyg.js";import{c as Nr}from"./chunk-RYQCIY6F-B6K8N_TN.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-DIFRJAlh.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-C0iQGuUk.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-1_GRLMGz.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-1_GRLMGz.js deleted file mode 100644 index ac2fd87e0..000000000 --- a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-1_GRLMGz.js +++ /dev/null @@ -1,8 +0,0 @@ -import{c as r,s as e}from"./flowDiagram-UKHOOZJN-BnMBJoUW.js";import{a}from"./mermaid.core-zvRmi_H8.js";import"../../app/index-BghMFnjN.js";import"./chunk-5VM5RSS4-BUuVvI3_.js";import"./chunk-XXDRQBXY-D1mvyA-R.js";import"./chunk-KBJHAD2P-BjHMFaWV.js";import"./chunk-2GRJ4B5K-CsxmIqME.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-CaKgKiXs.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-ChusEoNO.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-ChusEoNO.js new file mode 100644 index 000000000..caf463056 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-ChusEoNO.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-UKHOOZJN-BBJrja2h.js";import{a}from"./mermaid.core-DIFRJAlh.js";import"../../app/index-DrDSbkyg.js";import"./chunk-5VM5RSS4-Bw-frwih.js";import"./chunk-XXDRQBXY-DwzbC2Dj.js";import"./chunk-KBJHAD2P-BFMFlWAI.js";import"./chunk-2GRJ4B5K-Cpt1I9VE.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-BOyxvQK6.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-15gq1ysl.js b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-BioTVgYN.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-15gq1ysl.js rename to veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-BioTVgYN.js index 91bb85163..b52fec1ce 100644 --- a/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-15gq1ysl.js +++ b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-BioTVgYN.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-zvRmi_H8.js";import{aB as J}from"../../app/index-BghMFnjN.js";import{d as ot}from"../../chunks/arc-U0016Dxb.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-DIFRJAlh.js";import{aB as J}from"../../app/index-DrDSbkyg.js";import{d as ot}from"../../chunks/arc-Cf13o3c-.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-BaqcIeAW.js b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DJvl0nxw.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-BaqcIeAW.js rename to veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DJvl0nxw.js index 525fa1e80..b84114702 100644 --- a/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-BaqcIeAW.js +++ b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DJvl0nxw.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-zvRmi_H8.js";import{aB as rt}from"../../app/index-BghMFnjN.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-DIFRJAlh.js";import{aB as rt}from"../../app/index-DrDSbkyg.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-Cb9xJDoM.js b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-B0YRW9sK.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Cb9xJDoM.js rename to veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-B0YRW9sK.js index b8a2235be..bc6f56905 100644 --- a/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-Cb9xJDoM.js +++ b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-B0YRW9sK.js @@ -1,4 +1,4 @@ -import{p as Tt}from"./chunk-JWPE2WC7-CnOYqciR.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-zvRmi_H8.js";import{p as Wt}from"./cynefin-OW5HDTMX-BDEKezxG.js";import"../../app/index-BghMFnjN.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-BOJuOOaZ.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-DIFRJAlh.js";import{p as Wt}from"./cynefin-OW5HDTMX-DKpH19Te.js";import"../../app/index-DrDSbkyg.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-DZr8r99o.js b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CC6YDU2C.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DZr8r99o.js rename to veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CC6YDU2C.js index 67e085297..0f632de1c 100644 --- a/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-DZr8r99o.js +++ b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-CC6YDU2C.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-zvRmi_H8.js";import"../../app/index-BghMFnjN.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-CfIcNiPP.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-DIFRJAlh.js";import"../../app/index-DrDSbkyg.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-BH38WWmj.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 8e3e5a113..b3b711e18 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,7 +5,7 @@ AgentKit Studio - +